18 lines
370 B
Python
18 lines
370 B
Python
"""One-shot schema migration entry point; API processes never migrate."""
|
|
from .config import Config
|
|
from .db import Database
|
|
|
|
|
|
def main():
|
|
database = Database(Config.from_env())
|
|
try:
|
|
database.open()
|
|
database.run_migrations()
|
|
print('PASS: migrations applied')
|
|
finally:
|
|
database.close()
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|