File size: 526 Bytes
08af9fd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from sqlmodel import SQLModel
from .database import engine
from ..models import User, Task


def create_db_and_tables():
    """
    Create database tables for User and Task models.
    """
    print("RE-INITIALIZING TABLES: Starting metadata sync...")
    try:
        SQLModel.metadata.create_all(engine)
        print("RE-INITIALIZING TABLES: Success. Neural link is active.")
    except Exception as e:
        print(f"RE-INITIALIZING TABLES: CRITICAL FAILURE: {e}")


if __name__ == "__main__":
    create_db_and_tables()