chore: sync code and project files

This commit is contained in:
Tony Zhang
2026-01-09 14:09:16 +08:00
parent 3d1fb37769
commit 30d7eb4b35
94 changed files with 12706 additions and 255 deletions

View File

@@ -0,0 +1,30 @@
"""
One-off migration:
- Ensure admin exists
- Backfill projects.owner_user_id to admin for legacy projects
Usage:
python3 scripts/migrate_users_and_owner.py
"""
import os
import sys
# Ensure repo root is on sys.path when executed from scripts/ directory
REPO_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
if REPO_ROOT not in sys.path:
sys.path.insert(0, REPO_ROOT)
from modules.db_manager import db
def main():
admin_id = db.ensure_admin_user("admin", "admin1234")
n = db.migrate_projects_owner_to(admin_id)
print(f"admin_id={admin_id} backfilled_projects={n}")
if __name__ == "__main__":
main()