fix signup route and add create users table migration

This commit is contained in:
2026-06-29 00:59:10 +07:00
parent bb2cb3a540
commit 0f9bf8dfc1
5 changed files with 45 additions and 32 deletions
@@ -0,0 +1,13 @@
-- +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,
role VARCHAR(20) DEFAULT 'user' CHECK (role IN ('admin', 'author', 'organizer', 'user')),
is_active BOOLEAN DEFAULT TRUE,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- +goose Down
DROP TABLE IF EXISTS users;