feat: introduce audio administration, reel generation, and enhanced analytics with new database schema and API routes.

This commit is contained in:
Michael committed 2026-03-02 13:11:37 +01:00
1 parent b31a45549a
commit 04373d2881
3 files changed
+72 -39

No files matched your search

+13
View File
@@ -117,6 +117,19 @@ export async function migrate() {
ADD COLUMN IF NOT EXISTS "page_engagement" integer DEFAULT 0;
`);
// audio_tracks (bibliothèque audio interne)
await client.query(`
CREATE TABLE IF NOT EXISTS "audio_tracks" (
"id" varchar PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"user_id" varchar REFERENCES "users"("id") ON DELETE cascade,
"title" text NOT NULL,
"file_name" text NOT NULL,
"url" text NOT NULL,
"duration" integer DEFAULT 0,
"created_at" timestamp DEFAULT now()
);
`);
console.log("[Migration] Safe migration completed.");
} catch (error) {
console.error("[Migration] Error during migration:", error);