PRAGMA foreign_keys=ON;

CREATE TABLE user (
    user_id INTEGER PRIMARY KEY AUTOINCREMENT,
    user_name TEXT NOT NULL,
    user_flag TEXT NOT NULL,
    password TEXT NOT NULL  -- Nova coluna para senha hasheada
);

CREATE TABLE api_key (
    api_key_id INTEGER PRIMARY KEY AUTOINCREMENT,
    user_id INTEGER NOT NULL,
    api_key_user TEXT NOT NULL,
    api_key_secret TEXT NOT NULL,
    FOREIGN KEY (user_id) REFERENCES user(user_id)
);