tm-apps-db
Advanced tools
Comparing version 1.4.18 to 1.5.1
@@ -10,6 +10,13 @@ Information on using the Sequelize CLI to perform database migrations can be viewed here: | ||
up: (queryInterface, sequelize) => { | ||
return queryInterface.addColumn('articles', 'a_new_column', sequelize.STRING) | ||
return queryInterface.addColumn('article_content', 'gallery_id', sequelize.STRING) | ||
.catch((e) => { | ||
if (e.parent.code === "42701") { | ||
console.log(`Column(s) gallery_id already exists in article_content. Swallow error`); | ||
} else { | ||
throw e; | ||
} | ||
}); | ||
}, | ||
down: (queryInterface, sequelize) => { | ||
return queryInterface.removeColumn('articles', 'a_new_column', sequelize.STRING) | ||
return queryInterface.removeColumn('article_content', 'gallery_id', sequelize.STRING); | ||
} | ||
@@ -16,0 +23,0 @@ }; |
@@ -105,3 +105,3 @@ "use strict"; | ||
const content = R.map(R.assoc('article_id', this.getDataValue('id')), data); | ||
return sequelize.models.article_author .bulkCreate(content, options); | ||
return sequelize.models.article_author.bulkCreate(content, options); | ||
}, | ||
@@ -108,0 +108,0 @@ purgeRelations: function (options) { |
{ | ||
"name": "tm-apps-db", | ||
"version": "1.4.18", | ||
"version": "1.5.1", | ||
"description": "Apps consumer database initialiser", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
38
25037
21
681