chore: remove legacy tables and series table scripts
Build and Push Reader API Image / docker (push) Successful in 38s

- Removed mongoose dependency from package-lock.json.
- Deleted legacy import tables: ImportCandidateChapter, AssetNovelMapping, ImportJob, ImportSession, SourceAsset via new script `drop_legacy_import_tables.py`.
- Added script `drop_series_table.py` to drop the Series table.

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-05-04 19:43:22 +07:00
parent 1b1217ace2
commit 212d4df42f
6 changed files with 402 additions and 570 deletions
+28
View File
@@ -0,0 +1,28 @@
import os
from urllib.parse import parse_qsl, urlencode, urlsplit, urlunsplit
from dotenv import load_dotenv
from sqlalchemy import create_engine, text
def _normalize_database_url(raw_url: str) -> str:
parts = urlsplit(raw_url)
filtered_query = [(k, v) for (k, v) in parse_qsl(parts.query, keep_blank_values=True) if k.lower() != "schema"]
return urlunsplit((parts.scheme, parts.netloc, parts.path, urlencode(filtered_query), parts.fragment))
def main() -> None:
load_dotenv()
database_url = os.getenv("DATABASE_URL")
if not database_url:
raise RuntimeError("DATABASE_URL missing")
engine = create_engine(_normalize_database_url(database_url))
with engine.begin() as conn:
conn.execute(text('DROP TABLE IF EXISTS "Series" CASCADE'))
print("Dropped Series table")
if __name__ == "__main__":
main()