Peter Mutwiri commited on
Commit
d8e13ad
Β·
1 Parent(s): 96bc619

removed problematic schema

Browse files
Files changed (2) hide show
  1. app/db.py +1 -7
  2. app/main.py +0 -14
app/db.py CHANGED
@@ -85,13 +85,7 @@ def transactional_conn(org_id: str):
85
  finally:
86
  conn.close()
87
 
88
- def delete_problematic_schema_versions_table(conn: duckdb.DuckDBPyConnection):
89
- """
90
- πŸ”₯ DEV ONLY: Brutally drops schema_versions table to fix corrupted INTEGER PK schema.
91
- Run ONCE via API endpoint, then REMOVE this function from codebase.
92
- """
93
- conn.execute("DROP TABLE IF EXISTS main.schema_versions")
94
- print("[delete] πŸ”₯ Dropped main.schema_versions (dev wipe)")
95
  # ==================== SCHEMA EVOLUTION ==================== #
96
  def ensure_raw_table(conn: duckdb.DuckDBPyConnection):
97
  """
 
85
  finally:
86
  conn.close()
87
 
88
+
 
 
 
 
 
 
89
  # ==================== SCHEMA EVOLUTION ==================== #
90
  def ensure_raw_table(conn: duckdb.DuckDBPyConnection):
91
  """
app/main.py CHANGED
@@ -131,20 +131,6 @@ app = FastAPI(
131
  }
132
  )
133
 
134
- @app.post("/api/v1/admin/wipe-schema")
135
- def wipe_schema_versions_table(org_id: str = Query(..., description="Organization ID")):
136
- """
137
- πŸ”₯ DEV ONLY: Emergency wipe of schema_versions table.
138
- USE ONCE PER ORG, THEN REMOVE THIS ENDPOINT IMMEDIATELY.
139
- """
140
- try:
141
- from app.db import get_conn, delete_problematic_schema_versions_table
142
- conn = get_conn(org_id)
143
- delete_problematic_schema_versions_table(conn)
144
- conn.close()
145
- return {"status": "wiped", "message": "schema_versions deleted. Remove this endpoint now."}
146
- except Exception as e:
147
- raise HTTPException(status_code=500, detail=str(e))
148
  # ─── Request ID Middleware ─────────────────────────────────────────────────────
149
  @app.middleware("http")
150
  async def add_request_tracking(request: Request, call_next):
 
131
  }
132
  )
133
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
  # ─── Request ID Middleware ─────────────────────────────────────────────────────
135
  @app.middleware("http")
136
  async def add_request_tracking(request: Request, call_next):