]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/Cryptoportfolio/Front.git/blobdiff - db/migrations.go
User roles.
[perso/Immae/Projets/Cryptomonnaies/Cryptoportfolio/Front.git] / db / migrations.go
index f0df49c6b9c4339965f783abd24c6111f85e7164..e8fc40d12762934caa1222995879a0ab2f973b3c 100644 (file)
@@ -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",
+               },
+       },
 }