{ "id": "0e3307c4-094d-4ea4-a1dc-8bd9a4d96401", "prevId": "00000000-0000-0000-0000-000000000000", "version": "7", "dialect": "postgresql", "tables": { "public.ai_generations": { "name": "ai_generations", "schema": "", "columns": { "id": { "name": "id", "type": "varchar", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "user_id": { "name": "user_id", "type": "varchar", "primaryKey": false, "notNull": true }, "product_info": { "name": "product_info", "type": "jsonb", "primaryKey": false, "notNull": true }, "generated_texts": { "name": "generated_texts", "type": "jsonb", "primaryKey": false, "notNull": true }, "selected_text": { "name": "selected_text", "type": "text", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", "type": "timestamp", "primaryKey": false, "notNull": false, "default": "now()" } }, "indexes": {}, "foreignKeys": { "ai_generations_user_id_users_id_fk": { "name": "ai_generations_user_id_users_id_fk", "tableFrom": "ai_generations", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.cloudinary_config": { "name": "cloudinary_config", "schema": "", "columns": { "id": { "name": "id", "type": "varchar", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "user_id": { "name": "user_id", "type": "varchar", "primaryKey": false, "notNull": true }, "cloud_name": { "name": "cloud_name", "type": "text", "primaryKey": false, "notNull": true }, "api_key": { "name": "api_key", "type": "text", "primaryKey": false, "notNull": true }, "api_secret": { "name": "api_secret", "type": "text", "primaryKey": false, "notNull": true }, "logo_public_id": { "name": "logo_public_id", "type": "text", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", "type": "timestamp", "primaryKey": false, "notNull": false, "default": "now()" }, "updated_at": { "name": "updated_at", "type": "timestamp", "primaryKey": false, "notNull": false, "default": "now()" } }, "indexes": {}, "foreignKeys": { "cloudinary_config_user_id_users_id_fk": { "name": "cloudinary_config_user_id_users_id_fk", "tableFrom": "cloudinary_config", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "cloudinary_config_user_id_unique": { "name": "cloudinary_config_user_id_unique", "nullsNotDistinct": false, "columns": [ "user_id" ] } }, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.media": { "name": "media", "schema": "", "columns": { "id": { "name": "id", "type": "varchar", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "user_id": { "name": "user_id", "type": "varchar", "primaryKey": false, "notNull": true }, "type": { "name": "type", "type": "media_type", "typeSchema": "public", "primaryKey": false, "notNull": true }, "cloudinary_public_id": { "name": "cloudinary_public_id", "type": "text", "primaryKey": false, "notNull": false }, "original_url": { "name": "original_url", "type": "text", "primaryKey": false, "notNull": true }, "facebook_landscape_url": { "name": "facebook_landscape_url", "type": "text", "primaryKey": false, "notNull": false }, "facebook_feed_url": { "name": "facebook_feed_url", "type": "text", "primaryKey": false, "notNull": false }, "instagram_feed_url": { "name": "instagram_feed_url", "type": "text", "primaryKey": false, "notNull": false }, "instagram_story_url": { "name": "instagram_story_url", "type": "text", "primaryKey": false, "notNull": false }, "file_name": { "name": "file_name", "type": "text", "primaryKey": false, "notNull": true }, "file_size": { "name": "file_size", "type": "integer", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", "type": "timestamp", "primaryKey": false, "notNull": false, "default": "now()" } }, "indexes": {}, "foreignKeys": { "media_user_id_users_id_fk": { "name": "media_user_id_users_id_fk", "tableFrom": "media", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.openrouter_config": { "name": "openrouter_config", "schema": "", "columns": { "id": { "name": "id", "type": "varchar", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "user_id": { "name": "user_id", "type": "varchar", "primaryKey": false, "notNull": true }, "api_key": { "name": "api_key", "type": "text", "primaryKey": false, "notNull": true }, "model": { "name": "model", "type": "text", "primaryKey": false, "notNull": true, "default": "'anthropic/claude-3.5-sonnet'" }, "system_prompt": { "name": "system_prompt", "type": "text", "primaryKey": false, "notNull": true, "default": "'Tu es un expert en marketing des réseaux sociaux. Génère 3 variations de textes engageants pour des publications Facebook et Instagram à partir des informations produit fournies. Chaque variation doit être unique, captivante et optimisée pour l''engagement.'" }, "created_at": { "name": "created_at", "type": "timestamp", "primaryKey": false, "notNull": false, "default": "now()" }, "updated_at": { "name": "updated_at", "type": "timestamp", "primaryKey": false, "notNull": false, "default": "now()" } }, "indexes": {}, "foreignKeys": { "openrouter_config_user_id_users_id_fk": { "name": "openrouter_config_user_id_users_id_fk", "tableFrom": "openrouter_config", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "openrouter_config_user_id_unique": { "name": "openrouter_config_user_id_unique", "nullsNotDistinct": false, "columns": [ "user_id" ] } }, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.page_analytics_history": { "name": "page_analytics_history", "schema": "", "columns": { "id": { "name": "id", "type": "varchar", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "page_id": { "name": "page_id", "type": "varchar", "primaryKey": false, "notNull": true }, "date": { "name": "date", "type": "timestamp", "primaryKey": false, "notNull": true }, "followers_count": { "name": "followers_count", "type": "integer", "primaryKey": false, "notNull": false, "default": 0 }, "page_views": { "name": "page_views", "type": "integer", "primaryKey": false, "notNull": false, "default": 0 }, "page_reach": { "name": "page_reach", "type": "integer", "primaryKey": false, "notNull": false, "default": 0 }, "created_at": { "name": "created_at", "type": "timestamp", "primaryKey": false, "notNull": false, "default": "now()" } }, "indexes": {}, "foreignKeys": { "page_analytics_history_page_id_social_pages_id_fk": { "name": "page_analytics_history_page_id_social_pages_id_fk", "tableFrom": "page_analytics_history", "tableTo": "social_pages", "columnsFrom": [ "page_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.post_analytics": { "name": "post_analytics", "schema": "", "columns": { "id": { "name": "id", "type": "varchar", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "post_id": { "name": "post_id", "type": "varchar", "primaryKey": false, "notNull": true }, "fetched_at": { "name": "fetched_at", "type": "timestamp", "primaryKey": false, "notNull": false, "default": "now()" }, "impressions": { "name": "impressions", "type": "integer", "primaryKey": false, "notNull": false, "default": 0 }, "reach": { "name": "reach", "type": "integer", "primaryKey": false, "notNull": false, "default": 0 }, "engagement": { "name": "engagement", "type": "integer", "primaryKey": false, "notNull": false, "default": 0 }, "reactions": { "name": "reactions", "type": "integer", "primaryKey": false, "notNull": false, "default": 0 }, "comments": { "name": "comments", "type": "integer", "primaryKey": false, "notNull": false, "default": 0 }, "shares": { "name": "shares", "type": "integer", "primaryKey": false, "notNull": false, "default": 0 }, "clicks": { "name": "clicks", "type": "integer", "primaryKey": false, "notNull": false, "default": 0 }, "raw_data": { "name": "raw_data", "type": "jsonb", "primaryKey": false, "notNull": false } }, "indexes": {}, "foreignKeys": { "post_analytics_post_id_posts_id_fk": { "name": "post_analytics_post_id_posts_id_fk", "tableFrom": "post_analytics", "tableTo": "posts", "columnsFrom": [ "post_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.post_media": { "name": "post_media", "schema": "", "columns": { "id": { "name": "id", "type": "varchar", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "post_id": { "name": "post_id", "type": "varchar", "primaryKey": false, "notNull": true }, "media_id": { "name": "media_id", "type": "varchar", "primaryKey": false, "notNull": true }, "display_order": { "name": "display_order", "type": "integer", "primaryKey": false, "notNull": true, "default": 0 } }, "indexes": {}, "foreignKeys": { "post_media_post_id_posts_id_fk": { "name": "post_media_post_id_posts_id_fk", "tableFrom": "post_media", "tableTo": "posts", "columnsFrom": [ "post_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" }, "post_media_media_id_media_id_fk": { "name": "post_media_media_id_media_id_fk", "tableFrom": "post_media", "tableTo": "media", "columnsFrom": [ "media_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.posts": { "name": "posts", "schema": "", "columns": { "id": { "name": "id", "type": "varchar", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "user_id": { "name": "user_id", "type": "varchar", "primaryKey": false, "notNull": true }, "content": { "name": "content", "type": "text", "primaryKey": false, "notNull": true }, "ai_generated": { "name": "ai_generated", "type": "text", "primaryKey": false, "notNull": true, "default": "'false'" }, "product_info": { "name": "product_info", "type": "jsonb", "primaryKey": false, "notNull": false }, "status": { "name": "status", "type": "post_status", "typeSchema": "public", "primaryKey": false, "notNull": true, "default": "'draft'" }, "scheduled_for": { "name": "scheduled_for", "type": "timestamp", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", "type": "timestamp", "primaryKey": false, "notNull": false, "default": "now()" }, "updated_at": { "name": "updated_at", "type": "timestamp", "primaryKey": false, "notNull": false, "default": "now()" } }, "indexes": {}, "foreignKeys": { "posts_user_id_users_id_fk": { "name": "posts_user_id_users_id_fk", "tableFrom": "posts", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.scheduled_posts": { "name": "scheduled_posts", "schema": "", "columns": { "id": { "name": "id", "type": "varchar", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "post_id": { "name": "post_id", "type": "varchar", "primaryKey": false, "notNull": true }, "page_id": { "name": "page_id", "type": "varchar", "primaryKey": false, "notNull": true }, "post_type": { "name": "post_type", "type": "post_type", "typeSchema": "public", "primaryKey": false, "notNull": true }, "scheduled_at": { "name": "scheduled_at", "type": "timestamp", "primaryKey": false, "notNull": true }, "published_at": { "name": "published_at", "type": "timestamp", "primaryKey": false, "notNull": false }, "external_post_id": { "name": "external_post_id", "type": "text", "primaryKey": false, "notNull": false }, "error": { "name": "error", "type": "text", "primaryKey": false, "notNull": false } }, "indexes": {}, "foreignKeys": { "scheduled_posts_post_id_posts_id_fk": { "name": "scheduled_posts_post_id_posts_id_fk", "tableFrom": "scheduled_posts", "tableTo": "posts", "columnsFrom": [ "post_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" }, "scheduled_posts_page_id_social_pages_id_fk": { "name": "scheduled_posts_page_id_social_pages_id_fk", "tableFrom": "scheduled_posts", "tableTo": "social_pages", "columnsFrom": [ "page_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.social_pages": { "name": "social_pages", "schema": "", "columns": { "id": { "name": "id", "type": "varchar", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "user_id": { "name": "user_id", "type": "varchar", "primaryKey": false, "notNull": true }, "platform": { "name": "platform", "type": "platform", "typeSchema": "public", "primaryKey": false, "notNull": true }, "page_id": { "name": "page_id", "type": "text", "primaryKey": false, "notNull": true }, "page_name": { "name": "page_name", "type": "text", "primaryKey": false, "notNull": true }, "access_token": { "name": "access_token", "type": "text", "primaryKey": false, "notNull": true }, "token_expires_at": { "name": "token_expires_at", "type": "timestamp", "primaryKey": false, "notNull": false }, "followers_count": { "name": "followers_count", "type": "integer", "primaryKey": false, "notNull": false, "default": 0 }, "is_active": { "name": "is_active", "type": "text", "primaryKey": false, "notNull": true, "default": "'true'" }, "token_status": { "name": "token_status", "type": "token_status", "typeSchema": "public", "primaryKey": false, "notNull": false, "default": "'valid'" }, "last_token_check": { "name": "last_token_check", "type": "timestamp", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", "type": "timestamp", "primaryKey": false, "notNull": false, "default": "now()" } }, "indexes": {}, "foreignKeys": { "social_pages_user_id_users_id_fk": { "name": "social_pages_user_id_users_id_fk", "tableFrom": "social_pages", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.user_page_permissions": { "name": "user_page_permissions", "schema": "", "columns": { "id": { "name": "id", "type": "varchar", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "user_id": { "name": "user_id", "type": "varchar", "primaryKey": false, "notNull": true }, "page_id": { "name": "page_id", "type": "varchar", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", "type": "timestamp", "primaryKey": false, "notNull": false, "default": "now()" } }, "indexes": {}, "foreignKeys": { "user_page_permissions_user_id_users_id_fk": { "name": "user_page_permissions_user_id_users_id_fk", "tableFrom": "user_page_permissions", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" }, "user_page_permissions_page_id_social_pages_id_fk": { "name": "user_page_permissions_page_id_social_pages_id_fk", "tableFrom": "user_page_permissions", "tableTo": "social_pages", "columnsFrom": [ "page_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.users": { "name": "users", "schema": "", "columns": { "id": { "name": "id", "type": "varchar", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "username": { "name": "username", "type": "text", "primaryKey": false, "notNull": true }, "password": { "name": "password", "type": "text", "primaryKey": false, "notNull": true }, "role": { "name": "role", "type": "user_role", "typeSchema": "public", "primaryKey": false, "notNull": true, "default": "'user'" } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": { "users_username_unique": { "name": "users_username_unique", "nullsNotDistinct": false, "columns": [ "username" ] } }, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false } }, "enums": { "public.media_type": { "name": "media_type", "schema": "public", "values": [ "image", "video" ] }, "public.platform": { "name": "platform", "schema": "public", "values": [ "facebook", "instagram" ] }, "public.post_status": { "name": "post_status", "schema": "public", "values": [ "draft", "scheduled", "published", "failed" ] }, "public.post_type": { "name": "post_type", "schema": "public", "values": [ "feed", "story", "both" ] }, "public.token_status": { "name": "token_status", "schema": "public", "values": [ "valid", "expiring", "expired", "error" ] }, "public.user_role": { "name": "user_role", "schema": "public", "values": [ "admin", "user" ] } }, "schemas": {}, "sequences": {}, "roles": {}, "policies": {}, "views": {}, "_meta": { "columns": {}, "schemas": {}, "tables": {} } }