mirror of
https://github.com/Fluffy-Bean/Lynxie.git
synced 2025-05-25 12:54:57 +00:00
Add animals command
Fix Youtube playback Add Database file
This commit is contained in:
parent
d7953e9808
commit
0c1909807a
12 changed files with 623 additions and 126 deletions
32
lynxie/database.py
Normal file
32
lynxie/database.py
Normal file
|
@ -0,0 +1,32 @@
|
|||
from sqlalchemy import create_engine, Column, Integer, String, DateTime
|
||||
from sqlalchemy.orm import declarative_base, sessionmaker
|
||||
from lynxie.config import LYNXIE_DB
|
||||
|
||||
|
||||
Base = declarative_base()
|
||||
|
||||
|
||||
class CommandHistory(Base):
|
||||
__tablename__ = "command_history"
|
||||
|
||||
id = Column(Integer, primary_key=True)
|
||||
command = Column(String)
|
||||
user = Column(Integer)
|
||||
channel = Column(Integer)
|
||||
guild = Column(Integer)
|
||||
timestamp = Column(DateTime)
|
||||
|
||||
|
||||
class Database:
|
||||
def __init__(self):
|
||||
self.engine = create_engine(LYNXIE_DB)
|
||||
self.session = sessionmaker(bind=self.engine)
|
||||
self.session = self.session()
|
||||
|
||||
def make_database(self):
|
||||
Base.metadata.create_all(self.engine)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
db = Database()
|
||||
db.make_database()
|
Loading…
Add table
Add a link
Reference in a new issue