Remove all migrations for now
This commit is contained in:
+1
-2
@@ -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
|
||||
|
||||
|
||||
@@ -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}")
|
||||
|
||||
Reference in New Issue
Block a user