Files
evening_detective_server/migrations/20260628175120_create_users_table.sql
2026-07-06 12:58:27 +07:00

14 lines
411 B
SQL

-- +goose Up
CREATE TABLE
IF NOT EXISTS users (
id SERIAL PRIMARY KEY,
username VARCHAR(50) NOT NULL UNIQUE,
email VARCHAR(100) NOT NULL UNIQUE,
password_hash VARCHAR(255) NOT NULL,
roles jsonb NOT NULL DEFAULT '[]'::jsonb,
is_active BOOLEAN DEFAULT TRUE,
created_at TIMESTAMP NOT NULL DEFAULT NOW ()
);
-- +goose Down
DROP TABLE IF EXISTS users;