Remove all migrations for now

This commit is contained in:
Jacob Windsor
2025-02-19 16:13:10 +01:00
parent 03aba52c6c
commit b64a09c33a
9 changed files with 2 additions and 281 deletions
+1 -2
View File
@@ -1,7 +1,7 @@
from fastapi import FastAPI, Depends
from fastapi.middleware.cors import CORSMiddleware
from .providers.db_provider import create_db_and_tables, startup_migrations
from .providers.db_provider import create_db_and_tables
from .routers.houses import router as houses_router
from .routers.owners import router as owners_router
from .middleware.authenticate import authenticate
@@ -10,7 +10,6 @@ from contextlib import asynccontextmanager
@asynccontextmanager
async def lifespan(_app: FastAPI):
startup_migrations()
create_db_and_tables()
yield
-9
View File
@@ -83,12 +83,3 @@ def create_db_and_tables():
SQLModel.metadata.create_all(engine)
_seed_db()
def startup_migrations():
print("Running Alembic migrations...")
backend_path = os.path.dirname(os.path.abspath(__file__)) + "/../.."
try:
subprocess.run(["alembic", "upgrade", "head"], check=True, cwd=backend_path)
print("Migrations applied successfully!")
except subprocess.CalledProcessError as e:
print(f"Error applying migrations: {e}")