fix: mssql initial migration crash

This commit is contained in:
Nicolas Giard
2018-09-08 15:49:36 -04:00
parent e284822875
commit 92d0925d51
18 changed files with 254 additions and 176 deletions

View File

@@ -12,6 +12,7 @@ const commonHelper = require('../helpers/common')
*/
module.exports = class Authentication extends Model {
static get tableName() { return 'authentication' }
static get idColumn() { return 'key' }
static get jsonSchema () {
return {
@@ -19,7 +20,6 @@ module.exports = class Authentication extends Model {
required: ['key', 'isEnabled'],
properties: {
id: {type: 'integer'},
key: {type: 'string'},
isEnabled: {type: 'boolean'},
config: {type: 'object'},

View File

@@ -12,6 +12,7 @@ const commonHelper = require('../helpers/common')
*/
module.exports = class Editor extends Model {
static get tableName() { return 'editors' }
static get idColumn() { return 'key' }
static get jsonSchema () {
return {
@@ -19,7 +20,6 @@ module.exports = class Editor extends Model {
required: ['key', 'isEnabled'],
properties: {
id: {type: 'integer'},
key: {type: 'string'},
isEnabled: {type: 'boolean'},
config: {type: 'object'}

View File

@@ -5,6 +5,7 @@ const Model = require('objection').Model
*/
module.exports = class User extends Model {
static get tableName() { return 'locales' }
static get idColumn() { return 'code' }
static get jsonSchema () {
return {
@@ -12,7 +13,6 @@ module.exports = class User extends Model {
required: ['code', 'name'],
properties: {
id: {type: 'integer'},
code: {type: 'string'},
strings: {type: 'object'},
isRTL: {type: 'boolean', default: false},

View File

@@ -12,6 +12,7 @@ const commonHelper = require('../helpers/common')
*/
module.exports = class Logger extends Model {
static get tableName() { return 'loggers' }
static get idColumn() { return 'key' }
static get jsonSchema () {
return {
@@ -19,7 +20,6 @@ module.exports = class Logger extends Model {
required: ['key', 'isEnabled'],
properties: {
id: {type: 'integer'},
key: {type: 'string'},
isEnabled: {type: 'boolean'},
level: {type: 'string'},

View File

@@ -12,6 +12,7 @@ const commonHelper = require('../helpers/common')
*/
module.exports = class Renderer extends Model {
static get tableName() { return 'renderers' }
static get idColumn() { return 'key' }
static get jsonSchema () {
return {
@@ -19,7 +20,6 @@ module.exports = class Renderer extends Model {
required: ['key', 'isEnabled'],
properties: {
id: {type: 'integer'},
key: {type: 'string'},
isEnabled: {type: 'boolean'},
config: {type: 'object'}

View File

@@ -12,6 +12,7 @@ const commonHelper = require('../helpers/common')
*/
module.exports = class SearchEngine extends Model {
static get tableName() { return 'searchEngines' }
static get idColumn() { return 'key' }
static get jsonSchema () {
return {
@@ -19,7 +20,6 @@ module.exports = class SearchEngine extends Model {
required: ['key', 'isEnabled'],
properties: {
id: {type: 'integer'},
key: {type: 'string'},
isEnabled: {type: 'boolean'},
level: {type: 'string'},

View File

@@ -8,6 +8,7 @@ const _ = require('lodash')
*/
module.exports = class Setting extends Model {
static get tableName() { return 'settings' }
static get idColumn() { return 'key' }
static get jsonSchema () {
return {
@@ -15,7 +16,6 @@ module.exports = class Setting extends Model {
required: ['key', 'value'],
properties: {
id: {type: 'integer'},
key: {type: 'string'},
value: {type: 'object'},
createdAt: {type: 'string'},

View File

@@ -12,6 +12,7 @@ const commonHelper = require('../helpers/common')
*/
module.exports = class Storage extends Model {
static get tableName() { return 'storage' }
static get idColumn() { return 'key' }
static get jsonSchema () {
return {
@@ -19,7 +20,6 @@ module.exports = class Storage extends Model {
required: ['key', 'isEnabled'],
properties: {
id: {type: 'integer'},
key: {type: 'string'},
isEnabled: {type: 'boolean'},
mode: {type: 'string'},