mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-27 13:34:28 +00:00
Started work on the Royal Games database
This commit is contained in:
parent
40403f9d1a
commit
a74a371579
1 changed files with 18 additions and 0 deletions
18
database.py
Normal file
18
database.py
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
from sqlalchemy import create_engine, Column, Integer, String, Boolean
|
||||||
|
from sqlalchemy.orm import sessionmaker
|
||||||
|
from sqlalchemy.ext.declarative import declarative_base
|
||||||
|
|
||||||
|
# Initialize the database
|
||||||
|
engine = create_engine("sqlite:///tempdb.sqlite")
|
||||||
|
Base = declarative_base()
|
||||||
|
Session = sessionmaker(bind=engine)
|
||||||
|
|
||||||
|
class Member(Base):
|
||||||
|
__tablename__ = "members"
|
||||||
|
|
||||||
|
id = Column(Integer, primary_key=True)
|
||||||
|
username = Column(String, unique=True, nullable=False)
|
||||||
|
password = Column(String, nullable=False)
|
||||||
|
royal = Column(Boolean, nullable=False)
|
||||||
|
|
||||||
|
Base.metadata.create_all(engine)
|
Loading…
Reference in a new issue