Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d788291 commit 79d28dbCopy full SHA for 79d28db
server/initializers/migrations/0200-video-published-at.ts
@@ -9,7 +9,7 @@ async function up (utils: {
9
{
10
const data = {
11
type: Sequelize.DATE,
12
- allowNull: false,
+ allowNull: true,
13
defaultValue: Sequelize.NOW
14
}
15
await utils.queryInterface.addColumn('video', 'publishedAt', data)
@@ -20,6 +20,16 @@ async function up (utils: {
20
await utils.sequelize.query(query)
21
22
23
+ // Sequelize does not alter the column with NOW as default value
24
+ {
25
+ const data = {
26
+ type: Sequelize.DATE,
27
+ allowNull: false,
28
+ defaultValue: Sequelize.NOW
29
+ }
30
+ await utils.queryInterface.changeColumn('video', 'publishedAt', data)
31
32
+
33
34
35
function down (options) {
0 commit comments