fix: add missing migration
authorxangelo <me@xangelo.ca>
Fri, 29 Sep 2023 16:17:02 +0000 (12:17 -0400)
committerxangelo <me@xangelo.ca>
Fri, 29 Sep 2023 16:17:02 +0000 (12:17 -0400)
migrations/20230929141329_location_levels.ts [new file with mode: 0644]

diff --git a/migrations/20230929141329_location_levels.ts b/migrations/20230929141329_location_levels.ts
new file mode 100644 (file)
index 0000000..e712f0b
--- /dev/null
@@ -0,0 +1,16 @@
+import { Knex } from "knex";
+
+
+export async function up(knex: Knex): Promise<void> {
+  return knex.schema.alterTable('locations', function(table) {
+    table.integer('min_level').defaultTo(1);
+  });
+}
+
+
+export async function down(knex: Knex): Promise<void> {
+  return knex.schema.alterTable('locations', function(table) {
+    table.dropColumn('min_level');
+  });
+}
+