Browse Source

feat: add redirects migration

main
Garrit Franke 3 years ago
parent
commit
cc2adad602
Signed by: garrit
GPG Key ID: 65586C4DDA55EA2C
  1. 24
      server/migrations/20210708184239_add_users_table.js
  2. 13
      server/migrations/20211021202715_add_redirects_table.js

24
server/migrations/20210708184239_add_users_table.js

@ -1,17 +1,13 @@
exports.up = function(knex) {
return knex.schema
.createTable('users', function (table) {
table.increments('id').primary().notNullable();
table.string('email', 255).notNullable();
table.string('password_hash').notNullable();
table.string('username', 255).notNullable();
table.timestamps(true, true);
})
exports.up = function (knex) {
return knex.schema.createTable("users", function (table) {
table.increments("id").primary().notNullable();
table.string("email", 255).notNullable();
table.string("password_hash").notNullable();
table.string("username", 255).notNullable();
table.timestamps(true, true);
});
};
exports.down = function(knex) {
return knex.schema
.dropTable("users");
exports.down = function (knex) {
return knex.schema.dropTable("users");
};

13
server/migrations/20211021202715_add_redirects_table.js

@ -0,0 +1,13 @@
exports.up = function (knex) {
return knex.schema.createTable("redirects", function (table) {
table.increments("id").primary().notNullable();
table.integer("user_id").references("user.id");
table.string("forward_to").notNullable();
table.string("alias").notNullable();
table.timestamps(true, true);
});
};
exports.down = function (knex) {
return knex.schema.dropTable("redirects");
};
Loading…
Cancel
Save