Commit 57f5cbd5 authored by NGPixel's avatar NGPixel

misc: knex update for mssql constraint bug

parent c8608315
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
"dependencies": { "dependencies": {
"@aoberoi/passport-slack": "1.0.5", "@aoberoi/passport-slack": "1.0.5",
"@azure/storage-blob": "12.1.2", "@azure/storage-blob": "12.1.2",
"@bugsnag/js": "7.1.1", "@bugsnag/js": "7.2.0",
"@exlinc/keycloak-passport": "1.0.2", "@exlinc/keycloak-passport": "1.0.2",
"@root/csr": "0.8.1", "@root/csr": "0.8.1",
"@root/keypairs": "0.9.0", "@root/keypairs": "0.9.0",
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
"apollo-server": "2.15.1", "apollo-server": "2.15.1",
"apollo-server-express": "2.15.1", "apollo-server-express": "2.15.1",
"auto-load": "3.0.4", "auto-load": "3.0.4",
"aws-sdk": "2.709.0", "aws-sdk": "2.713.0",
"azure-search-client": "3.1.5", "azure-search-client": "3.1.5",
"bcryptjs-then": "1.0.1", "bcryptjs-then": "1.0.1",
"bluebird": "3.7.2", "bluebird": "3.7.2",
...@@ -90,19 +90,19 @@ ...@@ -90,19 +90,19 @@
"graphql-tools": "6.0.12", "graphql-tools": "6.0.12",
"he": "1.2.0", "he": "1.2.0",
"highlight.js": "10.1.1", "highlight.js": "10.1.1",
"i18next": "19.5.4", "i18next": "19.6.0",
"i18next-express-middleware": "2.0.0", "i18next-express-middleware": "2.0.0",
"i18next-node-fs-backend": "2.1.3", "i18next-node-fs-backend": "2.1.3",
"image-size": "0.8.3", "image-size": "0.8.3",
"js-base64": "2.6.2", "js-base64": "2.6.3",
"js-binary": "1.2.0", "js-binary": "1.2.0",
"js-yaml": "3.14.0", "js-yaml": "3.14.0",
"jsdom": "16.2.2", "jsdom": "16.3.0",
"jsonwebtoken": "8.5.1", "jsonwebtoken": "8.5.1",
"katex": "0.11.1", "katex": "0.11.1",
"klaw": "3.0.0", "klaw": "3.0.0",
"knex": "0.21.1", "knex": "0.21.2",
"lodash": "4.17.15", "lodash": "4.17.19",
"luxon": "1.24.1", "luxon": "1.24.1",
"markdown-it": "11.0.0", "markdown-it": "11.0.0",
"markdown-it-abbr": "1.0.4", "markdown-it-abbr": "1.0.4",
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
"node-2fa": "1.1.2", "node-2fa": "1.1.2",
"node-cache": "5.1.2", "node-cache": "5.1.2",
"nodemailer": "6.4.10", "nodemailer": "6.4.10",
"objection": "2.2.0", "objection": "2.2.1",
"passport": "0.4.1", "passport": "0.4.1",
"passport-auth0": "1.3.3", "passport-auth0": "1.3.3",
"passport-azure-ad": "4.2.1", "passport-azure-ad": "4.2.1",
...@@ -152,10 +152,10 @@ ...@@ -152,10 +152,10 @@
"passport-saml": "1.3.3", "passport-saml": "1.3.3",
"passport-twitch-oauth": "1.0.0", "passport-twitch-oauth": "1.0.0",
"pem-jwk": "2.0.0", "pem-jwk": "2.0.0",
"pg": "8.2.1", "pg": "8.3.0",
"pg-hstore": "2.3.3", "pg-hstore": "2.3.3",
"pg-pubsub": "0.5.0", "pg-pubsub": "0.5.0",
"pg-query-stream": "3.1.1", "pg-query-stream": "3.2.0",
"pg-tsquery": "8.1.0", "pg-tsquery": "8.1.0",
"pug": "3.0.0", "pug": "3.0.0",
"punycode": "2.1.1", "punycode": "2.1.1",
...@@ -169,13 +169,13 @@ ...@@ -169,13 +169,13 @@
"scim-query-filter-parser": "2.0.4", "scim-query-filter-parser": "2.0.4",
"semver": "7.3.2", "semver": "7.3.2",
"serve-favicon": "2.5.0", "serve-favicon": "2.5.0",
"simple-git": "2.11.0", "simple-git": "2.12.0",
"solr-node": "1.2.1", "solr-node": "1.2.1",
"sqlite3": "5.0.0", "sqlite3": "5.0.0",
"ssh2": "0.8.9", "ssh2": "0.8.9",
"ssh2-promise": "0.1.7", "ssh2-promise": "0.1.7",
"striptags": "3.1.1", "striptags": "3.1.1",
"subscriptions-transport-ws": "0.9.16", "subscriptions-transport-ws": "0.9.17",
"tar-fs": "2.1.0", "tar-fs": "2.1.0",
"twemoji": "13.0.0", "twemoji": "13.0.0",
"uslug": "1.0.4", "uslug": "1.0.4",
...@@ -183,7 +183,7 @@ ...@@ -183,7 +183,7 @@
"validate.js": "0.13.1", "validate.js": "0.13.1",
"winston": "3.3.3", "winston": "3.3.3",
"xss": "1.0.7", "xss": "1.0.7",
"yargs": "15.4.0" "yargs": "15.4.1"
}, },
"devDependencies": { "devDependencies": {
"@babel/cli": "^7.10.4", "@babel/cli": "^7.10.4",
...@@ -214,7 +214,7 @@ ...@@ -214,7 +214,7 @@
"apollo-link-persisted-queries": "0.2.2", "apollo-link-persisted-queries": "0.2.2",
"apollo-link-ws": "1.0.20", "apollo-link-ws": "1.0.20",
"apollo-utilities": "1.3.4", "apollo-utilities": "1.3.4",
"autoprefixer": "9.8.4", "autoprefixer": "9.8.5",
"babel-eslint": "10.1.0", "babel-eslint": "10.1.0",
"babel-jest": "26.1.0", "babel-jest": "26.1.0",
"babel-loader": "^8.1.0", "babel-loader": "^8.1.0",
...@@ -233,7 +233,7 @@ ...@@ -233,7 +233,7 @@
"core-js": "3.6.5", "core-js": "3.6.5",
"css-loader": "3.6.0", "css-loader": "3.6.0",
"cssnano": "4.1.10", "cssnano": "4.1.10",
"cypress": "4.9.0", "cypress": "4.10.0",
"d3": "5.16.0", "d3": "5.16.0",
"duplicate-package-checker-webpack-plugin": "3.0.0", "duplicate-package-checker-webpack-plugin": "3.0.0",
"epic-spinners": "1.1.0", "epic-spinners": "1.1.0",
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
"filepond-plugin-file-validate-type": "1.2.5", "filepond-plugin-file-validate-type": "1.2.5",
"filesize.js": "2.0.0", "filesize.js": "2.0.0",
"graphql-persisted-document-loader": "2.0.0", "graphql-persisted-document-loader": "2.0.0",
"graphql-tag": "^2.10.3", "graphql-tag": "^2.10.4",
"hammerjs": "2.0.8", "hammerjs": "2.0.8",
"html-webpack-plugin": "4.3.0", "html-webpack-plugin": "4.3.0",
"html-webpack-pug-plugin": "2.0.0", "html-webpack-pug-plugin": "2.0.0",
...@@ -283,8 +283,8 @@ ...@@ -283,8 +283,8 @@
"pug-plain-loader": "1.0.0", "pug-plain-loader": "1.0.0",
"raw-loader": "4.0.1", "raw-loader": "4.0.1",
"resolve-url-loader": "3.1.1", "resolve-url-loader": "3.1.1",
"sass": "1.26.9", "sass": "1.26.10",
"sass-loader": "9.0.1", "sass-loader": "9.0.2",
"sass-resources-loader": "2.0.3", "sass-resources-loader": "2.0.3",
"script-ext-html-webpack-plugin": "2.1.4", "script-ext-html-webpack-plugin": "2.1.4",
"simple-progress-webpack-plugin": "1.1.2", "simple-progress-webpack-plugin": "1.1.2",
...@@ -306,10 +306,10 @@ ...@@ -306,10 +306,10 @@
"vue-status-indicator": "1.2.1", "vue-status-indicator": "1.2.1",
"vue-template-compiler": "2.6.11", "vue-template-compiler": "2.6.11",
"vue2-animate": "2.1.3", "vue2-animate": "2.1.3",
"vuedraggable": "2.23.2", "vuedraggable": "2.24.0",
"vuescroll": "4.16.0", "vuescroll": "4.16.0",
"vuetify": "2.3.3", "vuetify": "2.3.4",
"vuetify-loader": "1.5.0", "vuetify-loader": "1.6.0",
"vuex": "3.5.1", "vuex": "3.5.1",
"vuex-pathify": "1.4.1", "vuex-pathify": "1.4.1",
"vuex-persistedstate": "3.0.1", "vuex-persistedstate": "3.0.1",
...@@ -318,13 +318,13 @@ ...@@ -318,13 +318,13 @@
"webpack-cli": "3.3.12", "webpack-cli": "3.3.12",
"webpack-dev-middleware": "3.7.2", "webpack-dev-middleware": "3.7.2",
"webpack-hot-middleware": "2.25.0", "webpack-hot-middleware": "2.25.0",
"webpack-merge": "4.2.2", "webpack-merge": "5.0.9",
"webpack-modernizr-loader": "5.0.0", "webpack-modernizr-loader": "5.0.0",
"webpack-subresource-integrity": "1.4.1", "webpack-subresource-integrity": "1.4.1",
"webpackbar": "4.0.0", "webpackbar": "4.0.0",
"whatwg-fetch": "3.1.0", "whatwg-fetch": "3.2.0",
"write-file-webpack-plugin": "4.5.1", "write-file-webpack-plugin": "4.5.1",
"xterm": "4.7.0", "xterm": "4.8.1",
"zxcvbn": "4.4.2" "zxcvbn": "4.4.2"
}, },
"resolutions": { "resolutions": {
......
/* global WIKI */
exports.up = async knex => { exports.up = async knex => {
await knex('authentication').where('isEnabled', false).del() await knex('authentication').where('isEnabled', false).del()
// -> Knex bug #3855 workaround
// -> https://github.com/knex/knex/pull/3855
if (WIKI.config.db.type === 'mssql') {
await knex.schema.raw(`
DECLARE @constraint varchar(100) = (SELECT default_constraints.name
FROM sys.all_columns
INNER JOIN sys.tables
ON all_columns.object_id = tables.object_id
INNER JOIN sys.schemas
ON tables.schema_id = schemas.schema_id
INNER JOIN sys.default_constraints
ON all_columns.default_object_id = default_constraints.object_id
WHERE schemas.name = 'dbo'
AND tables.name = 'authentication'
AND all_columns.name = 'isEnabled')
IF @constraint IS NOT NULL EXEC('ALTER TABLE authentication DROP CONSTRAINT ' + @constraint)`)
}
await knex.schema await knex.schema
.alterTable('authentication', table => { .alterTable('authentication', table => {
table.dropColumn('isEnabled') table.dropColumn('isEnabled')
......
This diff was suppressed by a .gitattributes entry.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment