add mariadb & mysql support

This commit is contained in:
lesion 2021-12-07 23:53:35 +01:00
parent fb22dfd114
commit 6e10b64b96
No known key found for this signature in database
GPG key ID: 352918250B012177
3 changed files with 5 additions and 2 deletions

View file

@ -6,9 +6,11 @@
v-btn-toggle(text color='primary' v-model='db.dialect')
v-btn(value='sqlite' text) sqlite
v-btn(value='postgres' text) postgres
v-btn(value='mariadb' text) mariadb
v-btn(value='mysql' text) mysql
template(v-if='db.dialect === "sqlite"')
v-text-field(v-model='db.storage' label='Path')
template(v-if='db.dialect === "postgres"')
template(v-if='db.dialect !== "sqlite"')
v-text-field(v-model='db.hostname' label='Hostname' :rules="[$validators.required('hostname')]")
v-text-field(v-model='db.database' label='Database' :rules="[$validators.required('database')]")
v-text-field(v-model='db.username' label='Username' :rules="[$validators.required('username')]")

View file

@ -13,6 +13,7 @@ const db = {
},
connect (dbConf = config.db) {
log.debug(`Connecting to DB: ${JSON.stringify(dbConf)}`)
dbConf.dialectOptions = { autoJsonMap: false }
db.sequelize = new Sequelize(dbConf)
return db.sequelize.authenticate()
},

View file

@ -5,7 +5,7 @@ module.exports = {
return queryInterface.createTable('event_notifications', {
status: {
type: Sequelize.ENUM,
values: ['new', 'sent', 'error'],
values: ['new', 'sent', 'error', 'sending'],
defaultValue: 'new',
index: true
},