-- Migration 031: Create species table for product species management
CREATE TABLE IF NOT EXISTS species (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(100) NOT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    UNIQUE KEY uk_species_name (name)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Seed default species
INSERT IGNORE INTO species (name) VALUES
    ('Pollo de carne'),
    ('Postura'),
    ('Reproductoras'),
    ('Pavos'),
    ('Cerdos'),
    ('Patos'),
    ('Cuyes'),
    ('Ganado vacuno'),
    ('Otros');
