
CREATE TABLE users (
    id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    username VARCHAR(50) NOT NULL UNIQUE,
    document_type VARCHAR(10) NULL,
    document_number VARCHAR(50) NULL UNIQUE,
    first_name VARCHAR(100) NOT NULL,
    last_name VARCHAR(100) NOT NULL,
    email VARCHAR(150) NULL UNIQUE,
    password_hash VARCHAR(255) NOT NULL,
    is_active TINYINT(1) NOT NULL DEFAULT 1,
    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO users (username, document_type, document_number, first_name, last_name, email, password_hash, is_active)
VALUES (
    'admin',
    'CC',
    'admin',
    'Administrador',
    'GM',
    'admin@gimnasiomoderno.edu.co',
    '$2y$12$luFExJTjjSBvwYDduxBJteQHseCGCIQ7hfiPohOEhQkEz2uUTiPmO',
    1
);
