Pipelinen parannuksia building blockeilla
This commit is contained in:
18
zipit/rest_api_check/models.py
Normal file
18
zipit/rest_api_check/models.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from sqlalchemy import create_engine, Column, Integer, String
|
||||
from sqlalchemy.ext.declarative import declarative_base
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
|
||||
DATABASE_URL = "sqlite:///./app.db"
|
||||
engine = create_engine(DATABASE_URL, connect_args={"check_same_thread": False})
|
||||
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
|
||||
Base = declarative_base()
|
||||
|
||||
class User(Base):
|
||||
__tablename__ = "users"
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
UserID = Column(Integer, nullable=False)
|
||||
Username = Column(String(255), nullable=False)
|
||||
Email = Column(String(255), nullable=False)
|
||||
PasswordHash = Column(String(255), nullable=False)
|
||||
|
||||
Base.metadata.create_all(bind=engine)
|
||||
Reference in New Issue
Block a user