mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-03 20:13:02 +00:00
document + rename stuff
This commit is contained in:
+6
-8
@@ -5,14 +5,12 @@ Applies migrations.
|
||||
|
||||
from sqlalchemy import create_engine
|
||||
from app.db.userdata import UserTable
|
||||
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
|
||||
from app.settings import DbPaths
|
||||
|
||||
from app.db.engine import DbEngine
|
||||
from app.db import create_all_tables
|
||||
from app.db.libdata import create_all as create_user_tables
|
||||
|
||||
|
||||
def run_migrations():
|
||||
@@ -27,14 +25,14 @@ def setup_sqlite():
|
||||
Create Sqlite databases and tables.
|
||||
"""
|
||||
DbEngine.engine = create_engine(
|
||||
f"sqlite+pysqlite:///{Db.get_app_db_path()}",
|
||||
f"sqlite+pysqlite:///{DbPaths.get_app_db_path()}",
|
||||
echo=False,
|
||||
max_overflow=20,
|
||||
pool_size=10,
|
||||
)
|
||||
|
||||
create_all()
|
||||
create_all_libdata()
|
||||
create_all_tables()
|
||||
create_user_tables()
|
||||
|
||||
if not UserTable.get_all():
|
||||
UserTable.insert_default_user()
|
||||
|
||||
Reference in New Issue
Block a user