starter-kit/migrations/000001_create_roles_table.up.sql
ulflow_phattt2901 23ec4d7bd2
Some checks failed
CI Pipeline / Lint (push) Failing after 5m30s
CI Pipeline / Test (push) Has been skipped
CI Pipeline / Security Scan (push) Successful in 6m6s
CI Pipeline / Build (push) Has been skipped
CI Pipeline / Notification (push) Successful in 2s
feat: implement auth middleware and unit tests with JWT validation
2025-06-03 21:31:18 +07:00

23 lines
615 B
SQL

-- +goose Up
-- +goose StatementBegin
CREATE TABLE roles (
id SERIAL PRIMARY KEY,
name VARCHAR(50) UNIQUE NOT NULL,
description TEXT,
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
);
-- Insert default roles
INSERT INTO roles (name, description) VALUES
('admin', 'Quản trị viên hệ thống'),
('manager', 'Quản lý'),
('user', 'Người dùng thông thường'),
('guest', 'Khách');
-- +goose StatementEnd
-- +goose Down
-- +goose StatementBegin
DROP TABLE IF EXISTS roles CASCADE;
-- +goose StatementEnd