Files
isp-admin-service/migrations/00002_2018-04-27_create_roles_table.sql

15 lines
480 B
SQL

-- +goose Up
CREATE TABLE IF NOT EXISTS roles (
id serial4 PRIMARY KEY NOT NULL,
name varchar(64) NOT NULL,
rights jsonb NOT NULL DEFAULT '{}',
description text,
created_at timestamp DEFAULT (now() at time zone 'utc') NOT NULL,
updated_at timestamp DEFAULT (now() at time zone 'utc') NOT NULL
);
CREATE TRIGGER update_create_update_time BEFORE UPDATE ON roles
FOR EACH ROW EXECUTE PROCEDURE update_created_modified_column_date();
-- +goose Down
DROP TABLE roles;