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