mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-12 01:36:54 +02:00
Introduce a new 'both' post type allowing simultaneous publishing to Facebook and Instagram feeds and stories. This includes UI updates for selecting post types, backend logic for splitting 'both' posts into separate feed and story entries, and the ability to delete scheduled posts. The changes also include a new 'Pages gérées' link in the sidebar and necessary database schema updates. Replit-Commit-Author: Agent Replit-Commit-Session-Id: ae4037a0-2a6f-4530-9bac-79b543286bda Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/397bca8c-984f-43ff-841a-10897aeb8140/ae4037a0-2a6f-4530-9bac-79b543286bda/WuFXYmm
44 lines
1.7 KiB
SQL
44 lines
1.7 KiB
SQL
-- Script d'initialisation de la base de données Social Flow
|
|
-- Ce fichier contient les commandes SQL pour créer les tables et l'utilisateur admin par défaut
|
|
|
|
-- IMPORTANT: Pour les serveurs privés existants, ajouter la valeur 'both' à l'enum post_type
|
|
-- Commande à exécuter manuellement sur votre serveur privé :
|
|
-- ALTER TYPE post_type ADD VALUE IF NOT EXISTS 'both';
|
|
|
|
-- Créer l'enum pour les rôles utilisateur (si pas déjà créé par drizzle-kit push)
|
|
DO $$ BEGIN
|
|
CREATE TYPE user_role AS ENUM ('admin', 'user');
|
|
EXCEPTION
|
|
WHEN duplicate_object THEN null;
|
|
END $$;
|
|
|
|
-- Créer l'utilisateur admin par défaut (username: admin, password: admin)
|
|
-- Note: Le hash bcrypt pour "admin" est généré avec un salt de 10
|
|
INSERT INTO users (id, username, password, role)
|
|
VALUES (
|
|
'admin-user-id',
|
|
'admin',
|
|
'$2b$10$mw7B1qBoTxxT7BT.Mv9uTeExX27y5nPVN4/e6L7W1VqkTNe/tGw9G',
|
|
'admin'
|
|
) ON CONFLICT (username) DO NOTHING;
|
|
|
|
-- Créer un utilisateur demo pour les tests
|
|
INSERT INTO users (id, username, password, role)
|
|
VALUES (
|
|
'demo-user',
|
|
'demo',
|
|
'$2b$10$mw7B1qBoTxxT7BT.Mv9uTeExX27y5nPVN4/e6L7W1VqkTNe/tGw9G',
|
|
'user'
|
|
) ON CONFLICT (username) DO NOTHING;
|
|
|
|
-- Liste des tables créées automatiquement par Drizzle ORM :
|
|
-- - users (utilisateurs avec rôles)
|
|
-- - social_pages (pages Facebook/Instagram connectées)
|
|
-- - cloudinary_config (configuration Cloudinary par utilisateur)
|
|
-- - openrouter_config (configuration OpenRouter par utilisateur)
|
|
-- - media (fichiers médias stockés dans Cloudinary)
|
|
-- - posts (publications créées)
|
|
-- - scheduled_posts (publications programmées)
|
|
-- - ai_generations (historique des générations IA)
|
|
-- - post_media (relation many-to-many entre posts et media)
|