-- kreyol_prod database dump — 2026-03-01 03:00:00 UTC
-- pg_dump version 15.4
-- Integrity check: https://kreyollabs.com/t/db-dump-001

SET statement_timeout = 0;
SET client_encoding = 'UTF8';

-- Table: users
CREATE TABLE users (
    id SERIAL PRIMARY KEY,
    email VARCHAR(255) UNIQUE NOT NULL,
    password_hash VARCHAR(255) NOT NULL,
    role VARCHAR(50) DEFAULT 'user',
    created_at TIMESTAMP DEFAULT NOW()
);

INSERT INTO users (email, password_hash, role) VALUES
('nico@kreyol-labs.com', '$2b$12$EXAMPLEHASHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'admin'),
('deploy@kreyol-labs.com', '$2b$12$EXAMPLEHASHbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb', 'deployer'),
('monitor@kreyol-labs.com', '$2b$12$EXAMPLEHASHcccccccccccccccccccccccccccccccccccccccccc', 'readonly');

-- Table: api_keys (données frelatées)
CREATE TABLE api_keys (
    id SERIAL PRIMARY KEY,
    user_id INTEGER REFERENCES users(id),
    key_hash VARCHAR(255) NOT NULL,
    description TEXT,
    expires_at TIMESTAMP
);

INSERT INTO api_keys (user_id, key_hash, description, expires_at) VALUES
(1, 'sha256:EXAMPLEHASH0000000000000000000000000000000000000000000000000000', 'Main admin key', '2027-01-01'),
(2, 'sha256:EXAMPLEHASH1111111111111111111111111111111111111111111111111111', 'Deploy key', '2026-12-31');

-- Table: sessions (toutes invalides)
CREATE TABLE sessions (
    token VARCHAR(255) PRIMARY KEY,
    user_id INTEGER REFERENCES users(id),
    expires_at TIMESTAMP
);
