This commit is contained in:
2024-05-17 12:34:45 +02:00
parent c1c9f98e87
commit 536fd65203
9 changed files with 200 additions and 127 deletions

28
app/sql_models.py Normal file
View File

@@ -0,0 +1,28 @@
from sqlalchemy import Column, String, Integer, Boolean, PickleType, Enum
from sqlalchemy.orm import declarative_base
from typing import Optional
Base = declarative_base()
class SqlSong(Base):
__tablename__ = 'songs'
id = Column(Integer, primary_key=True)
og_artist = Column(String)
aca_artist = Column(String)
title = Column(String)
yt_url = Column(String)
is_aca = Column(Boolean)
arng_url = Column(String)
categories = Column(PickleType)
main_category = Column(String)
singable = Column(Boolean)
class SqlVote(Base):
__tablename__ = 'votes'
id = Column(Integer, primary_key=True)
song_id = Column(Integer)
user_id = Column(String)
vote = Column(Integer, nullable=True)