feat: first migration for user

This commit is contained in:
2025-05-18 11:47:47 +02:00
parent 09db1538a7
commit cd4d27aff6

View File

@ -0,0 +1,18 @@
-- +goose Up
-- +goose StatementBegin
CREATE TABLE users (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(), -- Unique identifier
email TEXT UNIQUE NOT NULL, -- Unique user email
full_name TEXT NOT NULL, -- User's full name
password_hash TEXT NOT NULL, -- Hashed password (e.g., bcrypt)
is_admin BOOLEAN NOT NULL DEFAULT FALSE, -- Superuser/admin flag
created_at TIMESTAMPTZ DEFAULT now(), -- Timestamp of creation
updated_at TIMESTAMPTZ DEFAULT now(), -- Timestamp of last update
last_login TIMESTAMPTZ -- Optional: for login auditing
);
-- +goose StatementEnd
-- +goose Down
-- +goose StatementBegin
DROP TABLE users;
-- +goose StatementEnd