Fix migration order: add group limit columns before ORM queries
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+11
-3
@@ -85,12 +85,20 @@ def create_app(setup_database=True):
|
||||
|
||||
if setup_database:
|
||||
with app.app_context():
|
||||
from app.bootstrap import (
|
||||
create_first_admin,
|
||||
ensure_default_group,
|
||||
ensure_site_settings,
|
||||
run_schema_migrations,
|
||||
)
|
||||
|
||||
db.create_all()
|
||||
run_schema_migrations()
|
||||
|
||||
if os.getenv("SKIP_DB_INIT") != "1":
|
||||
from app.bootstrap import run_database_setup
|
||||
|
||||
run_database_setup(app)
|
||||
ensure_default_group(app)
|
||||
ensure_site_settings(app)
|
||||
create_first_admin(app)
|
||||
|
||||
return app
|
||||
|
||||
|
||||
Reference in New Issue
Block a user