| 1 |
#!/usr/bin/python3 |
| 2 |
import logging |
| 3 |
|
| 4 |
from mini_buildd import cli, webapp |
| 5 |
|
| 6 |
LOG = logging.getLogger("mini_buildd") |
| 7 |
|
| 8 |
#: Needed for man page hack in setup.py |
| 9 |
DESCRIPTION = "Run django database migrations on given database file" |
| 10 |
|
| 11 |
|
| 12 |
class CLI(cli.CLI): |
| 13 |
def __init__(self): |
| 14 |
super().__init__("run-migrations", DESCRIPTION) |
| 15 |
self.parser.add_argument("sqlite_path", action="store") |
| 16 |
|
| 17 |
def runcli(self): |
| 18 |
webapp.pseudo_configure(self.args.sqlite_path) |
| 19 |
webapp.migrate() |
| 20 |
|
| 21 |
|
| 22 |
if __name__ == "__main__": |
| 23 |
CLI().run() |