-- +goose Up
CREATE TABLE IF NOT EXISTS login_attempts (
    ip TEXT PRIMARY KEY,
    fail_count INTEGER NOT NULL DEFAULT 0,
    window_start TEXT NOT NULL,
    locked_until TEXT
);

INSERT OR IGNORE INTO settings (key, value) VALUES
    ('login_max_attempts', '5'),
    ('login_lock_minutes', '15');

-- +goose Down
DROP TABLE IF EXISTS login_attempts;
DELETE FROM settings WHERE key IN ('login_max_attempts', 'login_lock_minutes');
