feat: add recordings table and implement fetch and sync functionality for recordings
Build & Push Docker Image / build (push) Successful in 4m18s

This commit is contained in:
2026-04-08 00:10:25 +02:00
parent e0ce354eda
commit df1aa20e45
2 changed files with 246 additions and 63 deletions
+45
View File
@@ -815,6 +815,51 @@ export async function initDatabase() {
await db.exec("ALTER TABLE rooms ADD COLUMN analytics_visibility TEXT DEFAULT 'owner'");
}
// ── Recordings cache table ────────────────────────────────────────────
if (isPostgres) {
await db.exec(`
CREATE TABLE IF NOT EXISTS recordings (
id SERIAL PRIMARY KEY,
record_id TEXT UNIQUE NOT NULL,
meeting_id TEXT NOT NULL,
name TEXT,
state TEXT,
published INTEGER DEFAULT 1,
start_time TEXT,
end_time TEXT,
participants TEXT,
size TEXT,
formats TEXT NOT NULL DEFAULT '[]',
metadata TEXT DEFAULT '{}',
created_at TIMESTAMP DEFAULT NOW(),
updated_at TIMESTAMP DEFAULT NOW()
);
CREATE INDEX IF NOT EXISTS idx_recordings_record_id ON recordings(record_id);
CREATE INDEX IF NOT EXISTS idx_recordings_meeting_id ON recordings(meeting_id);
`);
} else {
await db.exec(`
CREATE TABLE IF NOT EXISTS recordings (
id INTEGER PRIMARY KEY AUTOINCREMENT,
record_id TEXT UNIQUE NOT NULL,
meeting_id TEXT NOT NULL,
name TEXT,
state TEXT,
published INTEGER DEFAULT 1,
start_time TEXT,
end_time TEXT,
participants TEXT,
size TEXT,
formats TEXT NOT NULL DEFAULT '[]',
metadata TEXT DEFAULT '{}',
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX IF NOT EXISTS idx_recordings_record_id ON recordings(record_id);
CREATE INDEX IF NOT EXISTS idx_recordings_meeting_id ON recordings(meeting_id);
`);
}
// ── Default admin (only on very first start) ────────────────────────────
const adminAlreadySeeded = await db.get("SELECT value FROM settings WHERE key = 'admin_seeded'");
if (!adminAlreadySeeded) {