From cd4d27aff62a4d8c07918e26c81cb2a864a9986e Mon Sep 17 00:00:00 2001 From: LandaMm Date: Sun, 18 May 2025 11:47:47 +0200 Subject: [PATCH] feat: first migration for user --- migrations/00001_initial_setup.sql | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 migrations/00001_initial_setup.sql diff --git a/migrations/00001_initial_setup.sql b/migrations/00001_initial_setup.sql new file mode 100644 index 0000000..03c8b12 --- /dev/null +++ b/migrations/00001_initial_setup.sql @@ -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