@@ -46,9 +46,9 @@ def get_app_names(exclude: List[str]) -> List[str]:
46
46
Gets names of all apps using migrations
47
47
"""
48
48
names = []
49
- for app_dir in os .scandir ("temba" ):
49
+ for app_dir in os .scandir ("../ temba" ):
50
50
if app_dir .is_dir () and app_dir .name not in exclude :
51
- mig_dir = os .path .join ("temba" , app_dir .name , "migrations" )
51
+ mig_dir = os .path .join ("../ temba" , app_dir .name , "migrations" )
52
52
if os .path .exists (mig_dir ):
53
53
names .append (app_dir .name )
54
54
return sorted (names )
@@ -59,7 +59,7 @@ def get_app_migration_modules(app_name: str) -> List[str]:
59
59
Gets module names of all migration files for the given app
60
60
"""
61
61
mods = []
62
- mig_dir = os .path .join ("temba" , app_name , "migrations" )
62
+ mig_dir = os .path .join ("../ temba" , app_name , "migrations" )
63
63
for mig_file in os .scandir (mig_dir ):
64
64
if MIGRATION_FILENAME_REGEX .match (mig_file .name ):
65
65
mods .append (mig_file .name [:- 3 ])
@@ -185,9 +185,9 @@ def transform(data):
185
185
last_mig = get_app_migration_modules ("sql" )[- 1 ]
186
186
mig_path = f"temba/sql/migrations/{ last_mig } .py"
187
187
mig_num = last_mig [:4 ]
188
- shutil .copy2 ("temba/sql/current_functions.sql" , f"temba/sql/migrations/{ mig_num } _functions.sql" )
189
- shutil .copy2 ("temba/sql/current_indexes.sql" , f"temba/sql/migrations/{ mig_num } _indexes.sql" )
190
- shutil .copy2 ("temba/sql/current_triggers.sql" , f"temba/sql/migrations/{ mig_num } _triggers.sql" )
188
+ shutil .copy2 ("../ temba/sql/current_functions.sql" , f"temba/sql/migrations/{ mig_num } _functions.sql" )
189
+ shutil .copy2 ("../ temba/sql/current_indexes.sql" , f"temba/sql/migrations/{ mig_num } _indexes.sql" )
190
+ shutil .copy2 ("../ temba/sql/current_triggers.sql" , f"temba/sql/migrations/{ mig_num } _triggers.sql" )
191
191
ops = f'InstallSQL("{ mig_num } _functions"), InstallSQL("{ mig_num } _indexes"), InstallSQL("{ mig_num } _triggers")'
192
192
193
193
def transform (data ):
0 commit comments