This repository was archived by the owner on May 5, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +33
-2
lines changed Expand file tree Collapse file tree 2 files changed +33
-2
lines changed Original file line number Diff line number Diff line change @@ -6,5 +6,4 @@ if [ -f "/usr/local/bin/berglas" ]; then
66 prefix=" berglas exec --"
77fi
88
9- $prefix python manage.py migrate --database timeseries rollouts
10- $prefix python manage.py migrate --database timeseries pg_telemetry
9+ $prefix python migrate_timeseries.py
Original file line number Diff line number Diff line change 1+ import os
2+
3+ import django
4+ from django .core .management import call_command
5+
6+ # Setup Django environment
7+ os .environ .setdefault ("DJANGO_SETTINGS_MODULE" , "django_scaffold.settings" )
8+ django .setup ()
9+
10+ from django .conf import settings # noqa: E402
11+
12+
13+ def run_migrate_commands ():
14+ try :
15+ if settings .TA_TIMESERIES_ENABLED :
16+ print ("Running ta_timeseries migrations" )
17+ call_command (
18+ "migrate" ,
19+ database = "ta_timeseries" ,
20+ app_label = "ta_timeseries" ,
21+ settings = "django_scaffold.settings" ,
22+ verbosity = 1 ,
23+ )
24+ else :
25+ print ("Skipping ta_timeseries migrations" )
26+
27+ except Exception as e :
28+ print (f"An error occurred: { e } " )
29+
30+
31+ if __name__ == "__main__" :
32+ run_migrate_commands ()
You can’t perform that action at this time.
0 commit comments