This repository has been archived on 2025-03-30. You can view files and clone it, but cannot push or open issues or pull requests.
bactdb/migrations/00001_AddUsers_up.sql
Matthew Dillon 2894efaf46 Drop soft-delete
Fixes #13.
2015-10-13 16:03:18 -07:00

22 lines
536 B
SQL

-- bactdb
-- Matthew R Dillon
CREATE TYPE e_roles AS ENUM('R', 'W', 'A');
-- 'R': read-only, default
-- 'W': read-write
-- 'A': administrator
CREATE TABLE users (
id BIGSERIAL NOT NULL,
email CHARACTER VARYING(254) NOT NULL UNIQUE,
password CHARACTER(60) NOT NULL,
name TEXT NOT NULL,
role e_roles DEFAULT 'R' NOT NULL,
verified BOOLEAN NOT NULL DEFAULT FALSE,
created_at TIMESTAMP WITH TIME ZONE NOT NULL,
updated_at TIMESTAMP WITH TIME ZONE NOT NULL,
CONSTRAINT users_pkey PRIMARY KEY (id)
);