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

23 lines
556 B
MySQL
Raw Normal View History

2022-11-04 18:40:14 +01: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 integer 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
);