SQLAlchemy ForeignKey Constraints
# SQLAlchemy-1.3.20 # pip install pymysql from sqlalchemy import (create_engine, Float, Text, MetaData, Table, Column, Integer, String, DateTime, ForeignKey) from datetime import datetime meta_data = MetaData() db_connection = 'mysql+pymysql://root:india@123@localhost/sql_alchemy' # db_connection = 'mysql+pymysql://username:pasword@localhost/db_name' #table = Model users = Table('users', meta_data, Column('user_id', Integer(), primary_key = True), Column('username', String(15), nullable = False, unique = True), Column('email', String(150), nullable = False), Column('password', String(12), nullable = False), Column('created_on', DateTime(),default=datetime.now,nullable = False), Column('update_on', DateTime(), default=datetime.now, onupdate=datetime.now,nullable = False) ) dish_items = Table('dish_items', meta_data, Column('di