Conditions | 2 |
Total Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 2.0054 |
1 | 1 | from plugin.core.database import Database |
|
28 | 1 | @classmethod |
|
29 | def reset(cls): |
||
30 | 1 | if not Database.reset('main', db, 'invalid-schema'): |
|
31 | # Unable to reset database |
||
32 | return False |
||
33 | |||
34 | # Run migrations |
||
35 | 1 | router = cls._build_router() |
|
36 | 1 | router.run() |
|
37 | |||
38 | # Log message to channel menu |
||
39 | 1 | from plugin.managers.message import MessageManager |
|
40 | 1 | from plugin.models import Message |
|
41 | |||
42 | 1 | MessageManager.get.from_message(logging.WARNING, |
|
|
|||
43 | "Plugin database has been automatically reset due to schema corruption, see http://bit.ly/TFPx90101 for more details", |
||
44 | code=Message.Code.DatabaseSchemaCorruptionReset |
||
45 | ) |
||
46 | |||
47 | 1 | return True |
|
48 | |||
52 |