Spaces:
Sleeping
Sleeping
File size: 646 Bytes
4e3c158 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | import logging
import os
import sys
from sqlalchemy import text
# Add the current directory to sys.path
sys.path.append(os.getcwd())
import sales.models
from core.database import Base, engine
import core.models
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
def init_sales_tables():
logger.info("Initializing sales tables...")
try:
Base.metadata.create_all(bind=engine)
logger.info("✅ Sales tables created successfully.")
except Exception as e:
logger.error(f"❌ Failed to create sales tables: {e}")
sys.exit(1)
if __name__ == "__main__":
init_sales_tables()
|