Browse Source

Added slug to posts migration

Signed-off-by: Dušan Mitrović <dusan@dusanmitrovic.xyz>
master
Dušan Mitrović 10 months ago
parent
commit
2bfc90bb3c
No known key found for this signature in database GPG Key ID: 8E81D1BFCE8427E5
2 changed files with 22 additions and 1 deletions
  1. +1
    -1
      config/nodemailer.js
  2. +21
    -0
      db/migrations/20201213191639_AddSlugToPosts.js

+ 1
- 1
config/nodemailer.js View File

@@ -11,7 +11,7 @@ const transporterOptions = {
user: process.env.MAILER_USERNAME,
pass: process.env.MAILER_PASSWORD
},
secure: parseInt(process.env.MAILER_SECURE) === 0 ? false : true,
secure: parseInt(process.env.MAILER_SECURE) !== 0,
};

module.exports = transporterOptions;

+ 21
- 0
db/migrations/20201213191639_AddSlugToPosts.js View File

@@ -0,0 +1,21 @@
exports.up = function (knex) {
return knex.schema.alterTable('posts', table => {
table
.string('slug', 120)
.notNullable();

table.index([
'slug'
]);
});
};

exports.down = function (knex) {
return knex.schema.alterTable('posts', table => {
table.dropIndex([
'slug'
]);

table.dropColumn('slug');
});
};

Loading…
Cancel
Save