diff --git a/arches/management/commands/updateproject.py b/arches/management/commands/updateproject.py index c5d342e1d9d..1b0a3055039 100644 --- a/arches/management/commands/updateproject.py +++ b/arches/management/commands/updateproject.py @@ -302,6 +302,46 @@ def update_to_v7_6(self): os.path.join(settings.APP_ROOT, "apps.py"), ) + if os.path.isfile( + os.path.join(settings.APP_ROOT, "search_indexes", "sample_index.py") + ): + self.stderr.write( + "Existing sample_index.py detected. Skipping creation of sample_index.py", + ) + else: + self.stdout.write( + f"Creating /{settings.APP_NAME}/search_indexes/sample_index.py" + ) + src_path = os.path.join(settings.APP_ROOT, "search_indexes") + if not os.path.isdir(src_path): + os.mkdir(src_path) + + shutil.copy2( + os.path.join( + settings.ROOT_DIR, + "install", + "arches-templates", + "project_name", + "search_indexes", + "sample_index.py", + ), + src_path, + ) + self.stdout.write( + f"Creating /{settings.APP_NAME}/search_indexes/__init__.py" + ) + shutil.copy2( + os.path.join( + settings.ROOT_DIR, + "install", + "arches-templates", + "project_name", + "search_indexes", + "__init__.py", + ), + src_path, + ) + if os.path.isfile( os.path.join( settings.APP_ROOT, "src", settings.APP_NAME, "declarations.d.ts"