blabla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

50 lines
1.5 KiB

#!/usr/bin/python3
from csv import unregister_dialect
#import email
from sqlite3 import Date
from click import password_option
#from ssl import _PasswordType
#from xmlrpc.client import DateTime
#from matplotlib.pyplot import title
from sqlalchemy import Column, Integer, Float, String, Text, TIMESTAMP,ForeignKey
from sqlalchemy.ext.declarative import declarative_base
#from sqlalchemy.orm import relationship
from sqlalchemy import func, create_engine,join
from config import CONFIG
Base = declarative_base()
class User(Base):
__tablename__ = 'user'
id = Column(Integer, primary_key=True, autoincrement=True)
username = Column(String(64))
password = Column(String(64))
# email = Column(String)
# config
# deck_size = Column(Integer)
class Card(Base):
__tablename__ = 'card'
id = Column(Integer, primary_key=True, autoincrement=True)
title = Column(String(1024))
interest_rate = Column(Float)
owner_id = Column(Integer, ForeignKey("user.id"), nullable=False)
# shared = Column(Bool)
# item_location = Column(String)
# item_type = Column(String)
# content_type = Column(String)
# item_size = Column(Integer)
#ali
# date_added = Column(String)
# last_review = Column(DateTime)
# interval = Column(Integer)
# due = Column(DateTime)
engine = create_engine(CONFIG['DB_CONNECTION'])
Base.metadata.create_all(engine)