aboutsummaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/migrations/20210713174217_add_admin_to_users.js11
-rw-r--r--db/models/users.js9
2 files changed, 20 insertions, 0 deletions
diff --git a/db/migrations/20210713174217_add_admin_to_users.js b/db/migrations/20210713174217_add_admin_to_users.js
new file mode 100644
index 00000000..c8e009b1
--- /dev/null
+++ b/db/migrations/20210713174217_add_admin_to_users.js
@@ -0,0 +1,11 @@
+exports.up = async function(knex) {
+ return knex.schema.table("users", function(table) {
+ table.boolean("admin");
+ });
+};
+
+exports.down = async function(knex) {
+ return knex.schema.table("users", function(table) {
+ table.dropColumn("admin");
+ });
+};
diff --git a/db/models/users.js b/db/models/users.js
index e2275229..2abf1c79 100644
--- a/db/models/users.js
+++ b/db/models/users.js
@@ -10,6 +10,15 @@ const attributes = {
comment: null,
field: "id"
},
+ admin: {
+ type: DataTypes.BOOLEAN,
+ allowNull: true,
+ defaultValue: false,
+ primaryKey: false,
+ autoIncrement: false,
+ comment: null,
+ field: "admin"
+ },
locked: {
type: DataTypes.BOOLEAN,
allowNull: true,