Files
folkugat-web/folkugat_web/dal/sql/playlists/ddl.py
2025-03-23 21:46:04 +01:00

20 lines
479 B
Python

from folkugat_web.dal.sql import Connection, get_connection
def create_db(con: Connection | None = None):
with get_connection(con) as con:
create_playlists_table(con)
def create_playlists_table(con: Connection):
query = """
CREATE TABLE IF NOT EXISTS playlists (
id INTEGER PRIMARY KEY,
session_id INTEGER NOT NULL,
set_id INTEGER NOT NULL,
tema_id INTEGER
)
"""
cur = con.cursor()
_ = cur.execute(query)