Conditions | 2 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 2 |
1 | 1 | from plugin.core.database import Database |
|
12 | 1 | def run(self): |
|
13 | 1 | log.debug('migrations_path: %r', migrations_path) |
|
14 | |||
15 | 1 | router = self._build_router() |
|
16 | |||
17 | # Validate current schema |
||
18 | 1 | if not router.validate(): |
|
19 | 1 | log.error('Detected corrupt/invalid database schema, resetting database...') |
|
20 | 1 | return self.reset() |
|
21 | else: |
||
22 | 1 | log.info('Database schema is valid') |
|
23 | |||
24 | # Run schema migrations |
||
25 | 1 | router.run() |
|
26 | 1 | return True |
|
27 | |||
52 |