Files
swingmusic-extended/app/setup/sqlite.py
T
cwilvx 4a9f804e70 combine userdata and swing db into one
+ port populate to new db interface
+ add genrehashes and hash info to tracks
+ properly structure new db table files
+ move helpers to dedicated utils file
+ move settings from db to config file
+ move artists, albums, auth and favorites endpoint to new db interface
+ use folder store to index filepaths
+ paginate favorite pages
+ 56 moretiny changes 😅
2024-06-30 15:06:33 +03:00

32 lines
708 B
Python

"""
Module to setup Sqlite databases and tables.
Applies migrations.
"""
from app.db.userdata import UserTable
from app.db.sqlite import create_connection, create_tables, queries
from app.db.sqlite.auth import SQLiteAuthMethods as authdb
from app.migrations import apply_migrations
from app.settings import Db
from app.db import create_all
from app.db.libdata import create_all as create_all_libdata
def run_migrations():
"""
Run migrations and updates migration version.
"""
apply_migrations()
def setup_sqlite():
"""
Create Sqlite databases and tables.
"""
create_all()
create_all_libdata()
if not UserTable.get_all():
UserTable.insert_default_user()