-- ========================================================================
-- FRESH DATABASE DEPLOYMENT SCRIPT
-- ========================================================================
-- This script drops and recreates the database to avoid any constraint
-- conflicts from previous installations.
--
-- WARNING: This will DELETE all existing data!
-- Only use for development or fresh installations.
-- ========================================================================

-- Drop the database if it exists (will remove all data and constraints)
DROP DATABASE IF EXISTS `cms_db`;

-- Create fresh database
CREATE DATABASE `cms_db` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci */;

-- Now import the schema
-- Run this after: mysql -u root -p cms_db < database_schema.sql

-- Or run both in one command:
-- mysql -u root -p < deploy_fresh_schema.sql && mysql -u root -p cms_db < database_schema.sql

