22 lines
598 B
Python
22 lines
598 B
Python
|
from sqlalchemy import create_engine, Column, Integer, String
|
||
|
from sqlalchemy.ext.declarative import declarative_base
|
||
|
from sqlalchemy.orm import sessionmaker
|
||
|
|
||
|
|
||
|
DATABASE_URL = "mysql+pymysql://wind:wind@193.124.203.110:3306/wind_towers"
|
||
|
|
||
|
|
||
|
|
||
|
engine = create_engine(DATABASE_URL)
|
||
|
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
|
||
|
|
||
|
|
||
|
Base = declarative_base()
|
||
|
|
||
|
|
||
|
class User(Base):
|
||
|
__tablename__ = "user" # Убедитесь, что эта таблица существует
|
||
|
|
||
|
id = Column(Integer, primary_key=True, index=True)
|
||
|
name = Column(String(50), index=True)
|