feat: first migration for user
This commit is contained in:
18
migrations/00001_initial_setup.sql
Normal file
18
migrations/00001_initial_setup.sql
Normal 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
|
Reference in New Issue
Block a user