mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-22 01:36:29 -05:00
fix: Add missing migration
This commit is contained in:
parent
b2985085d0
commit
6f14822413
7 changed files with 139 additions and 0 deletions
24
lib/migrations/20150504155329-create-users.js
Normal file
24
lib/migrations/20150504155329-create-users.js
Normal file
|
@ -0,0 +1,24 @@
|
|||
'use strict'
|
||||
module.exports = {
|
||||
up: function (queryInterface, Sequelize) {
|
||||
return queryInterface.createTable('Users', {
|
||||
id: {
|
||||
type: Sequelize.UUID,
|
||||
primaryKey: true,
|
||||
defaultValue: Sequelize.UUIDV4
|
||||
},
|
||||
profileid: {
|
||||
type: Sequelize.STRING,
|
||||
unique: true
|
||||
},
|
||||
profile: Sequelize.TEXT,
|
||||
history: Sequelize.TEXT,
|
||||
createdAt: Sequelize.DATE,
|
||||
updatedAt: Sequelize.DATE
|
||||
})
|
||||
},
|
||||
|
||||
down: function (queryInterface, Sequelize) {
|
||||
return queryInterface.dropTable('Users')
|
||||
}
|
||||
}
|
21
lib/migrations/20150508114741-create-notes.js
Normal file
21
lib/migrations/20150508114741-create-notes.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
'use strict'
|
||||
module.exports = {
|
||||
up: function (queryInterface, Sequelize) {
|
||||
return queryInterface.createTable('Notes', {
|
||||
id: {
|
||||
type: Sequelize.UUID,
|
||||
primaryKey: true,
|
||||
defaultValue: Sequelize.UUIDV4
|
||||
},
|
||||
ownerId: Sequelize.UUID,
|
||||
content: Sequelize.TEXT,
|
||||
title: Sequelize.STRING,
|
||||
createdAt: Sequelize.DATE,
|
||||
updatedAt: Sequelize.DATE
|
||||
})
|
||||
},
|
||||
|
||||
down: function (queryInterface, Sequelize) {
|
||||
return queryInterface.dropTable('Notes')
|
||||
}
|
||||
}
|
18
lib/migrations/20150515125813-create-temp.js
Normal file
18
lib/migrations/20150515125813-create-temp.js
Normal file
|
@ -0,0 +1,18 @@
|
|||
'use strict'
|
||||
module.exports = {
|
||||
up: function (queryInterface, Sequelize) {
|
||||
return queryInterface.createTable('Temp', {
|
||||
id: {
|
||||
type: Sequelize.STRING,
|
||||
primaryKey: true
|
||||
},
|
||||
date: Sequelize.TEXT,
|
||||
createdAt: Sequelize.DATE,
|
||||
updatedAt: Sequelize.DATE
|
||||
})
|
||||
},
|
||||
|
||||
down: function (queryInterface, Sequelize) {
|
||||
return queryInterface.dropTable('Temp')
|
||||
}
|
||||
}
|
30
lib/migrations/20150702001020-update-to-0_3_1.js
Normal file
30
lib/migrations/20150702001020-update-to-0_3_1.js
Normal file
|
@ -0,0 +1,30 @@
|
|||
'use strict'
|
||||
module.exports = {
|
||||
up: function (queryInterface, Sequelize) {
|
||||
return queryInterface.addColumn('Notes', 'shortid', {
|
||||
type: Sequelize.STRING,
|
||||
unique: true,
|
||||
allowNull: false
|
||||
}).then(function () {
|
||||
return queryInterface.addColumn('Notes', 'permission', {
|
||||
type: Sequelize.STRING,
|
||||
allowNull: false,
|
||||
defaultValue: 0
|
||||
})
|
||||
}).then(function () {
|
||||
return queryInterface.addColumn('Notes', 'viewcount', {
|
||||
type: Sequelize.INTEGER
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
down: function (queryInterface, Sequelize) {
|
||||
return queryInterface.removeColumn('Notes', 'viewcount')
|
||||
.then(function () {
|
||||
return queryInterface.removeColumn('Notes', 'permission')
|
||||
})
|
||||
.then(function () {
|
||||
return queryInterface.removeColumn('Notes', 'shortid')
|
||||
})
|
||||
}
|
||||
}
|
14
lib/migrations/20150915153700-change-notes-title-to-text.js
Normal file
14
lib/migrations/20150915153700-change-notes-title-to-text.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
'use strict'
|
||||
module.exports = {
|
||||
up: function (queryInterface, Sequelize) {
|
||||
return queryInterface.changeColumn('Notes', 'title', {
|
||||
type: Sequelize.TEXT
|
||||
})
|
||||
},
|
||||
|
||||
down: function (queryInterface, Sequelize) {
|
||||
return queryInterface.changeColumn('Notes', 'title', {
|
||||
type: Sequelize.STRING
|
||||
})
|
||||
}
|
||||
}
|
19
lib/migrations/20160112220142-note-add-lastchange.js
Normal file
19
lib/migrations/20160112220142-note-add-lastchange.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
'use strict'
|
||||
module.exports = {
|
||||
up: function (queryInterface, Sequelize) {
|
||||
return queryInterface.addColumn('Notes', 'lastchangeuserId', {
|
||||
type: Sequelize.UUID
|
||||
}).then(function () {
|
||||
return queryInterface.addColumn('Notes', 'lastchangeAt', {
|
||||
type: Sequelize.DATE
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
down: function (queryInterface, Sequelize) {
|
||||
return queryInterface.removeColumn('Notes', 'lastchangeAt')
|
||||
.then(function () {
|
||||
return queryInterface.removeColumn('Notes', 'lastchangeuserId')
|
||||
})
|
||||
}
|
||||
}
|
13
lib/migrations/20160420180355-note-add-alias.js
Normal file
13
lib/migrations/20160420180355-note-add-alias.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
'use strict'
|
||||
module.exports = {
|
||||
up: function (queryInterface, Sequelize) {
|
||||
return queryInterface.addColumn('Notes', 'alias', {
|
||||
type: Sequelize.STRING,
|
||||
unique: true
|
||||
})
|
||||
},
|
||||
|
||||
down: function (queryInterface, Sequelize) {
|
||||
return queryInterface.removeColumn('Notes', 'alias')
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue