Implement SQLAlchemy integration and create database schemas for local and remote modes; refactor KomCache class methods

This commit is contained in:
2025-05-29 09:47:07 +02:00
parent 8218c454b4
commit 2c9505b23a
4 changed files with 173 additions and 99 deletions

View File

@@ -0,0 +1,20 @@
CREATE_SQLITE_TABLES = ["""
CREATE TABLE IF NOT EXISTS manga_requests (
id INTEGER PRIMARY KEY AUTOINCREMENT,
manga_id INTEGER,
grabbed BOOLEAN DEFAULT 0);""","""CREATE TABLE IF NOT EXISTS komgrabber (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
series_id TEXT NOT NULL,
status TEXT NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
last_checked TIMESTAMP DEFAULT 0,
completed BOOLEAN DEFAULT 0);""","""CREATE TABLE IF NOT EXISTS komtagger (
id INTEGER PRIMARY KEY AUTOINCREMENT,
series_id TEXT NOT NULL,
title TEXT NOT NULL,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
last_checked TIMESTAMP DEFAULT 0,
status TEXT NOT NULL);
"""]