-- Create table for orbital faction control
CREATE TABLE IF NOT EXISTS planet_faction_control (
    planet_id INT(11) NOT NULL,
    faction_id INT(11) NOT NULL,
    control_level INT(11) NOT NULL DEFAULT 0,
    PRIMARY KEY (planet_id, faction_id),
    CONSTRAINT fk_planet_faction_control_planet FOREIGN KEY (planet_id) REFERENCES planets(id) ON DELETE CASCADE,
    CONSTRAINT fk_planet_faction_control_faction FOREIGN KEY (faction_id) REFERENCES factions(id) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
