-- Tables temporaires pour l'import sf_guard
-- À exécuter avant l'import de la phase 2

-- Table pour importer sf_guard_user
CREATE TABLE IF NOT EXISTS sf_guard_user_import (
    id INT PRIMARY KEY,
    username VARCHAR(128) NOT NULL,
    password_hash VARCHAR(128) NOT NULL,
    algorithm VARCHAR(128) DEFAULT 'sha1',
    salt VARCHAR(128) NOT NULL,
    is_active TINYINT(1) DEFAULT 1,
    is_super_admin TINYINT(1) DEFAULT 0,
    last_login DATETIME NULL,
    created_at DATETIME NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- Table pour importer sf_guard_group
CREATE TABLE IF NOT EXISTS sf_guard_group_import (
    id INT PRIMARY KEY,
    group_name VARCHAR(255) NOT NULL,
    description TEXT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- Table pour importer sf_guard_permission
CREATE TABLE IF NOT EXISTS sf_guard_permission_import (
    id INT PRIMARY KEY,
    permission_name VARCHAR(255) NOT NULL,
    description TEXT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- Table pour importer sf_guard_user_group
CREATE TABLE IF NOT EXISTS sf_guard_user_group_import (
    user_id INT NOT NULL,
    group_id INT NOT NULL,
    PRIMARY KEY (user_id, group_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- Table pour importer sf_guard_user_permission
CREATE TABLE IF NOT EXISTS sf_guard_user_permission_import (
    user_id INT NOT NULL,
    permission_id INT NOT NULL,
    PRIMARY KEY (user_id, permission_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- Table pour importer sf_guard_group_permission
CREATE TABLE IF NOT EXISTS sf_guard_group_permission_import (
    group_id INT NOT NULL,
    permission_id INT NOT NULL,
    PRIMARY KEY (group_id, permission_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 