mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-18 17:25:16 -04:00
Run database migrations automatically on startup
Instead of using sequelize-cli and ensure migrations by shellscript, this patch automates database migrations properly to the umzug library. The sequelize CLI becomes a dev dependencies as it's still useful for generating migrations. This should eliminate the need for crude generating of database config files and alike. Instead we utilize the pre-configured sequelize connection that CodiMD will use anyway. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
This commit is contained in:
parent
2c3522992b
commit
6c1ca5bd8d
19 changed files with 70 additions and 35 deletions
|
@ -1,11 +1,11 @@
|
|||
'use strict'
|
||||
|
||||
module.exports = {
|
||||
up: function (queryInterface, Sequelize) {
|
||||
up: async function (queryInterface, Sequelize) {
|
||||
return queryInterface.changeColumn('Notes', 'permission', { type: Sequelize.ENUM('freely', 'editable', 'limited', 'locked', 'protected', 'private') })
|
||||
},
|
||||
|
||||
down: function (queryInterface, Sequelize) {
|
||||
down: async function (queryInterface, Sequelize) {
|
||||
return queryInterface.changeColumn('Notes', 'permission', { type: Sequelize.ENUM('freely', 'editable', 'locked', 'private') })
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue