From cf5bb85cede5b05b58ed2b40460d0b913e8b2cf6 Mon Sep 17 00:00:00 2001 From: jloup Date: Sun, 13 May 2018 15:47:59 +0100 Subject: User roles. --- db/migrations.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'db/migrations.go') diff --git a/db/migrations.go b/db/migrations.go index f0df49c..e8fc40d 100644 --- a/db/migrations.go +++ b/db/migrations.go @@ -89,4 +89,15 @@ var migrations []Migration = []Migration{ "DROP TYPE market_config_status", }, }, + { + Version: 201805131000, + Up: []string{ + "CREATE TYPE user_role AS ENUM ('admin', 'user')", + "ALTER TABLE users ADD role user_role NOT NULL DEFAULT 'user'", + }, + Down: []string{ + "ALTER TABLE users DROP COLUMN role", + "DROP TYPE user_role", + }, + }, } -- cgit v1.2.3