mirror of
https://codeberg.org/timelimit/timelimit-server.git
synced 2025-10-03 09:49:32 +02:00
Update sequelize
This commit is contained in:
parent
17058c375c
commit
e70a80bf46
38 changed files with 238 additions and 220 deletions
144
package-lock.json
generated
144
package-lock.json
generated
|
@ -143,11 +143,6 @@
|
||||||
"@types/range-parser": "*"
|
"@types/range-parser": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@types/geojson": {
|
|
||||||
"version": "1.0.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-1.0.6.tgz",
|
|
||||||
"integrity": "sha512-Xqg/lIZMrUd0VRmSRbCAewtwGZiAk3mEUDvV4op1tGl+LvyPcb/MIOSxTl9z+9+J+R4/vpjiCAT4xeKzH9ji1w=="
|
|
||||||
},
|
|
||||||
"@types/http-errors": {
|
"@types/http-errors": {
|
||||||
"version": "1.6.1",
|
"version": "1.6.1",
|
||||||
"resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-1.6.1.tgz",
|
"resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-1.6.1.tgz",
|
||||||
|
@ -419,6 +414,11 @@
|
||||||
"resolved": "https://registry.npmjs.org/ansicolors/-/ansicolors-0.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/ansicolors/-/ansicolors-0.3.2.tgz",
|
||||||
"integrity": "sha1-ZlWX3oap/+Oqm/vmyuXG6kJrSXk="
|
"integrity": "sha1-ZlWX3oap/+Oqm/vmyuXG6kJrSXk="
|
||||||
},
|
},
|
||||||
|
"any-promise": {
|
||||||
|
"version": "1.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz",
|
||||||
|
"integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8="
|
||||||
|
},
|
||||||
"anymatch": {
|
"anymatch": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz",
|
||||||
|
@ -1554,9 +1554,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dottie": {
|
"dottie": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/dottie/-/dottie-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/dottie/-/dottie-2.0.1.tgz",
|
||||||
"integrity": "sha1-2hkZgci41xPKARXViYzzl8Lw3dA="
|
"integrity": "sha512-ch5OQgvGDK2u8pSZeSYAQaV/lczImd7pMJ7BcEPXmnFVjy4yJIzP6CsODJUTH8mg1tyH1Z2abOiuJO3DjZ/GBw=="
|
||||||
},
|
},
|
||||||
"duplexer": {
|
"duplexer": {
|
||||||
"version": "0.1.1",
|
"version": "0.1.1",
|
||||||
|
@ -2828,11 +2828,6 @@
|
||||||
"is-property": "^1.0.2"
|
"is-property": "^1.0.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"generic-pool": {
|
|
||||||
"version": "3.4.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/generic-pool/-/generic-pool-3.4.2.tgz",
|
|
||||||
"integrity": "sha512-H7cUpwCQSiJmAHM4c/aFu6fUfrhWXW1ncyh8ftxEPMu6AiYkHw9K8br720TGPZJbk5eOH2bynjZD1yPvdDAmag=="
|
|
||||||
},
|
|
||||||
"get-caller-file": {
|
"get-caller-file": {
|
||||||
"version": "1.0.3",
|
"version": "1.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz",
|
||||||
|
@ -4103,14 +4098,14 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"moment": {
|
"moment": {
|
||||||
"version": "2.22.2",
|
"version": "2.24.0",
|
||||||
"resolved": "https://registry.npmjs.org/moment/-/moment-2.22.2.tgz",
|
"resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz",
|
||||||
"integrity": "sha1-PCV/mDn8DpP/UxSWMiOeuQeD/2Y="
|
"integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg=="
|
||||||
},
|
},
|
||||||
"moment-timezone": {
|
"moment-timezone": {
|
||||||
"version": "0.5.21",
|
"version": "0.5.25",
|
||||||
"resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.21.tgz",
|
"resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.25.tgz",
|
||||||
"integrity": "sha512-j96bAh4otsgj3lKydm3K7kdtA3iKf2m6MY2iSYCzCm5a1zmHo1g+aK3068dDEeocLZQIS9kU8bsdQHLqEvgW0A==",
|
"integrity": "sha512-DgEaTyN/z0HFaVcVbSyVCUU6HeFdnNC3vE4c9cgu2dgMTvjBUBdBzWfasTBmAW45u5OIMeCJtU8yNjM22DHucw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"moment": ">= 2.9.0"
|
"moment": ">= 2.9.0"
|
||||||
}
|
}
|
||||||
|
@ -5123,22 +5118,11 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"retry-as-promised": {
|
"retry-as-promised": {
|
||||||
"version": "2.3.2",
|
"version": "3.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/retry-as-promised/-/retry-as-promised-2.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/retry-as-promised/-/retry-as-promised-3.2.0.tgz",
|
||||||
"integrity": "sha1-zZdO5P2bX+A8vzGHHuSCIcB3N7c=",
|
"integrity": "sha512-CybGs60B7oYU/qSQ6kuaFmRd9sTZ6oXSc0toqePvV74Ac6/IFZSI1ReFQmtCN+uvW1Mtqdwpvt/LGOiCBAY2Mg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"bluebird": "^3.4.6",
|
"any-promise": "^1.3.0"
|
||||||
"debug": "^2.6.9"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"debug": {
|
|
||||||
"version": "2.6.9",
|
|
||||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
|
||||||
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
|
||||||
"requires": {
|
|
||||||
"ms": "2.0.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"right-align": {
|
"right-align": {
|
||||||
|
@ -5278,29 +5262,52 @@
|
||||||
"integrity": "sha1-1WgS4cAXpuTnw+Ojeh2m143TyT4="
|
"integrity": "sha1-1WgS4cAXpuTnw+Ojeh2m143TyT4="
|
||||||
},
|
},
|
||||||
"sequelize": {
|
"sequelize": {
|
||||||
"version": "4.38.0",
|
"version": "5.8.12",
|
||||||
"resolved": "https://registry.npmjs.org/sequelize/-/sequelize-4.38.0.tgz",
|
"resolved": "https://registry.npmjs.org/sequelize/-/sequelize-5.8.12.tgz",
|
||||||
"integrity": "sha512-ZCcV2HuzU+03xunWgVeyXnPa/RYY5D2U/WUNpq+xF8VmDTLnSDsHl+pEwmiWrpZD7KdBqDczCeTgjToYyVzYQg==",
|
"integrity": "sha512-TtgGgQx/+Nub/IdkV7hqEoozUnOYv28waB/l44fMk37Rr+4G3Inrn9opDb/g81zSuRUKsYGOucdWq0qLH+7ujA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"bluebird": "^3.5.0",
|
"bluebird": "^3.5.0",
|
||||||
"cls-bluebird": "^2.1.0",
|
"cls-bluebird": "^2.1.0",
|
||||||
"debug": "^3.1.0",
|
"debug": "^4.1.1",
|
||||||
"depd": "^1.1.0",
|
|
||||||
"dottie": "^2.0.0",
|
"dottie": "^2.0.0",
|
||||||
"generic-pool": "^3.4.0",
|
|
||||||
"inflection": "1.12.0",
|
"inflection": "1.12.0",
|
||||||
"lodash": "^4.17.1",
|
"lodash": "^4.17.11",
|
||||||
"moment": "^2.20.0",
|
"moment": "^2.24.0",
|
||||||
"moment-timezone": "^0.5.14",
|
"moment-timezone": "^0.5.21",
|
||||||
"retry-as-promised": "^2.3.2",
|
"retry-as-promised": "^3.1.0",
|
||||||
"semver": "^5.5.0",
|
"semver": "^6.1.1",
|
||||||
"terraformer-wkt-parser": "^1.1.2",
|
"sequelize-pool": "^2.2.0",
|
||||||
"toposort-class": "^1.0.1",
|
"toposort-class": "^1.0.1",
|
||||||
"uuid": "^3.2.1",
|
"uuid": "^3.2.1",
|
||||||
"validator": "^10.4.0",
|
"validator": "^10.11.0",
|
||||||
"wkx": "^0.4.1"
|
"wkx": "^0.4.6"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"debug": {
|
||||||
|
"version": "4.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
|
||||||
|
"integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
|
||||||
|
"requires": {
|
||||||
|
"ms": "^2.1.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"ms": {
|
||||||
|
"version": "2.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||||
|
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
|
||||||
|
},
|
||||||
|
"semver": {
|
||||||
|
"version": "6.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/semver/-/semver-6.1.2.tgz",
|
||||||
|
"integrity": "sha512-z4PqiCpomGtWj8633oeAdXm1Kn1W++3T8epkZYnwiVgIYIJ0QHszhInYSJTYxebByQH7KVCEAn8R9duzZW2PhQ=="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sequelize-pool": {
|
||||||
|
"version": "2.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/sequelize-pool/-/sequelize-pool-2.2.0.tgz",
|
||||||
|
"integrity": "sha512-N/cYyxNHShfANGXAhHtMExjWNr+eYCS4/pF5fs5fvPYxn1VgUhEX8kDmVV5bNS0gZwt55fjU9Sgg48k3Dy/uMg=="
|
||||||
|
},
|
||||||
"serve-static": {
|
"serve-static": {
|
||||||
"version": "1.13.2",
|
"version": "1.13.2",
|
||||||
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz",
|
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz",
|
||||||
|
@ -5365,9 +5372,9 @@
|
||||||
"integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM="
|
"integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM="
|
||||||
},
|
},
|
||||||
"shimmer": {
|
"shimmer": {
|
||||||
"version": "1.2.0",
|
"version": "1.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/shimmer/-/shimmer-1.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/shimmer/-/shimmer-1.2.1.tgz",
|
||||||
"integrity": "sha512-xTCx2vohXC2EWWDqY/zb4+5Mu28D+HYNSOuFzsyRDRvI/e1ICb69afwaUwfjr+25ZXldbOLyp+iDUZHq8UnTag=="
|
"integrity": "sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw=="
|
||||||
},
|
},
|
||||||
"signal-exit": {
|
"signal-exit": {
|
||||||
"version": "3.0.2",
|
"version": "3.0.2",
|
||||||
|
@ -5740,23 +5747,6 @@
|
||||||
"execa": "^0.7.0"
|
"execa": "^0.7.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"terraformer": {
|
|
||||||
"version": "1.0.9",
|
|
||||||
"resolved": "https://registry.npmjs.org/terraformer/-/terraformer-1.0.9.tgz",
|
|
||||||
"integrity": "sha512-YlmQ1fsMWTkKGDGibCRWgmLzrpDRUr63Q025LJ/taYQ6j1Yb8q9McKF7NBi6ACAyUXO6F/bl9w6v4MY307y5Ag==",
|
|
||||||
"requires": {
|
|
||||||
"@types/geojson": "^1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"terraformer-wkt-parser": {
|
|
||||||
"version": "1.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/terraformer-wkt-parser/-/terraformer-wkt-parser-1.2.0.tgz",
|
|
||||||
"integrity": "sha512-QU3iA54St5lF8Za1jg1oj4NYc8sn5tCZ08aNSWDeGzrsaV48eZk1iAVWasxhNspYBoCqdHuoot1pUTUrE1AJ4w==",
|
|
||||||
"requires": {
|
|
||||||
"@types/geojson": "^1.0.0",
|
|
||||||
"terraformer": "~1.0.5"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"through": {
|
"through": {
|
||||||
"version": "2.3.8",
|
"version": "2.3.8",
|
||||||
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
|
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
|
||||||
|
@ -5973,9 +5963,9 @@
|
||||||
"integrity": "sha1-0cIJOlT/ihn1jP+HfuqlTyJC04M="
|
"integrity": "sha1-0cIJOlT/ihn1jP+HfuqlTyJC04M="
|
||||||
},
|
},
|
||||||
"typescript": {
|
"typescript": {
|
||||||
"version": "2.9.2",
|
"version": "3.5.2",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.2.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.2.tgz",
|
||||||
"integrity": "sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w==",
|
"integrity": "sha512-7KxJovlYhTX5RaRbUdkAXN1KUZ8PwWlTzQdHV6xNqvuFOs7+WBo10TQUqT19Q/Jz2hk5v9TQDIhyLhhJY4p5AA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"typescript-json-schema": {
|
"typescript-json-schema": {
|
||||||
|
@ -6288,9 +6278,9 @@
|
||||||
"integrity": "sha512-FXg2qXMzfAhZc0y2HzELNfUeiOjPr+52hU1DNBWiJJ2luXD+dD1R9NA48Ug5aj0ibbxroeGDc/RJv6ThiGgkDw=="
|
"integrity": "sha512-FXg2qXMzfAhZc0y2HzELNfUeiOjPr+52hU1DNBWiJJ2luXD+dD1R9NA48Ug5aj0ibbxroeGDc/RJv6ThiGgkDw=="
|
||||||
},
|
},
|
||||||
"validator": {
|
"validator": {
|
||||||
"version": "10.4.0",
|
"version": "10.11.0",
|
||||||
"resolved": "https://registry.npmjs.org/validator/-/validator-10.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/validator/-/validator-10.11.0.tgz",
|
||||||
"integrity": "sha512-Q/wBy3LB1uOyssgNlXSRmaf22NxjvDNZM2MtIQ4jaEOAB61xsh1TQxsq1CgzUMBV1lDrVMogIh8GjG1DYW0zLg=="
|
"integrity": "sha512-X/p3UZerAIsbBfN/IwahhYaBbY68EN/UQBWHtsbXGT5bfrH/p4NQzUCG1kF/rtKaNpnJ7jAu6NGTdSNtyNIXMw=="
|
||||||
},
|
},
|
||||||
"vary": {
|
"vary": {
|
||||||
"version": "1.1.2",
|
"version": "1.1.2",
|
||||||
|
@ -6449,9 +6439,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"wkx": {
|
"wkx": {
|
||||||
"version": "0.4.5",
|
"version": "0.4.7",
|
||||||
"resolved": "https://registry.npmjs.org/wkx/-/wkx-0.4.5.tgz",
|
"resolved": "https://registry.npmjs.org/wkx/-/wkx-0.4.7.tgz",
|
||||||
"integrity": "sha512-01dloEcJZAJabLO5XdcRgqdKpmnxS0zIT02LhkdWOZX2Zs2tPM6hlZ4XG9tWaWur1Qd1OO4kJxUbe2+5BofvnA==",
|
"integrity": "sha512-pHf546L96TK8RradLt1cWaIffstgv/zXZ14CGz5KnBs1AxBX0wm+IDphjJw0qrEqRv8P9W9CdTt8Z1unMRZ19A==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/node": "*"
|
"@types/node": "*"
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,14 +31,13 @@
|
||||||
"@types/express": "^4.16.0",
|
"@types/express": "^4.16.0",
|
||||||
"@types/http-errors": "^1.6.1",
|
"@types/http-errors": "^1.6.1",
|
||||||
"@types/lodash": "^4.14.116",
|
"@types/lodash": "^4.14.116",
|
||||||
"@types/sequelize": "^4.27.24",
|
|
||||||
"@types/socket.io": "^1.4.36",
|
"@types/socket.io": "^1.4.36",
|
||||||
"@types/tokgen": "^1.0.0",
|
"@types/tokgen": "^1.0.0",
|
||||||
"@types/umzug": "^2.2.0",
|
"@types/umzug": "^2.2.0",
|
||||||
"nodemon": "^1.18.3",
|
"nodemon": "^1.18.3",
|
||||||
"tslint": "^5.11.0",
|
"tslint": "^5.11.0",
|
||||||
"tslint-config-standard": "^7.1.0",
|
"tslint-config-standard": "^7.1.0",
|
||||||
"typescript": "^2.9.2",
|
"typescript": "^3.5.2",
|
||||||
"typescript-json-schema": "^0.31.0"
|
"typescript-json-schema": "^0.31.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -57,7 +56,7 @@
|
||||||
"pg": "^7.8.0",
|
"pg": "^7.8.0",
|
||||||
"pg-hstore": "^2.3.2",
|
"pg-hstore": "^2.3.2",
|
||||||
"rate-limiter-flexible": "^0.21.2",
|
"rate-limiter-flexible": "^0.21.2",
|
||||||
"sequelize": "^4.38.0",
|
"sequelize": "^5.8.12",
|
||||||
"socket.io": "^2.1.1",
|
"socket.io": "^2.1.1",
|
||||||
"tokgen": "^1.0.0",
|
"tokgen": "^1.0.0",
|
||||||
"umzug": "^2.1.0"
|
"umzug": "^2.1.0"
|
||||||
|
|
|
@ -26,8 +26,10 @@ export interface AddDeviceTokenAttributes {
|
||||||
createdAt: string
|
createdAt: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type AddDeviceTokenInstance = Sequelize.Instance<AddDeviceTokenAttributes> & AddDeviceTokenAttributes
|
export type AddDeviceTokenModel = Sequelize.Model & AddDeviceTokenAttributes
|
||||||
export type AddDeviceTokenModel = Sequelize.Model<AddDeviceTokenInstance, AddDeviceTokenAttributes>
|
export type AddDeviceTokenModelStatic = typeof Sequelize.Model & {
|
||||||
|
new (values?: object, options?: Sequelize.BuildOptions): AddDeviceTokenModel;
|
||||||
|
}
|
||||||
|
|
||||||
export const attributes: SequelizeAttributes<AddDeviceTokenAttributes> = {
|
export const attributes: SequelizeAttributes<AddDeviceTokenAttributes> = {
|
||||||
token: {
|
token: {
|
||||||
|
@ -39,4 +41,4 @@ export const attributes: SequelizeAttributes<AddDeviceTokenAttributes> = {
|
||||||
createdAt: { ...timestampColumn }
|
createdAt: { ...timestampColumn }
|
||||||
}
|
}
|
||||||
|
|
||||||
export const createAddDeviceTokenModel = (sequelize: Sequelize.Sequelize): AddDeviceTokenModel => sequelize.define<AddDeviceTokenInstance, AddDeviceTokenInstance>('AddDeviceToken', attributes)
|
export const createAddDeviceTokenModel = (sequelize: Sequelize.Sequelize): AddDeviceTokenModelStatic => <AddDeviceTokenModelStatic>sequelize.define('AddDeviceToken', attributes)
|
||||||
|
|
|
@ -29,8 +29,10 @@ export interface AppAttributes {
|
||||||
recommendation: AppRecommendation
|
recommendation: AppRecommendation
|
||||||
}
|
}
|
||||||
|
|
||||||
export type AppInstance = Sequelize.Instance<AppAttributes> & AppAttributes
|
export type AppModel = Sequelize.Model & AppAttributes
|
||||||
export type AppModel = Sequelize.Model<AppInstance, AppAttributes>
|
export type AppModelStatic = typeof Sequelize.Model & {
|
||||||
|
new (values?: object, options?: Sequelize.BuildOptions): AppModel;
|
||||||
|
}
|
||||||
|
|
||||||
export const attributes: SequelizeAttributes<AppAttributes> = {
|
export const attributes: SequelizeAttributes<AppAttributes> = {
|
||||||
familyId: {
|
familyId: {
|
||||||
|
@ -54,4 +56,4 @@ export const attributes: SequelizeAttributes<AppAttributes> = {
|
||||||
recommendation: createEnumColumn(appRecommendationValues)
|
recommendation: createEnumColumn(appRecommendationValues)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const createAppModel = (sequelize: Sequelize.Sequelize): AppModel => sequelize.define<AppInstance, AppAttributes>('App', attributes)
|
export const createAppModel = (sequelize: Sequelize.Sequelize): AppModelStatic => <AppModelStatic>sequelize.define('App', attributes)
|
||||||
|
|
|
@ -27,8 +27,10 @@ export interface AppActivityAttributes {
|
||||||
title: string
|
title: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type AppActivityInstance = Sequelize.Instance<AppActivityAttributes> & AppActivityAttributes
|
export type AppActivityModel = Sequelize.Model & AppActivityAttributes
|
||||||
export type AppActivityModel = Sequelize.Model<AppActivityInstance, AppActivityAttributes>
|
export type AppActivityModelStatic = typeof Sequelize.Model & {
|
||||||
|
new (values?: object, options?: Sequelize.BuildOptions): AppActivityModel;
|
||||||
|
}
|
||||||
|
|
||||||
export const attributes: SequelizeAttributes<AppActivityAttributes> = {
|
export const attributes: SequelizeAttributes<AppActivityAttributes> = {
|
||||||
familyId: {
|
familyId: {
|
||||||
|
@ -58,4 +60,4 @@ export const attributes: SequelizeAttributes<AppActivityAttributes> = {
|
||||||
title: { ...optionalLabelColumn }
|
title: { ...optionalLabelColumn }
|
||||||
}
|
}
|
||||||
|
|
||||||
export const createAppActivityModel = (sequelize: Sequelize.Sequelize): AppActivityModel => sequelize.define<AppActivityInstance, AppActivityAttributes>('AppActivity', attributes)
|
export const createAppActivityModel = (sequelize: Sequelize.Sequelize): AppActivityModelStatic => <AppActivityModelStatic>sequelize.define('AppActivity', attributes)
|
||||||
|
|
|
@ -25,8 +25,10 @@ export interface AuthTokenAttributes {
|
||||||
createdAt: string
|
createdAt: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type AuthTokenInstance = Sequelize.Instance<AuthTokenAttributes> & AuthTokenAttributes
|
export type AuthTokenModel = Sequelize.Model & AuthTokenAttributes
|
||||||
export type AuthTokenModel = Sequelize.Model<AuthTokenInstance, AuthTokenAttributes>
|
export type AuthTokenModelStatic = typeof Sequelize.Model & {
|
||||||
|
new (values?: object, options?: Sequelize.BuildOptions): AuthTokenModel;
|
||||||
|
}
|
||||||
|
|
||||||
export const attributes: SequelizeAttributes<AuthTokenAttributes> = {
|
export const attributes: SequelizeAttributes<AuthTokenAttributes> = {
|
||||||
token: {
|
token: {
|
||||||
|
@ -43,4 +45,4 @@ export const attributes: SequelizeAttributes<AuthTokenAttributes> = {
|
||||||
createdAt: { ...timestampColumn }
|
createdAt: { ...timestampColumn }
|
||||||
}
|
}
|
||||||
|
|
||||||
export const createAuthtokenModel = (sequelize: Sequelize.Sequelize): AuthTokenModel => sequelize.define<AuthTokenInstance, AuthTokenAttributes>('AuthToken', attributes)
|
export const createAuthtokenModel = (sequelize: Sequelize.Sequelize): AuthTokenModelStatic => <AuthTokenModelStatic>sequelize.define('AuthToken', attributes)
|
||||||
|
|
|
@ -51,8 +51,10 @@ export interface CategoryAttributesVersion4 {
|
||||||
export type CategoryAttributes = CategoryAttributesVersion1 & CategoryAttributesVersion2 &
|
export type CategoryAttributes = CategoryAttributesVersion1 & CategoryAttributesVersion2 &
|
||||||
CategoryAttributesVersion3 & CategoryAttributesVersion4
|
CategoryAttributesVersion3 & CategoryAttributesVersion4
|
||||||
|
|
||||||
export type CategoryInstance = Sequelize.Instance<CategoryAttributes> & CategoryAttributes
|
export type CategoryModel = Sequelize.Model & CategoryAttributes
|
||||||
export type CategoryModel = Sequelize.Model<CategoryInstance, CategoryAttributes>
|
export type CategoryModelStatic = typeof Sequelize.Model & {
|
||||||
|
new (values?: object, options?: Sequelize.BuildOptions): CategoryModel;
|
||||||
|
}
|
||||||
|
|
||||||
export const attributesVersion1: SequelizeAttributes<CategoryAttributesVersion1> = {
|
export const attributesVersion1: SequelizeAttributes<CategoryAttributesVersion1> = {
|
||||||
familyId: {
|
familyId: {
|
||||||
|
@ -124,4 +126,4 @@ export const attributes: SequelizeAttributes<CategoryAttributes> = {
|
||||||
...attributesVersion4
|
...attributesVersion4
|
||||||
}
|
}
|
||||||
|
|
||||||
export const createCategoryModel = (sequelize: Sequelize.Sequelize): CategoryModel => sequelize.define<CategoryInstance, CategoryAttributes>('Category', attributes)
|
export const createCategoryModel = (sequelize: Sequelize.Sequelize): CategoryModelStatic => <CategoryModelStatic>sequelize.define('Category', attributes)
|
||||||
|
|
|
@ -25,8 +25,10 @@ export interface CategoryAppAttributes {
|
||||||
packageName: string
|
packageName: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type CategoryAppInstance = Sequelize.Instance<CategoryAppAttributes> & CategoryAppAttributes
|
export type CategoryAppModel = Sequelize.Model & CategoryAppAttributes
|
||||||
export type CategoryAppModel = Sequelize.Model<CategoryAppInstance, CategoryAppAttributes>
|
export type CategoryAppModelStatic = typeof Sequelize.Model & {
|
||||||
|
new (values?: object, options?: Sequelize.BuildOptions): CategoryAppModel;
|
||||||
|
}
|
||||||
|
|
||||||
export const attributes: SequelizeAttributes<CategoryAppAttributes> = {
|
export const attributes: SequelizeAttributes<CategoryAppAttributes> = {
|
||||||
familyId: {
|
familyId: {
|
||||||
|
@ -47,4 +49,4 @@ export const attributes: SequelizeAttributes<CategoryAppAttributes> = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const createCategoryAppModel = (sequelize: Sequelize.Sequelize): CategoryAppModel => sequelize.define<CategoryAppInstance, CategoryAppAttributes>('CategoryApp', attributes)
|
export const createCategoryAppModel = (sequelize: Sequelize.Sequelize): CategoryAppModelStatic => <CategoryAppModelStatic>sequelize.define('CategoryApp', attributes)
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
import * as Sequelize from 'sequelize'
|
import * as Sequelize from 'sequelize'
|
||||||
|
|
||||||
export const familyIdColumn: Sequelize.DefineAttributeColumnOptions = {
|
export const familyIdColumn: Sequelize.ModelAttributeColumnOptions = {
|
||||||
type: Sequelize.STRING(10),
|
type: Sequelize.STRING(10),
|
||||||
allowNull: false,
|
allowNull: false,
|
||||||
validate: {
|
validate: {
|
||||||
|
@ -26,7 +26,7 @@ export const familyIdColumn: Sequelize.DefineAttributeColumnOptions = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const idWithinFamilyColumn: Sequelize.DefineAttributeColumnOptions = {
|
export const idWithinFamilyColumn: Sequelize.ModelAttributeColumnOptions = {
|
||||||
type: Sequelize.STRING(6),
|
type: Sequelize.STRING(6),
|
||||||
allowNull: false,
|
allowNull: false,
|
||||||
validate: {
|
validate: {
|
||||||
|
@ -35,7 +35,7 @@ export const idWithinFamilyColumn: Sequelize.DefineAttributeColumnOptions = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const optionalIdWithinFamilyColumn: Sequelize.DefineAttributeColumnOptions = {
|
export const optionalIdWithinFamilyColumn: Sequelize.ModelAttributeColumnOptions = {
|
||||||
type: Sequelize.STRING(6),
|
type: Sequelize.STRING(6),
|
||||||
allowNull: false,
|
allowNull: false,
|
||||||
validate: {
|
validate: {
|
||||||
|
@ -43,7 +43,7 @@ export const optionalIdWithinFamilyColumn: Sequelize.DefineAttributeColumnOption
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const versionColumn: Sequelize.DefineAttributeColumnOptions = {
|
export const versionColumn: Sequelize.ModelAttributeColumnOptions = {
|
||||||
type: Sequelize.STRING(4),
|
type: Sequelize.STRING(4),
|
||||||
allowNull: false,
|
allowNull: false,
|
||||||
validate: {
|
validate: {
|
||||||
|
@ -51,7 +51,7 @@ export const versionColumn: Sequelize.DefineAttributeColumnOptions = {
|
||||||
is: /^[a-zA-Z0-9]{4}$/
|
is: /^[a-zA-Z0-9]{4}$/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export const labelColumn: Sequelize.DefineAttributeColumnOptions = {
|
export const labelColumn: Sequelize.ModelAttributeColumnOptions = {
|
||||||
type: Sequelize.STRING,
|
type: Sequelize.STRING,
|
||||||
allowNull: false,
|
allowNull: false,
|
||||||
validate: {
|
validate: {
|
||||||
|
@ -59,12 +59,12 @@ export const labelColumn: Sequelize.DefineAttributeColumnOptions = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const optionalLabelColumn: Sequelize.DefineAttributeColumnOptions = {
|
export const optionalLabelColumn: Sequelize.ModelAttributeColumnOptions = {
|
||||||
type: Sequelize.STRING,
|
type: Sequelize.STRING,
|
||||||
allowNull: false
|
allowNull: false
|
||||||
}
|
}
|
||||||
|
|
||||||
export const createEnumColumn = (possibleValues: Array<string>): Sequelize.DefineAttributeColumnOptions => ({
|
export const createEnumColumn = (possibleValues: Array<string>): Sequelize.ModelAttributeColumnOptions => ({
|
||||||
type: Sequelize.STRING,
|
type: Sequelize.STRING,
|
||||||
allowNull: false,
|
allowNull: false,
|
||||||
validate: {
|
validate: {
|
||||||
|
@ -74,7 +74,7 @@ export const createEnumColumn = (possibleValues: Array<string>): Sequelize.Defin
|
||||||
})
|
})
|
||||||
|
|
||||||
// warning: this results in an string field
|
// warning: this results in an string field
|
||||||
export const timestampColumn: Sequelize.DefineAttributeColumnOptions = {
|
export const timestampColumn: Sequelize.ModelAttributeColumnOptions = {
|
||||||
type: Sequelize.BIGINT,
|
type: Sequelize.BIGINT,
|
||||||
allowNull: false,
|
allowNull: false,
|
||||||
validate: {
|
validate: {
|
||||||
|
@ -82,12 +82,12 @@ export const timestampColumn: Sequelize.DefineAttributeColumnOptions = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const booleanColumn: Sequelize.DefineAttributeColumnOptions = {
|
export const booleanColumn: Sequelize.ModelAttributeColumnOptions = {
|
||||||
type: Sequelize.BOOLEAN,
|
type: Sequelize.BOOLEAN,
|
||||||
allowNull: false
|
allowNull: false
|
||||||
}
|
}
|
||||||
|
|
||||||
export const authTokenColumn: Sequelize.DefineAttributeColumnOptions = {
|
export const authTokenColumn: Sequelize.ModelAttributeColumnOptions = {
|
||||||
type: Sequelize.STRING(32),
|
type: Sequelize.STRING(32),
|
||||||
allowNull: false,
|
allowNull: false,
|
||||||
validate: {
|
validate: {
|
||||||
|
|
|
@ -23,8 +23,10 @@ export interface ConfigAttributes {
|
||||||
value: string | null
|
value: string | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ConfigInstance = Sequelize.Instance<ConfigAttributes> & ConfigAttributes
|
export type ConfigModel = Sequelize.Model & ConfigAttributes
|
||||||
export type ConfigModel = Sequelize.Model<ConfigInstance, ConfigAttributes>
|
export type ConfigModelStatic = typeof Sequelize.Model & {
|
||||||
|
new (values?: object, options?: Sequelize.BuildOptions): ConfigModel;
|
||||||
|
}
|
||||||
|
|
||||||
export const attributes: SequelizeAttributes<ConfigAttributes> = {
|
export const attributes: SequelizeAttributes<ConfigAttributes> = {
|
||||||
id: {
|
id: {
|
||||||
|
@ -41,7 +43,7 @@ export const attributes: SequelizeAttributes<ConfigAttributes> = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const createConfigModel = (sequelize: Sequelize.Sequelize): ConfigModel => sequelize.define<ConfigInstance, ConfigAttributes>('Config', attributes)
|
export const createConfigModel = (sequelize: Sequelize.Sequelize): ConfigModelStatic => <ConfigModelStatic>sequelize.define('Config', attributes)
|
||||||
|
|
||||||
export const configItemIds = {
|
export const configItemIds = {
|
||||||
statusMessage: 'status_message'
|
statusMessage: 'status_message'
|
||||||
|
|
|
@ -93,8 +93,10 @@ export type DeviceAttributes = DeviceAttributesVersion1 & DeviceAttributesVersio
|
||||||
DeviceAttributesVersion6 & DeviceAttributesVersion7 & DeviceAttributesVersion8 &
|
DeviceAttributesVersion6 & DeviceAttributesVersion7 & DeviceAttributesVersion8 &
|
||||||
DeviceAttributesVersion9 & DeviceAttributesVersion10
|
DeviceAttributesVersion9 & DeviceAttributesVersion10
|
||||||
|
|
||||||
export type DeviceInstance = Sequelize.Instance<DeviceAttributes> & DeviceAttributes
|
export type DeviceModel = Sequelize.Model & DeviceAttributes
|
||||||
export type DeviceModel = Sequelize.Model<DeviceInstance, DeviceAttributes>
|
export type DeviceModelStatic = typeof Sequelize.Model & {
|
||||||
|
new (values?: object, options?: Sequelize.BuildOptions): DeviceModel;
|
||||||
|
}
|
||||||
|
|
||||||
export const attributesVersion1: SequelizeAttributes<DeviceAttributesVersion1> = {
|
export const attributesVersion1: SequelizeAttributes<DeviceAttributesVersion1> = {
|
||||||
familyId: {
|
familyId: {
|
||||||
|
@ -244,7 +246,7 @@ export const attributes: SequelizeAttributes<DeviceAttributes> = {
|
||||||
...attributesVersion10
|
...attributesVersion10
|
||||||
}
|
}
|
||||||
|
|
||||||
export const createDeviceModel = (sequelize: Sequelize.Sequelize): DeviceModel => sequelize.define<DeviceInstance, DeviceAttributes>('Device', attributes)
|
export const createDeviceModel = (sequelize: Sequelize.Sequelize): DeviceModelStatic => <DeviceModelStatic>sequelize.define('Device', attributes)
|
||||||
export const hasDeviceManipulation = (device: DeviceAttributes) => {
|
export const hasDeviceManipulation = (device: DeviceAttributes) => {
|
||||||
const manipulationOfProtectionLevel = device.currentProtectionLevel !== device.highestProtectionLevel
|
const manipulationOfProtectionLevel = device.currentProtectionLevel !== device.highestProtectionLevel
|
||||||
const manipulationOfUsageStats = device.currentUsageStatsPermission !== device.highestUsageStatsPermission
|
const manipulationOfUsageStats = device.currentUsageStatsPermission !== device.highestUsageStatsPermission
|
||||||
|
|
|
@ -29,8 +29,10 @@ export interface FamilyAttributes {
|
||||||
hasFullVersion: boolean
|
hasFullVersion: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export type FamilyInstance = Sequelize.Instance<FamilyAttributes> & FamilyAttributes
|
export type FamilyModel = Sequelize.Model & FamilyAttributes
|
||||||
export type FamilyModel = Sequelize.Model<FamilyInstance, FamilyAttributes>
|
export type FamilyModelStatic = typeof Sequelize.Model & {
|
||||||
|
new (values?: object, options?: Sequelize.BuildOptions): FamilyModel;
|
||||||
|
}
|
||||||
|
|
||||||
export const attributes: SequelizeAttributes<FamilyAttributes> = {
|
export const attributes: SequelizeAttributes<FamilyAttributes> = {
|
||||||
familyId: {
|
familyId: {
|
||||||
|
@ -45,4 +47,4 @@ export const attributes: SequelizeAttributes<FamilyAttributes> = {
|
||||||
hasFullVersion: { ...booleanColumn }
|
hasFullVersion: { ...booleanColumn }
|
||||||
}
|
}
|
||||||
|
|
||||||
export const createFamilyModel = (sequelize: Sequelize.Sequelize): FamilyModel => sequelize.define<FamilyInstance, FamilyAttributes>('Family', attributes)
|
export const createFamilyModel = (sequelize: Sequelize.Sequelize): FamilyModelStatic => <FamilyModelStatic>sequelize.define('Family', attributes)
|
||||||
|
|
|
@ -16,39 +16,39 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as Sequelize from 'sequelize'
|
import * as Sequelize from 'sequelize'
|
||||||
import { AddDeviceTokenModel, createAddDeviceTokenModel } from './adddevicetoken'
|
import { AddDeviceTokenModelStatic, createAddDeviceTokenModel } from './adddevicetoken'
|
||||||
import { AppModel, createAppModel } from './app'
|
import { AppModelStatic, createAppModel } from './app'
|
||||||
import { AppActivityModel, createAppActivityModel } from './appactivity'
|
import { AppActivityModelStatic, createAppActivityModel } from './appactivity'
|
||||||
import { AuthTokenModel, createAuthtokenModel } from './authtoken'
|
import { AuthTokenModelStatic, createAuthtokenModel } from './authtoken'
|
||||||
import { CategoryModel, createCategoryModel } from './category'
|
import { CategoryModelStatic, createCategoryModel } from './category'
|
||||||
import { CategoryAppModel, createCategoryAppModel } from './categoryapp'
|
import { CategoryAppModelStatic, createCategoryAppModel } from './categoryapp'
|
||||||
import { ConfigModel, createConfigModel } from './config'
|
import { ConfigModelStatic, createConfigModel } from './config'
|
||||||
import { createDeviceModel, DeviceModel } from './device'
|
import { createDeviceModel, DeviceModelStatic } from './device'
|
||||||
import { createFamilyModel, FamilyModel } from './family'
|
import { createFamilyModel, FamilyModelStatic } from './family'
|
||||||
import { createMailLoginTokenModel, MailLoginTokenModel } from './maillogintoken'
|
import { createMailLoginTokenModel, MailLoginTokenModelStatic } from './maillogintoken'
|
||||||
import { createUmzug } from './migration/umzug'
|
import { createUmzug } from './migration/umzug'
|
||||||
import { createOldDeviceModel, OldDeviceModel } from './olddevice'
|
import { createOldDeviceModel, OldDeviceModelStatic } from './olddevice'
|
||||||
import { createPurchaseModel, PurchaseModel } from './purchase'
|
import { createPurchaseModel, PurchaseModelStatic } from './purchase'
|
||||||
import { createTimelimitRuleModel, TimelimitRuleModel } from './timelimitrule'
|
import { createTimelimitRuleModel, TimelimitRuleModelStatic } from './timelimitrule'
|
||||||
import { createUsedTimeModel, UsedTimeModel } from './usedtime'
|
import { createUsedTimeModel, UsedTimeModelStatic } from './usedtime'
|
||||||
import { createUserModel, UserModel } from './user'
|
import { createUserModel, UserModelStatic } from './user'
|
||||||
|
|
||||||
export interface Database {
|
export interface Database {
|
||||||
addDeviceToken: AddDeviceTokenModel
|
addDeviceToken: AddDeviceTokenModelStatic
|
||||||
authtoken: AuthTokenModel
|
authtoken: AuthTokenModelStatic
|
||||||
app: AppModel
|
app: AppModelStatic
|
||||||
appActivity: AppActivityModel
|
appActivity: AppActivityModelStatic
|
||||||
category: CategoryModel
|
category: CategoryModelStatic
|
||||||
categoryApp: CategoryAppModel
|
categoryApp: CategoryAppModelStatic
|
||||||
config: ConfigModel
|
config: ConfigModelStatic
|
||||||
device: DeviceModel
|
device: DeviceModelStatic
|
||||||
family: FamilyModel
|
family: FamilyModelStatic
|
||||||
mailLoginToken: MailLoginTokenModel
|
mailLoginToken: MailLoginTokenModelStatic
|
||||||
oldDevice: OldDeviceModel
|
oldDevice: OldDeviceModelStatic
|
||||||
purchase: PurchaseModel
|
purchase: PurchaseModelStatic
|
||||||
timelimitRule: TimelimitRuleModel
|
timelimitRule: TimelimitRuleModelStatic
|
||||||
usedTime: UsedTimeModel
|
usedTime: UsedTimeModelStatic
|
||||||
user: UserModel
|
user: UserModelStatic
|
||||||
transaction: <T> (autoCallback: (t: Sequelize.Transaction) => Promise<T>) => Promise<T>
|
transaction: <T> (autoCallback: (t: Sequelize.Transaction) => Promise<T>) => Promise<T>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,11 +73,10 @@ const createDatabase = (sequelize: Sequelize.Sequelize): Database => ({
|
||||||
}, autoCallback) as any) as Promise<T>
|
}, autoCallback) as any) as Promise<T>
|
||||||
})
|
})
|
||||||
|
|
||||||
export const sequelize = new Sequelize(process.env.DATABASE_URL || 'sqlite://test.db', {
|
export const sequelize = new Sequelize.Sequelize(process.env.DATABASE_URL || 'sqlite://test.db', {
|
||||||
define: {
|
define: {
|
||||||
timestamps: false
|
timestamps: false
|
||||||
},
|
},
|
||||||
operatorsAliases: false,
|
|
||||||
logging: false
|
logging: false
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,10 @@ export interface MailLoginTokenAttributes {
|
||||||
remainingAttempts: number
|
remainingAttempts: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export type MailLoginTokenInstance = Sequelize.Instance<MailLoginTokenAttributes> & MailLoginTokenAttributes
|
export type MailLoginTokenModel = Sequelize.Model & MailLoginTokenAttributes
|
||||||
export type MailLoginTokenModel = Sequelize.Model<MailLoginTokenInstance, MailLoginTokenAttributes>
|
export type MailLoginTokenModelStatic = typeof Sequelize.Model & {
|
||||||
|
new (values?: object, options?: Sequelize.BuildOptions): MailLoginTokenModel;
|
||||||
|
}
|
||||||
|
|
||||||
export const attributes: SequelizeAttributes<MailLoginTokenAttributes> = {
|
export const attributes: SequelizeAttributes<MailLoginTokenAttributes> = {
|
||||||
mailLoginToken: {
|
mailLoginToken: {
|
||||||
|
@ -59,4 +61,4 @@ export const attributes: SequelizeAttributes<MailLoginTokenAttributes> = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const createMailLoginTokenModel = (sequelize: Sequelize.Sequelize): MailLoginTokenModel => sequelize.define<MailLoginTokenInstance, MailLoginTokenAttributes>('MailLoginToken', attributes)
|
export const createMailLoginTokenModel = (sequelize: Sequelize.Sequelize): MailLoginTokenModelStatic => <MailLoginTokenModelStatic>sequelize.define('MailLoginToken', attributes)
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { QueryInterface, Sequelize } from 'sequelize'
|
import { QueryInterface, Sequelize, Transaction } from 'sequelize'
|
||||||
import { attributes as addDeviceTokenAttributes } from '../../adddevicetoken'
|
import { attributes as addDeviceTokenAttributes } from '../../adddevicetoken'
|
||||||
import { attributes as appAttributes } from '../../app'
|
import { attributes as appAttributes } from '../../app'
|
||||||
import { attributes as authTokenAttributes } from '../../authtoken'
|
import { attributes as authTokenAttributes } from '../../authtoken'
|
||||||
|
@ -30,7 +30,7 @@ import { attributesVersion1 as userAttributes } from '../../user'
|
||||||
|
|
||||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||||
await sequelize.transaction({
|
await sequelize.transaction({
|
||||||
type: 'EXCLUSIVE'
|
type: Transaction.TYPES.EXCLUSIVE
|
||||||
}, async (transaction) => {
|
}, async (transaction) => {
|
||||||
await queryInterface.createTable('AddDeviceTokens', addDeviceTokenAttributes, { transaction })
|
await queryInterface.createTable('AddDeviceTokens', addDeviceTokenAttributes, { transaction })
|
||||||
await queryInterface.createTable('Apps', appAttributes, { transaction })
|
await queryInterface.createTable('Apps', appAttributes, { transaction })
|
||||||
|
|
|
@ -15,13 +15,13 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { QueryInterface, Sequelize } from 'sequelize'
|
import { QueryInterface, Sequelize, Transaction } from 'sequelize'
|
||||||
import { attributesVersion2 } from '../../device'
|
import { attributesVersion2 } from '../../device'
|
||||||
import { attributes as oldDeviceAttributes } from '../../olddevice'
|
import { attributes as oldDeviceAttributes } from '../../olddevice'
|
||||||
|
|
||||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||||
await sequelize.transaction({
|
await sequelize.transaction({
|
||||||
type: 'EXCLUSIVE'
|
type: Transaction.TYPES.EXCLUSIVE
|
||||||
}, async (transaction) => {
|
}, async (transaction) => {
|
||||||
await queryInterface.addColumn('Devices', 'lastConnectivity', {
|
await queryInterface.addColumn('Devices', 'lastConnectivity', {
|
||||||
...attributesVersion2.lastConnectivity
|
...attributesVersion2.lastConnectivity
|
||||||
|
@ -47,7 +47,7 @@ export async function up (queryInterface: QueryInterface, sequelize: Sequelize)
|
||||||
|
|
||||||
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||||
await sequelize.transaction({
|
await sequelize.transaction({
|
||||||
type: 'EXCLUSIVE'
|
type: Transaction.TYPES.EXCLUSIVE
|
||||||
}, async (transaction) => {
|
}, async (transaction) => {
|
||||||
await queryInterface.removeColumn('Devices', 'lastConnectivity', { transaction })
|
await queryInterface.removeColumn('Devices', 'lastConnectivity', { transaction })
|
||||||
await queryInterface.removeColumn('Devices', 'notSeenForLongTime', { transaction })
|
await queryInterface.removeColumn('Devices', 'notSeenForLongTime', { transaction })
|
||||||
|
|
|
@ -15,12 +15,12 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { QueryInterface, Sequelize } from 'sequelize'
|
import { QueryInterface, Sequelize, Transaction } from 'sequelize'
|
||||||
import { attributes as mailLoginTokenAttributes } from '../../maillogintoken'
|
import { attributes as mailLoginTokenAttributes } from '../../maillogintoken'
|
||||||
|
|
||||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||||
await sequelize.transaction({
|
await sequelize.transaction({
|
||||||
type: 'EXCLUSIVE'
|
type: Transaction.TYPES.EXCLUSIVE
|
||||||
}, async (transaction) => {
|
}, async (transaction) => {
|
||||||
await queryInterface.createTable('MailLoginTokens', mailLoginTokenAttributes, { transaction })
|
await queryInterface.createTable('MailLoginTokens', mailLoginTokenAttributes, { transaction })
|
||||||
})
|
})
|
||||||
|
@ -28,7 +28,7 @@ export async function up (queryInterface: QueryInterface, sequelize: Sequelize)
|
||||||
|
|
||||||
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||||
await sequelize.transaction({
|
await sequelize.transaction({
|
||||||
type: 'EXCLUSIVE'
|
type: Transaction.TYPES.EXCLUSIVE
|
||||||
}, async (transaction) => {
|
}, async (transaction) => {
|
||||||
await queryInterface.dropTable('MailLoginTokens', { transaction })
|
await queryInterface.dropTable('MailLoginTokens', { transaction })
|
||||||
})
|
})
|
||||||
|
|
|
@ -15,12 +15,12 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { QueryInterface, Sequelize } from 'sequelize'
|
import { QueryInterface, Sequelize, Transaction } from 'sequelize'
|
||||||
import { attributesVersion3 } from '../../device'
|
import { attributesVersion3 } from '../../device'
|
||||||
|
|
||||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||||
await sequelize.transaction({
|
await sequelize.transaction({
|
||||||
type: 'EXCLUSIVE'
|
type: Transaction.TYPES.EXCLUSIVE
|
||||||
}, async (transaction) => {
|
}, async (transaction) => {
|
||||||
await queryInterface.addColumn('Devices', 'isUserKeptSignedIn', {
|
await queryInterface.addColumn('Devices', 'isUserKeptSignedIn', {
|
||||||
...attributesVersion3.isUserKeptSignedIn
|
...attributesVersion3.isUserKeptSignedIn
|
||||||
|
@ -32,7 +32,7 @@ export async function up (queryInterface: QueryInterface, sequelize: Sequelize)
|
||||||
|
|
||||||
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||||
await sequelize.transaction({
|
await sequelize.transaction({
|
||||||
type: 'EXCLUSIVE'
|
type: Transaction.TYPES.EXCLUSIVE
|
||||||
}, async (transaction) => {
|
}, async (transaction) => {
|
||||||
await queryInterface.removeColumn('Devices', 'isUserKeptSignedIn', { transaction })
|
await queryInterface.removeColumn('Devices', 'isUserKeptSignedIn', { transaction })
|
||||||
})
|
})
|
||||||
|
|
|
@ -15,12 +15,12 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { QueryInterface, Sequelize } from 'sequelize'
|
import { QueryInterface, Sequelize, Transaction } from 'sequelize'
|
||||||
import { attributesVersion2 } from '../../user'
|
import { attributesVersion2 } from '../../user'
|
||||||
|
|
||||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||||
await sequelize.transaction({
|
await sequelize.transaction({
|
||||||
type: 'EXCLUSIVE'
|
type: Transaction.TYPES.EXCLUSIVE
|
||||||
}, async (transaction) => {
|
}, async (transaction) => {
|
||||||
await queryInterface.addColumn('Users', 'categoryForNotAssignedApps', {
|
await queryInterface.addColumn('Users', 'categoryForNotAssignedApps', {
|
||||||
...attributesVersion2.categoryForNotAssignedApps
|
...attributesVersion2.categoryForNotAssignedApps
|
||||||
|
@ -32,7 +32,7 @@ export async function up (queryInterface: QueryInterface, sequelize: Sequelize)
|
||||||
|
|
||||||
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||||
await sequelize.transaction({
|
await sequelize.transaction({
|
||||||
type: 'EXCLUSIVE'
|
type: Transaction.TYPES.EXCLUSIVE
|
||||||
}, async (transaction) => {
|
}, async (transaction) => {
|
||||||
await queryInterface.removeColumn('Users', 'categoryForNotAssignedApps', { transaction })
|
await queryInterface.removeColumn('Users', 'categoryForNotAssignedApps', { transaction })
|
||||||
})
|
})
|
||||||
|
|
|
@ -15,12 +15,12 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { QueryInterface, Sequelize } from 'sequelize'
|
import { QueryInterface, Sequelize, Transaction } from 'sequelize'
|
||||||
import { attributesVersion2 } from '../../category'
|
import { attributesVersion2 } from '../../category'
|
||||||
|
|
||||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||||
await sequelize.transaction({
|
await sequelize.transaction({
|
||||||
type: 'EXCLUSIVE'
|
type: Transaction.TYPES.EXCLUSIVE
|
||||||
}, async (transaction) => {
|
}, async (transaction) => {
|
||||||
await queryInterface.addColumn('Categories', 'parentCategoryId', {
|
await queryInterface.addColumn('Categories', 'parentCategoryId', {
|
||||||
...attributesVersion2.parentCategoryId
|
...attributesVersion2.parentCategoryId
|
||||||
|
@ -32,7 +32,7 @@ export async function up (queryInterface: QueryInterface, sequelize: Sequelize)
|
||||||
|
|
||||||
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||||
await sequelize.transaction({
|
await sequelize.transaction({
|
||||||
type: 'EXCLUSIVE'
|
type: Transaction.TYPES.EXCLUSIVE
|
||||||
}, async (transaction) => {
|
}, async (transaction) => {
|
||||||
await queryInterface.removeColumn('Categories', 'parentCategoryId', { transaction })
|
await queryInterface.removeColumn('Categories', 'parentCategoryId', { transaction })
|
||||||
})
|
})
|
||||||
|
|
|
@ -15,12 +15,12 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { QueryInterface, Sequelize } from 'sequelize'
|
import { QueryInterface, Sequelize, Transaction } from 'sequelize'
|
||||||
import { attributesVersion4 } from '../../device'
|
import { attributesVersion4 } from '../../device'
|
||||||
|
|
||||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||||
await sequelize.transaction({
|
await sequelize.transaction({
|
||||||
type: 'EXCLUSIVE'
|
type: Transaction.TYPES.EXCLUSIVE
|
||||||
}, async (transaction) => {
|
}, async (transaction) => {
|
||||||
await queryInterface.addColumn('Devices', 'showDeviceConnected', {
|
await queryInterface.addColumn('Devices', 'showDeviceConnected', {
|
||||||
...attributesVersion4.showDeviceConnected
|
...attributesVersion4.showDeviceConnected
|
||||||
|
@ -32,7 +32,7 @@ export async function up (queryInterface: QueryInterface, sequelize: Sequelize)
|
||||||
|
|
||||||
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||||
await sequelize.transaction({
|
await sequelize.transaction({
|
||||||
type: 'EXCLUSIVE'
|
type: Transaction.TYPES.EXCLUSIVE
|
||||||
}, async (transaction) => {
|
}, async (transaction) => {
|
||||||
await queryInterface.removeColumn('Devices', 'showDeviceConnected', { transaction })
|
await queryInterface.removeColumn('Devices', 'showDeviceConnected', { transaction })
|
||||||
})
|
})
|
||||||
|
|
|
@ -15,12 +15,12 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { QueryInterface, Sequelize } from 'sequelize'
|
import { QueryInterface, Sequelize, Transaction } from 'sequelize'
|
||||||
import { attributesVersion2 } from '../../usedtime'
|
import { attributesVersion2 } from '../../usedtime'
|
||||||
|
|
||||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||||
await sequelize.transaction({
|
await sequelize.transaction({
|
||||||
type: 'EXCLUSIVE'
|
type: Transaction.TYPES.EXCLUSIVE
|
||||||
}, async (transaction) => {
|
}, async (transaction) => {
|
||||||
await queryInterface.addColumn('UsedTimes', 'lastUpdate', {
|
await queryInterface.addColumn('UsedTimes', 'lastUpdate', {
|
||||||
...attributesVersion2.lastUpdate
|
...attributesVersion2.lastUpdate
|
||||||
|
@ -34,7 +34,7 @@ export async function up (queryInterface: QueryInterface, sequelize: Sequelize)
|
||||||
|
|
||||||
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||||
await sequelize.transaction({
|
await sequelize.transaction({
|
||||||
type: 'EXCLUSIVE'
|
type: Transaction.TYPES.EXCLUSIVE
|
||||||
}, async (transaction) => {
|
}, async (transaction) => {
|
||||||
await queryInterface.removeIndex('UsedTimes', ['lastUpdate'], { transaction })
|
await queryInterface.removeIndex('UsedTimes', ['lastUpdate'], { transaction })
|
||||||
await queryInterface.removeColumn('UsedTimes', 'lastUpdate', { transaction })
|
await queryInterface.removeColumn('UsedTimes', 'lastUpdate', { transaction })
|
||||||
|
|
|
@ -15,13 +15,13 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { QueryInterface, Sequelize } from 'sequelize'
|
import { QueryInterface, Sequelize, Transaction } from 'sequelize'
|
||||||
import { attributesVersion5 as deviceAttributes } from '../../device'
|
import { attributesVersion5 as deviceAttributes } from '../../device'
|
||||||
import { attributesVersion3 as userAttributes } from '../../user'
|
import { attributesVersion3 as userAttributes } from '../../user'
|
||||||
|
|
||||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||||
await sequelize.transaction({
|
await sequelize.transaction({
|
||||||
type: 'EXCLUSIVE'
|
type: Transaction.TYPES.EXCLUSIVE
|
||||||
}, async (transaction) => {
|
}, async (transaction) => {
|
||||||
// users
|
// users
|
||||||
await queryInterface.addColumn('Users', 'relaxPrimaryDeviceRule', {
|
await queryInterface.addColumn('Users', 'relaxPrimaryDeviceRule', {
|
||||||
|
@ -41,7 +41,7 @@ export async function up (queryInterface: QueryInterface, sequelize: Sequelize)
|
||||||
|
|
||||||
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||||
await sequelize.transaction({
|
await sequelize.transaction({
|
||||||
type: 'EXCLUSIVE'
|
type: Transaction.TYPES.EXCLUSIVE
|
||||||
}, async (transaction) => {
|
}, async (transaction) => {
|
||||||
// users
|
// users
|
||||||
await queryInterface.removeColumn('Users', 'relaxPrimaryDeviceRule', { transaction })
|
await queryInterface.removeColumn('Users', 'relaxPrimaryDeviceRule', { transaction })
|
||||||
|
|
|
@ -15,12 +15,12 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { QueryInterface, Sequelize } from 'sequelize'
|
import { QueryInterface, Sequelize, Transaction } from 'sequelize'
|
||||||
import { attributesVersion6 } from '../../device'
|
import { attributesVersion6 } from '../../device'
|
||||||
|
|
||||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||||
await sequelize.transaction({
|
await sequelize.transaction({
|
||||||
type: 'EXCLUSIVE'
|
type: Transaction.TYPES.EXCLUSIVE
|
||||||
}, async (transaction) => {
|
}, async (transaction) => {
|
||||||
await queryInterface.addColumn('Devices', 'considerRebootManipulation', {
|
await queryInterface.addColumn('Devices', 'considerRebootManipulation', {
|
||||||
...attributesVersion6.considerRebootManipulation
|
...attributesVersion6.considerRebootManipulation
|
||||||
|
@ -38,7 +38,7 @@ export async function up (queryInterface: QueryInterface, sequelize: Sequelize)
|
||||||
|
|
||||||
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||||
await sequelize.transaction({
|
await sequelize.transaction({
|
||||||
type: 'EXCLUSIVE'
|
type: Transaction.TYPES.EXCLUSIVE
|
||||||
}, async (transaction) => {
|
}, async (transaction) => {
|
||||||
await queryInterface.removeColumn('Devices', 'considerRebootManipulation', { transaction })
|
await queryInterface.removeColumn('Devices', 'considerRebootManipulation', { transaction })
|
||||||
await queryInterface.removeColumn('Devices', 'didReboot', { transaction })
|
await queryInterface.removeColumn('Devices', 'didReboot', { transaction })
|
||||||
|
|
|
@ -15,12 +15,12 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { QueryInterface, Sequelize } from 'sequelize'
|
import { QueryInterface, Sequelize, Transaction } from 'sequelize'
|
||||||
import { attributesVersion4 as userAttributes } from '../../user'
|
import { attributesVersion4 as userAttributes } from '../../user'
|
||||||
|
|
||||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||||
await sequelize.transaction({
|
await sequelize.transaction({
|
||||||
type: 'EXCLUSIVE'
|
type: Transaction.TYPES.EXCLUSIVE
|
||||||
}, async (transaction) => {
|
}, async (transaction) => {
|
||||||
await queryInterface.addColumn('Users', 'mailNotificationFlags', {
|
await queryInterface.addColumn('Users', 'mailNotificationFlags', {
|
||||||
...userAttributes.mailNotificationFlags
|
...userAttributes.mailNotificationFlags
|
||||||
|
@ -30,7 +30,7 @@ export async function up (queryInterface: QueryInterface, sequelize: Sequelize)
|
||||||
|
|
||||||
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||||
await sequelize.transaction({
|
await sequelize.transaction({
|
||||||
type: 'EXCLUSIVE'
|
type: Transaction.TYPES.EXCLUSIVE
|
||||||
}, async (transaction) => {
|
}, async (transaction) => {
|
||||||
await queryInterface.removeColumn('Users', 'mailNotificationFlags', { transaction })
|
await queryInterface.removeColumn('Users', 'mailNotificationFlags', { transaction })
|
||||||
})
|
})
|
||||||
|
|
|
@ -15,12 +15,12 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { QueryInterface, Sequelize } from 'sequelize'
|
import { QueryInterface, Sequelize, Transaction } from 'sequelize'
|
||||||
import { attributesVersion3 as categoryAttributes } from '../../category'
|
import { attributesVersion3 as categoryAttributes } from '../../category'
|
||||||
|
|
||||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||||
await sequelize.transaction({
|
await sequelize.transaction({
|
||||||
type: 'EXCLUSIVE'
|
type: Transaction.TYPES.EXCLUSIVE
|
||||||
}, async (transaction) => {
|
}, async (transaction) => {
|
||||||
await queryInterface.addColumn('Categories', 'blockAllNotifications', {
|
await queryInterface.addColumn('Categories', 'blockAllNotifications', {
|
||||||
...categoryAttributes.blockAllNotifications
|
...categoryAttributes.blockAllNotifications
|
||||||
|
@ -30,7 +30,7 @@ export async function up (queryInterface: QueryInterface, sequelize: Sequelize)
|
||||||
|
|
||||||
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||||
await sequelize.transaction({
|
await sequelize.transaction({
|
||||||
type: 'EXCLUSIVE'
|
type: Transaction.TYPES.EXCLUSIVE
|
||||||
}, async (transaction) => {
|
}, async (transaction) => {
|
||||||
await queryInterface.removeColumn('Categories', 'blockAllNotifications', { transaction })
|
await queryInterface.removeColumn('Categories', 'blockAllNotifications', { transaction })
|
||||||
})
|
})
|
||||||
|
|
|
@ -15,12 +15,12 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { QueryInterface, Sequelize } from 'sequelize'
|
import { QueryInterface, Sequelize, Transaction } from 'sequelize'
|
||||||
import { attributesVersion7 } from '../../device'
|
import { attributesVersion7 } from '../../device'
|
||||||
|
|
||||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||||
await sequelize.transaction({
|
await sequelize.transaction({
|
||||||
type: 'EXCLUSIVE'
|
type: Transaction.TYPES.EXCLUSIVE
|
||||||
}, async (transaction) => {
|
}, async (transaction) => {
|
||||||
await queryInterface.addColumn('Devices', 'currentOverlayPermission', {
|
await queryInterface.addColumn('Devices', 'currentOverlayPermission', {
|
||||||
...attributesVersion7.currentOverlayPermission
|
...attributesVersion7.currentOverlayPermission
|
||||||
|
@ -38,7 +38,7 @@ export async function up (queryInterface: QueryInterface, sequelize: Sequelize)
|
||||||
|
|
||||||
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||||
await sequelize.transaction({
|
await sequelize.transaction({
|
||||||
type: 'EXCLUSIVE'
|
type: Transaction.TYPES.EXCLUSIVE
|
||||||
}, async (transaction) => {
|
}, async (transaction) => {
|
||||||
await queryInterface.removeColumn('Devices', 'currentOverlayPermission', { transaction })
|
await queryInterface.removeColumn('Devices', 'currentOverlayPermission', { transaction })
|
||||||
await queryInterface.removeColumn('Devices', 'highestOverlayPermission', { transaction })
|
await queryInterface.removeColumn('Devices', 'highestOverlayPermission', { transaction })
|
||||||
|
|
|
@ -15,12 +15,12 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { QueryInterface, Sequelize } from 'sequelize'
|
import { QueryInterface, Sequelize, Transaction } from 'sequelize'
|
||||||
import { attributesVersion8 } from '../../device'
|
import { attributesVersion8 } from '../../device'
|
||||||
|
|
||||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||||
await sequelize.transaction({
|
await sequelize.transaction({
|
||||||
type: 'EXCLUSIVE'
|
type: Transaction.TYPES.EXCLUSIVE
|
||||||
}, async (transaction) => {
|
}, async (transaction) => {
|
||||||
await queryInterface.addColumn('Devices', 'asEnabled', {
|
await queryInterface.addColumn('Devices', 'asEnabled', {
|
||||||
...attributesVersion8.asEnabled
|
...attributesVersion8.asEnabled
|
||||||
|
@ -38,7 +38,7 @@ export async function up (queryInterface: QueryInterface, sequelize: Sequelize)
|
||||||
|
|
||||||
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||||
await sequelize.transaction({
|
await sequelize.transaction({
|
||||||
type: 'EXCLUSIVE'
|
type: Transaction.TYPES.EXCLUSIVE
|
||||||
}, async (transaction) => {
|
}, async (transaction) => {
|
||||||
await queryInterface.removeColumn('Devices', 'asEnabled', { transaction })
|
await queryInterface.removeColumn('Devices', 'asEnabled', { transaction })
|
||||||
await queryInterface.removeColumn('Devices', 'wasAsEnabled', { transaction })
|
await queryInterface.removeColumn('Devices', 'wasAsEnabled', { transaction })
|
||||||
|
|
|
@ -15,13 +15,13 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { QueryInterface, Sequelize } from 'sequelize'
|
import { QueryInterface, Sequelize, Transaction } from 'sequelize'
|
||||||
import { attributes as appActivityAttributes } from '../../appactivity'
|
import { attributes as appActivityAttributes } from '../../appactivity'
|
||||||
import { attributesVersion9 as deviceAttributes } from '../../device'
|
import { attributesVersion9 as deviceAttributes } from '../../device'
|
||||||
|
|
||||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||||
await sequelize.transaction({
|
await sequelize.transaction({
|
||||||
type: 'EXCLUSIVE'
|
type: Transaction.TYPES.EXCLUSIVE
|
||||||
}, async (transaction) => {
|
}, async (transaction) => {
|
||||||
await queryInterface.createTable('AppActivities', appActivityAttributes, { transaction })
|
await queryInterface.createTable('AppActivities', appActivityAttributes, { transaction })
|
||||||
await queryInterface.addColumn('Devices', 'activityLevelBlocking', {
|
await queryInterface.addColumn('Devices', 'activityLevelBlocking', {
|
||||||
|
@ -34,7 +34,7 @@ export async function up (queryInterface: QueryInterface, sequelize: Sequelize)
|
||||||
|
|
||||||
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||||
await sequelize.transaction({
|
await sequelize.transaction({
|
||||||
type: 'EXCLUSIVE'
|
type: Transaction.TYPES.EXCLUSIVE
|
||||||
}, async (transaction) => {
|
}, async (transaction) => {
|
||||||
await queryInterface.dropTable('AppActivities', { transaction })
|
await queryInterface.dropTable('AppActivities', { transaction })
|
||||||
await queryInterface.removeColumn('Devices', 'activityLevelBlocking', { transaction })
|
await queryInterface.removeColumn('Devices', 'activityLevelBlocking', { transaction })
|
||||||
|
|
|
@ -15,13 +15,13 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { QueryInterface, Sequelize } from 'sequelize'
|
import { QueryInterface, Sequelize, Transaction } from 'sequelize'
|
||||||
import { attributes as categoryAttributes } from '../../category'
|
import { attributes as categoryAttributes } from '../../category'
|
||||||
import { attributesVersion10 as deviceAttributes } from '../../device'
|
import { attributesVersion10 as deviceAttributes } from '../../device'
|
||||||
|
|
||||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||||
await sequelize.transaction({
|
await sequelize.transaction({
|
||||||
type: 'EXCLUSIVE'
|
type: Transaction.TYPES.EXCLUSIVE
|
||||||
}, async (transaction) => {
|
}, async (transaction) => {
|
||||||
await queryInterface.addColumn('Devices', 'isQorLater', {
|
await queryInterface.addColumn('Devices', 'isQorLater', {
|
||||||
...deviceAttributes.isQorLater
|
...deviceAttributes.isQorLater
|
||||||
|
@ -39,7 +39,7 @@ export async function up (queryInterface: QueryInterface, sequelize: Sequelize)
|
||||||
|
|
||||||
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||||
await sequelize.transaction({
|
await sequelize.transaction({
|
||||||
type: 'EXCLUSIVE'
|
type: Transaction.TYPES.EXCLUSIVE
|
||||||
}, async (transaction) => {
|
}, async (transaction) => {
|
||||||
await queryInterface.removeColumn('Devices', 'isQorLater', { transaction })
|
await queryInterface.removeColumn('Devices', 'isQorLater', { transaction })
|
||||||
await queryInterface.removeColumn('Categories', 'timeWarningFlags', { transaction })
|
await queryInterface.removeColumn('Categories', 'timeWarningFlags', { transaction })
|
||||||
|
|
|
@ -15,12 +15,12 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { QueryInterface, Sequelize } from 'sequelize'
|
import { QueryInterface, Sequelize, Transaction } from 'sequelize'
|
||||||
import { attributes as configAttributes } from '../../config'
|
import { attributes as configAttributes } from '../../config'
|
||||||
|
|
||||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||||
await sequelize.transaction({
|
await sequelize.transaction({
|
||||||
type: 'EXCLUSIVE'
|
type: Transaction.TYPES.EXCLUSIVE
|
||||||
}, async (transaction) => {
|
}, async (transaction) => {
|
||||||
await queryInterface.createTable('Configs', configAttributes, { transaction })
|
await queryInterface.createTable('Configs', configAttributes, { transaction })
|
||||||
})
|
})
|
||||||
|
@ -28,7 +28,7 @@ export async function up (queryInterface: QueryInterface, sequelize: Sequelize)
|
||||||
|
|
||||||
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||||
await sequelize.transaction({
|
await sequelize.transaction({
|
||||||
type: 'EXCLUSIVE'
|
type: Transaction.TYPES.EXCLUSIVE
|
||||||
}, async (transaction) => {
|
}, async (transaction) => {
|
||||||
await queryInterface.dropTable('Configs', { transaction })
|
await queryInterface.dropTable('Configs', { transaction })
|
||||||
})
|
})
|
||||||
|
|
|
@ -23,8 +23,10 @@ export interface OldDeviceAttributes {
|
||||||
deviceAuthToken: string
|
deviceAuthToken: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type OldDeviceInstance = Sequelize.Instance<OldDeviceAttributes> & OldDeviceAttributes
|
export type OldDeviceModel = Sequelize.Model & OldDeviceAttributes
|
||||||
export type OldDeviceModel = Sequelize.Model<OldDeviceInstance, OldDeviceAttributes>
|
export type OldDeviceModelStatic = typeof Sequelize.Model & {
|
||||||
|
new (values?: object, options?: Sequelize.BuildOptions): OldDeviceModel;
|
||||||
|
}
|
||||||
|
|
||||||
export const attributes: SequelizeAttributes<OldDeviceAttributes> = {
|
export const attributes: SequelizeAttributes<OldDeviceAttributes> = {
|
||||||
deviceAuthToken: {
|
deviceAuthToken: {
|
||||||
|
@ -33,4 +35,4 @@ export const attributes: SequelizeAttributes<OldDeviceAttributes> = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const createOldDeviceModel = (sequelize: Sequelize.Sequelize): OldDeviceModel => sequelize.define<OldDeviceInstance, OldDeviceAttributes>('OldDevice', attributes)
|
export const createOldDeviceModel = (sequelize: Sequelize.Sequelize): OldDeviceModelStatic => <OldDeviceModelStatic>sequelize.define('OldDevice', attributes)
|
||||||
|
|
|
@ -29,8 +29,10 @@ export interface PurchaseAttributes {
|
||||||
newFullVersionEndTime: string
|
newFullVersionEndTime: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type PurchaseInstance = Sequelize.Instance<PurchaseAttributes> & PurchaseAttributes
|
export type PurchaseModel = Sequelize.Model & PurchaseAttributes
|
||||||
export type PurchaseModel = Sequelize.Model<PurchaseInstance, PurchaseAttributes>
|
export type PurchaseModelStatic = typeof Sequelize.Model & {
|
||||||
|
new (values?: object, options?: Sequelize.BuildOptions): PurchaseModel;
|
||||||
|
}
|
||||||
|
|
||||||
export const attributes: SequelizeAttributes<PurchaseAttributes> = {
|
export const attributes: SequelizeAttributes<PurchaseAttributes> = {
|
||||||
familyId: { ...familyIdColumn },
|
familyId: { ...familyIdColumn },
|
||||||
|
@ -48,4 +50,4 @@ export const attributes: SequelizeAttributes<PurchaseAttributes> = {
|
||||||
newFullVersionEndTime: timestampColumn
|
newFullVersionEndTime: timestampColumn
|
||||||
}
|
}
|
||||||
|
|
||||||
export const createPurchaseModel = (sequelize: Sequelize.Sequelize): PurchaseModel => sequelize.define<PurchaseInstance, PurchaseAttributes>('Purchase', attributes)
|
export const createPurchaseModel = (sequelize: Sequelize.Sequelize): PurchaseModelStatic => <PurchaseModelStatic>sequelize.define('Purchase', attributes)
|
||||||
|
|
|
@ -28,8 +28,10 @@ export interface TimelimitRuleAttributes {
|
||||||
maximumTimeInMillis: number
|
maximumTimeInMillis: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export type TimelimitRuleInstance = Sequelize.Instance<TimelimitRuleAttributes> & TimelimitRuleAttributes
|
export type TimelimitRuleModel = Sequelize.Model & TimelimitRuleAttributes
|
||||||
export type TimelimitRuleModel = Sequelize.Model<TimelimitRuleInstance, TimelimitRuleAttributes>
|
export type TimelimitRuleModelStatic = typeof Sequelize.Model & {
|
||||||
|
new (values?: object, options?: Sequelize.BuildOptions): TimelimitRuleModel;
|
||||||
|
}
|
||||||
|
|
||||||
export const attributes: SequelizeAttributes<TimelimitRuleAttributes> = {
|
export const attributes: SequelizeAttributes<TimelimitRuleAttributes> = {
|
||||||
familyId: {
|
familyId: {
|
||||||
|
@ -59,4 +61,4 @@ export const attributes: SequelizeAttributes<TimelimitRuleAttributes> = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const createTimelimitRuleModel = (sequelize: Sequelize.Sequelize): TimelimitRuleModel => sequelize.define<TimelimitRuleInstance, TimelimitRuleAttributes>('TimelimitRule', attributes)
|
export const createTimelimitRuleModel = (sequelize: Sequelize.Sequelize): TimelimitRuleModelStatic => <TimelimitRuleModelStatic>sequelize.define('TimelimitRule', attributes)
|
||||||
|
|
|
@ -18,5 +18,5 @@
|
||||||
import * as Sequelize from 'sequelize'
|
import * as Sequelize from 'sequelize'
|
||||||
|
|
||||||
export type SequelizeAttributes<T extends { [key: string]: any }> = {
|
export type SequelizeAttributes<T extends { [key: string]: any }> = {
|
||||||
[P in keyof T]: Sequelize.DefineAttributeColumnOptions;
|
[P in keyof T]: Sequelize.ModelAttributeColumnOptions;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,8 +32,10 @@ export interface UsedTimeAttributesVersion2 {
|
||||||
|
|
||||||
export type UsedTimeAttributes = UsedTimeAttributesVersion1 & UsedTimeAttributesVersion2
|
export type UsedTimeAttributes = UsedTimeAttributesVersion1 & UsedTimeAttributesVersion2
|
||||||
|
|
||||||
export type UsedTimeInstance = Sequelize.Instance<UsedTimeAttributes> & UsedTimeAttributes
|
export type UsedTimeModel = Sequelize.Model & UsedTimeAttributes
|
||||||
export type UsedTimeModel = Sequelize.Model<UsedTimeInstance, UsedTimeAttributes>
|
export type UsedTimeModelStatic = typeof Sequelize.Model & {
|
||||||
|
new (values?: object, options?: Sequelize.BuildOptions): UsedTimeModel;
|
||||||
|
}
|
||||||
|
|
||||||
export const attributesVersion1: SequelizeAttributes<UsedTimeAttributesVersion1> = {
|
export const attributesVersion1: SequelizeAttributes<UsedTimeAttributesVersion1> = {
|
||||||
familyId: {
|
familyId: {
|
||||||
|
@ -73,4 +75,4 @@ export const attributes = {
|
||||||
...attributesVersion2
|
...attributesVersion2
|
||||||
}
|
}
|
||||||
|
|
||||||
export const createUsedTimeModel = (sequelize: Sequelize.Sequelize): UsedTimeModel => sequelize.define<UsedTimeInstance, UsedTimeAttributes>('UsedTime', attributes)
|
export const createUsedTimeModel = (sequelize: Sequelize.Sequelize): UsedTimeModelStatic => <UsedTimeModelStatic>sequelize.define('UsedTime', attributes)
|
||||||
|
|
|
@ -52,8 +52,10 @@ export interface UserAttributesVersion4 {
|
||||||
export type UserAttributes = UserAttributesVersion1 & UserAttributesVersion2 &
|
export type UserAttributes = UserAttributesVersion1 & UserAttributesVersion2 &
|
||||||
UserAttributesVersion3 & UserAttributesVersion4
|
UserAttributesVersion3 & UserAttributesVersion4
|
||||||
|
|
||||||
export type UserInstance = Sequelize.Instance<UserAttributes> & UserAttributes
|
export type UserModel = Sequelize.Model & UserAttributes
|
||||||
export type UserModel = Sequelize.Model<UserInstance, UserAttributes>
|
export type UserModelStatic = typeof Sequelize.Model & {
|
||||||
|
new (values?: object, options?: Sequelize.BuildOptions): UserModel;
|
||||||
|
}
|
||||||
|
|
||||||
export const attributesVersion1: SequelizeAttributes<UserAttributesVersion1> = {
|
export const attributesVersion1: SequelizeAttributes<UserAttributesVersion1> = {
|
||||||
familyId: {
|
familyId: {
|
||||||
|
@ -128,4 +130,4 @@ export const attributes: SequelizeAttributes<UserAttributes> = {
|
||||||
...attributesVersion4
|
...attributesVersion4
|
||||||
}
|
}
|
||||||
|
|
||||||
export const createUserModel = (sequelize: Sequelize.Sequelize): UserModel => sequelize.define<UserInstance, UserAttributes>('User', attributes)
|
export const createUserModel = (sequelize: Sequelize.Sequelize): UserModelStatic => <UserModelStatic>sequelize.define('User', attributes)
|
||||||
|
|
|
@ -23,7 +23,7 @@ export const getStatusMessage = async ({ database, transaction }: {
|
||||||
database: Database
|
database: Database
|
||||||
transaction?: Sequelize.Transaction
|
transaction?: Sequelize.Transaction
|
||||||
}) => {
|
}) => {
|
||||||
const currentStatusMessageItem = await database.config.findById(configItemIds.statusMessage, { transaction })
|
const currentStatusMessageItem = await database.config.findByPk(configItemIds.statusMessage, { transaction })
|
||||||
const currentStatusMessage = (currentStatusMessageItem ? currentStatusMessageItem.value : null) || ''
|
const currentStatusMessage = (currentStatusMessageItem ? currentStatusMessageItem.value : null) || ''
|
||||||
|
|
||||||
return currentStatusMessage
|
return currentStatusMessage
|
||||||
|
@ -40,7 +40,7 @@ export const setStatusMessage = async ({ database, newStatusMessage }: {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
await database.config.insertOrUpdate({
|
await database.config.upsert({
|
||||||
id: configItemIds.statusMessage,
|
id: configItemIds.statusMessage,
|
||||||
value: newStatusMessage
|
value: newStatusMessage
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue