-- VILLAFLOW CMS — Migration 003
-- Phase 2 — Property (Hero Slides sub-scope)
-- Owns: homepage hero slideshow entries.
-- Does NOT own: property_id (single-property system — no FK needed),
-- animation/transition/duration settings (frontend concern, Phase 12).

CREATE TABLE IF NOT EXISTS hero_slides (
    id             INT UNSIGNED    AUTO_INCREMENT PRIMARY KEY,
    image_path     VARCHAR(255)    NOT NULL,
    title          VARCHAR(150)    NOT NULL,
    subtitle       VARCHAR(255)    NULL,
    cta_label      VARCHAR(100)    NULL,
    cta_url        VARCHAR(500)    NULL,
    sort_order     INT             NOT NULL DEFAULT 0,
    status         ENUM('active','inactive') NOT NULL DEFAULT 'active',
    created_at     TIMESTAMP       NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_at     TIMESTAMP       NOT NULL DEFAULT CURRENT_TIMESTAMP
                                    ON UPDATE CURRENT_TIMESTAMP,

    KEY idx_hero_slides_sort_order (sort_order)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
