#!/usr/bin/env python3 """ Migration script to create the bookmarks table. """ import os import sys from database import init_db from flask import Flask # Add the current directory to Python path sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) def create_app(): """Create minimal Flask app for migration""" app = Flask(__name__) app.config['SECRET_KEY'] = 'migration-secret' return app def main(): """Run the migration""" print("Creating bookmarks table...") app = create_app() with app.app_context(): # Initialize database db = init_db(app) # Import models to register them from models import User, Session, PollSource, PollLog, Bookmark # Create all tables (will only create missing ones) db.create_all() print("✓ Bookmarks table created successfully!") print("Migration completed.") if __name__ == '__main__': main()