mirror of
https://github.com/xlorepdarkhelm/numinar-coding-project.git
synced 2026-09-09 05:33:11 -04:00
Removing the fake migration.
Signed-off-by: Cliff Hill <xlorep@darkhelm.org>
This commit is contained in:
@@ -1,34 +0,0 @@
|
||||
"""Initial Migration
|
||||
|
||||
Revision ID: 8e7c02c0ca4c
|
||||
Revises:
|
||||
Create Date: 2025-08-22 22:08:41.229866
|
||||
|
||||
"""
|
||||
|
||||
from typing import Sequence
|
||||
from typing import Union
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = "8e7c02c0ca4c"
|
||||
down_revision: Union[str, Sequence[str], None] = None
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
"""Upgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
pass
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
"""Downgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
pass
|
||||
# ### end Alembic commands ###
|
||||
@@ -5,7 +5,6 @@ from typing import Any
|
||||
from fastapi import FastAPI
|
||||
|
||||
from backend import config
|
||||
from backend.models import create_db_and_tables
|
||||
|
||||
|
||||
ENVIRONMENT = config("ENVIRONMENT", default="development")
|
||||
@@ -17,14 +16,6 @@ if ENVIRONMENT not in SHOW_DOCS_ENVIRONMENTS:
|
||||
app_configs["openapi_url"] = None # Disable OpenAPI schema
|
||||
|
||||
|
||||
async def lifespan(app: FastAPI):
|
||||
"""Lifespan event to create database tables on startup."""
|
||||
await create_db_and_tables()
|
||||
yield # This is where the lifespan ends
|
||||
|
||||
|
||||
app_configs["lifespan"] = lifespan
|
||||
|
||||
app = FastAPI(**app_configs)
|
||||
|
||||
|
||||
|
||||
@@ -9,8 +9,6 @@ from sqlalchemy.orm import MappedAsDataclass
|
||||
from sqlalchemy.orm import mapped_column
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
from backend.db import engine
|
||||
|
||||
|
||||
# Base class for declarative models
|
||||
class Base(MappedAsDataclass, DeclarativeBase):
|
||||
@@ -80,9 +78,3 @@ class Invitee(Base):
|
||||
|
||||
booking: Mapped["Booking"] = relationship(back_populates="invitees", init=False)
|
||||
user: Mapped["User"] = relationship(back_populates="invitees", init=False)
|
||||
|
||||
|
||||
async def create_db_and_tables() -> None: # pragma: no cover
|
||||
"""Create the database and tables."""
|
||||
async with engine.begin() as conn:
|
||||
await conn.run_sync(Base.metadata.create_all)
|
||||
|
||||
Reference in New Issue
Block a user