bazzar/crates/idp/migrations/202204131841_init.sql

24 lines
765 B
MySQL
Raw Permalink Normal View History

2024-06-26 11:12:06 +02:00
CREATE EXTENSION IF NOT EXISTS "uuid-ossp" WITH SCHEMA public;
CREATE TYPE "AccountState" AS ENUM (
'active',
'suspended',
'banned'
);
CREATE TYPE "Role" AS ENUM (
'admin',
'user'
);
CREATE TABLE public.accounts
(
id serial NOT NULL,
email character varying NOT NULL,
login character varying NOT NULL,
pass_hash character varying NOT NULL,
role "Role" DEFAULT 'user'::"Role" NOT NULL,
customer_id uuid DEFAULT gen_random_uuid() NOT NULL,
state "AccountState" DEFAULT 'active'::"AccountState" NOT NULL
);