This repository has been archived by the owner on May 30, 2021. It is now read-only.
V0.1.0
Breaking Changes:
Update your database tables
CREATE TABLE "role" (
name text NOT NULL PRIMARY KEY,
created_at timestamp with time zone NOT NULL DEFAULT now()
);
CREATE TABLE "user_role" (
id uuid DEFAULT gen_random_uuid() NOT NULL CONSTRAINT user_role_pkey PRIMARY KEY,
user_id uuid NOT NULL CONSTRAINT user_role_user_id_fkey REFERENCES "user" ON UPDATE CASCADE ON DELETE CASCADE,
role text NOT NULL,
created_at timestamp WITH TIME ZONE DEFAULT now() NOT NULL,
updated_at timestamp WITH TIME ZONE DEFAULT now() NOT NULL,
CONSTRAINT user_role_user_id_role_key UNIQUE (user_id, role)
);
INSERT INTO "role" ("name") VALUES ('user');
ALTER TABLE "user" RENAME COLUMN "role" TO "default_role";