File tree Expand file tree Collapse file tree 6 files changed +36
-4
lines changed Expand file tree Collapse file tree 6 files changed +36
-4
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ prepend_sys_path = .
3939# are written from script.py.mako
4040# output_encoding = utf-8
4141
42- sqlalchemy.url = sqlite:///db.sqlite
42+ # sqlalchemy.url = sqlite:///db.sqlite
4343
4444
4545[post_write_hooks]
Original file line number Diff line number Diff line change @@ -32,6 +32,6 @@ setup() {
3232 mkdir alembic/versions
3333 alembic revision --autogenerate -m initial
3434 fi
35- alembic upgrade head
35+ python migrate.py
3636 fi
3737}
Original file line number Diff line number Diff line change 1- __version__ = "0.3.10 "
1+ __version__ = "0.3.11 "
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ prepend_sys_path = .
3939# are written from script.py.mako
4040# output_encoding = utf-8
4141
42- sqlalchemy.url = sqlite:///db.sqlite
42+ # sqlalchemy.url = sqlite:///db.sqlite
4343
4444
4545[post_write_hooks]
Original file line number Diff line number Diff line change 1+ import importlib
2+
3+ from alembic import command
4+ from alembic .config import Config
5+ from name import app_name
6+
7+ alembic_cfg = Config ("alembic.ini" )
8+
9+
10+ def db_setup ():
11+ importlib .import_module (f"{ app_name } .app" )
12+ command .upgrade (alembic_cfg , "head" )
13+
14+
15+ if __name__ == "__main__" :
16+ db_setup ()
Original file line number Diff line number Diff line change 1+ import importlib
2+
3+ from alembic import command
4+ from alembic .config import Config
5+ from name import app_name
6+
7+ alembic_cfg = Config ("alembic.ini" )
8+
9+
10+ def db_setup ():
11+ importlib .import_module (f"{ app_name } .app" )
12+ command .upgrade (alembic_cfg , "head" )
13+
14+
15+ if __name__ == "__main__" :
16+ db_setup ()
You can’t perform that action at this time.
0 commit comments