mirror of
https://codeberg.org/timelimit/timelimit-server.git
synced 2026-08-31 19:03:45 +02:00
Update sequelize
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* 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 appAttributes } from '../../app'
|
||||
import { attributes as authTokenAttributes } from '../../authtoken'
|
||||
@@ -30,7 +30,7 @@ import { attributesVersion1 as userAttributes } from '../../user'
|
||||
|
||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||
await sequelize.transaction({
|
||||
type: 'EXCLUSIVE'
|
||||
type: Transaction.TYPES.EXCLUSIVE
|
||||
}, async (transaction) => {
|
||||
await queryInterface.createTable('AddDeviceTokens', addDeviceTokenAttributes, { transaction })
|
||||
await queryInterface.createTable('Apps', appAttributes, { transaction })
|
||||
|
||||
+3
-3
@@ -15,13 +15,13 @@
|
||||
* 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 { attributes as oldDeviceAttributes } from '../../olddevice'
|
||||
|
||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||
await sequelize.transaction({
|
||||
type: 'EXCLUSIVE'
|
||||
type: Transaction.TYPES.EXCLUSIVE
|
||||
}, async (transaction) => {
|
||||
await queryInterface.addColumn('Devices', 'lastConnectivity', {
|
||||
...attributesVersion2.lastConnectivity
|
||||
@@ -47,7 +47,7 @@ export async function up (queryInterface: QueryInterface, sequelize: Sequelize)
|
||||
|
||||
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||
await sequelize.transaction({
|
||||
type: 'EXCLUSIVE'
|
||||
type: Transaction.TYPES.EXCLUSIVE
|
||||
}, async (transaction) => {
|
||||
await queryInterface.removeColumn('Devices', 'lastConnectivity', { transaction })
|
||||
await queryInterface.removeColumn('Devices', 'notSeenForLongTime', { transaction })
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
* 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'
|
||||
|
||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||
await sequelize.transaction({
|
||||
type: 'EXCLUSIVE'
|
||||
type: Transaction.TYPES.EXCLUSIVE
|
||||
}, async (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) {
|
||||
await sequelize.transaction({
|
||||
type: 'EXCLUSIVE'
|
||||
type: Transaction.TYPES.EXCLUSIVE
|
||||
}, async (transaction) => {
|
||||
await queryInterface.dropTable('MailLoginTokens', { transaction })
|
||||
})
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
* 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'
|
||||
|
||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||
await sequelize.transaction({
|
||||
type: 'EXCLUSIVE'
|
||||
type: Transaction.TYPES.EXCLUSIVE
|
||||
}, async (transaction) => {
|
||||
await queryInterface.addColumn('Devices', 'isUserKeptSignedIn', {
|
||||
...attributesVersion3.isUserKeptSignedIn
|
||||
@@ -32,7 +32,7 @@ export async function up (queryInterface: QueryInterface, sequelize: Sequelize)
|
||||
|
||||
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||
await sequelize.transaction({
|
||||
type: 'EXCLUSIVE'
|
||||
type: Transaction.TYPES.EXCLUSIVE
|
||||
}, async (transaction) => {
|
||||
await queryInterface.removeColumn('Devices', 'isUserKeptSignedIn', { transaction })
|
||||
})
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
* 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'
|
||||
|
||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||
await sequelize.transaction({
|
||||
type: 'EXCLUSIVE'
|
||||
type: Transaction.TYPES.EXCLUSIVE
|
||||
}, async (transaction) => {
|
||||
await queryInterface.addColumn('Users', 'categoryForNotAssignedApps', {
|
||||
...attributesVersion2.categoryForNotAssignedApps
|
||||
@@ -32,7 +32,7 @@ export async function up (queryInterface: QueryInterface, sequelize: Sequelize)
|
||||
|
||||
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||
await sequelize.transaction({
|
||||
type: 'EXCLUSIVE'
|
||||
type: Transaction.TYPES.EXCLUSIVE
|
||||
}, async (transaction) => {
|
||||
await queryInterface.removeColumn('Users', 'categoryForNotAssignedApps', { transaction })
|
||||
})
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
* 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'
|
||||
|
||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||
await sequelize.transaction({
|
||||
type: 'EXCLUSIVE'
|
||||
type: Transaction.TYPES.EXCLUSIVE
|
||||
}, async (transaction) => {
|
||||
await queryInterface.addColumn('Categories', 'parentCategoryId', {
|
||||
...attributesVersion2.parentCategoryId
|
||||
@@ -32,7 +32,7 @@ export async function up (queryInterface: QueryInterface, sequelize: Sequelize)
|
||||
|
||||
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||
await sequelize.transaction({
|
||||
type: 'EXCLUSIVE'
|
||||
type: Transaction.TYPES.EXCLUSIVE
|
||||
}, async (transaction) => {
|
||||
await queryInterface.removeColumn('Categories', 'parentCategoryId', { transaction })
|
||||
})
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
* 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'
|
||||
|
||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||
await sequelize.transaction({
|
||||
type: 'EXCLUSIVE'
|
||||
type: Transaction.TYPES.EXCLUSIVE
|
||||
}, async (transaction) => {
|
||||
await queryInterface.addColumn('Devices', 'showDeviceConnected', {
|
||||
...attributesVersion4.showDeviceConnected
|
||||
@@ -32,7 +32,7 @@ export async function up (queryInterface: QueryInterface, sequelize: Sequelize)
|
||||
|
||||
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||
await sequelize.transaction({
|
||||
type: 'EXCLUSIVE'
|
||||
type: Transaction.TYPES.EXCLUSIVE
|
||||
}, async (transaction) => {
|
||||
await queryInterface.removeColumn('Devices', 'showDeviceConnected', { transaction })
|
||||
})
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
* 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'
|
||||
|
||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||
await sequelize.transaction({
|
||||
type: 'EXCLUSIVE'
|
||||
type: Transaction.TYPES.EXCLUSIVE
|
||||
}, async (transaction) => {
|
||||
await queryInterface.addColumn('UsedTimes', 'lastUpdate', {
|
||||
...attributesVersion2.lastUpdate
|
||||
@@ -34,7 +34,7 @@ export async function up (queryInterface: QueryInterface, sequelize: Sequelize)
|
||||
|
||||
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||
await sequelize.transaction({
|
||||
type: 'EXCLUSIVE'
|
||||
type: Transaction.TYPES.EXCLUSIVE
|
||||
}, async (transaction) => {
|
||||
await queryInterface.removeIndex('UsedTimes', ['lastUpdate'], { transaction })
|
||||
await queryInterface.removeColumn('UsedTimes', 'lastUpdate', { transaction })
|
||||
|
||||
+3
-3
@@ -15,13 +15,13 @@
|
||||
* 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 { attributesVersion3 as userAttributes } from '../../user'
|
||||
|
||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||
await sequelize.transaction({
|
||||
type: 'EXCLUSIVE'
|
||||
type: Transaction.TYPES.EXCLUSIVE
|
||||
}, async (transaction) => {
|
||||
// users
|
||||
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) {
|
||||
await sequelize.transaction({
|
||||
type: 'EXCLUSIVE'
|
||||
type: Transaction.TYPES.EXCLUSIVE
|
||||
}, async (transaction) => {
|
||||
// users
|
||||
await queryInterface.removeColumn('Users', 'relaxPrimaryDeviceRule', { transaction })
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
* 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'
|
||||
|
||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||
await sequelize.transaction({
|
||||
type: 'EXCLUSIVE'
|
||||
type: Transaction.TYPES.EXCLUSIVE
|
||||
}, async (transaction) => {
|
||||
await queryInterface.addColumn('Devices', 'considerRebootManipulation', {
|
||||
...attributesVersion6.considerRebootManipulation
|
||||
@@ -38,7 +38,7 @@ export async function up (queryInterface: QueryInterface, sequelize: Sequelize)
|
||||
|
||||
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||
await sequelize.transaction({
|
||||
type: 'EXCLUSIVE'
|
||||
type: Transaction.TYPES.EXCLUSIVE
|
||||
}, async (transaction) => {
|
||||
await queryInterface.removeColumn('Devices', 'considerRebootManipulation', { transaction })
|
||||
await queryInterface.removeColumn('Devices', 'didReboot', { transaction })
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
* 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'
|
||||
|
||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||
await sequelize.transaction({
|
||||
type: 'EXCLUSIVE'
|
||||
type: Transaction.TYPES.EXCLUSIVE
|
||||
}, async (transaction) => {
|
||||
await queryInterface.addColumn('Users', 'mailNotificationFlags', {
|
||||
...userAttributes.mailNotificationFlags
|
||||
@@ -30,7 +30,7 @@ export async function up (queryInterface: QueryInterface, sequelize: Sequelize)
|
||||
|
||||
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||
await sequelize.transaction({
|
||||
type: 'EXCLUSIVE'
|
||||
type: Transaction.TYPES.EXCLUSIVE
|
||||
}, async (transaction) => {
|
||||
await queryInterface.removeColumn('Users', 'mailNotificationFlags', { transaction })
|
||||
})
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
* 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'
|
||||
|
||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||
await sequelize.transaction({
|
||||
type: 'EXCLUSIVE'
|
||||
type: Transaction.TYPES.EXCLUSIVE
|
||||
}, async (transaction) => {
|
||||
await queryInterface.addColumn('Categories', 'blockAllNotifications', {
|
||||
...categoryAttributes.blockAllNotifications
|
||||
@@ -30,7 +30,7 @@ export async function up (queryInterface: QueryInterface, sequelize: Sequelize)
|
||||
|
||||
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||
await sequelize.transaction({
|
||||
type: 'EXCLUSIVE'
|
||||
type: Transaction.TYPES.EXCLUSIVE
|
||||
}, async (transaction) => {
|
||||
await queryInterface.removeColumn('Categories', 'blockAllNotifications', { transaction })
|
||||
})
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
* 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'
|
||||
|
||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||
await sequelize.transaction({
|
||||
type: 'EXCLUSIVE'
|
||||
type: Transaction.TYPES.EXCLUSIVE
|
||||
}, async (transaction) => {
|
||||
await queryInterface.addColumn('Devices', 'currentOverlayPermission', {
|
||||
...attributesVersion7.currentOverlayPermission
|
||||
@@ -38,7 +38,7 @@ export async function up (queryInterface: QueryInterface, sequelize: Sequelize)
|
||||
|
||||
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||
await sequelize.transaction({
|
||||
type: 'EXCLUSIVE'
|
||||
type: Transaction.TYPES.EXCLUSIVE
|
||||
}, async (transaction) => {
|
||||
await queryInterface.removeColumn('Devices', 'currentOverlayPermission', { transaction })
|
||||
await queryInterface.removeColumn('Devices', 'highestOverlayPermission', { transaction })
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
* 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'
|
||||
|
||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||
await sequelize.transaction({
|
||||
type: 'EXCLUSIVE'
|
||||
type: Transaction.TYPES.EXCLUSIVE
|
||||
}, async (transaction) => {
|
||||
await queryInterface.addColumn('Devices', 'asEnabled', {
|
||||
...attributesVersion8.asEnabled
|
||||
@@ -38,7 +38,7 @@ export async function up (queryInterface: QueryInterface, sequelize: Sequelize)
|
||||
|
||||
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||
await sequelize.transaction({
|
||||
type: 'EXCLUSIVE'
|
||||
type: Transaction.TYPES.EXCLUSIVE
|
||||
}, async (transaction) => {
|
||||
await queryInterface.removeColumn('Devices', 'asEnabled', { transaction })
|
||||
await queryInterface.removeColumn('Devices', 'wasAsEnabled', { transaction })
|
||||
|
||||
@@ -15,13 +15,13 @@
|
||||
* 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 { attributesVersion9 as deviceAttributes } from '../../device'
|
||||
|
||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||
await sequelize.transaction({
|
||||
type: 'EXCLUSIVE'
|
||||
type: Transaction.TYPES.EXCLUSIVE
|
||||
}, async (transaction) => {
|
||||
await queryInterface.createTable('AppActivities', appActivityAttributes, { transaction })
|
||||
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) {
|
||||
await sequelize.transaction({
|
||||
type: 'EXCLUSIVE'
|
||||
type: Transaction.TYPES.EXCLUSIVE
|
||||
}, async (transaction) => {
|
||||
await queryInterface.dropTable('AppActivities', { transaction })
|
||||
await queryInterface.removeColumn('Devices', 'activityLevelBlocking', { transaction })
|
||||
|
||||
@@ -15,13 +15,13 @@
|
||||
* 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 { attributesVersion10 as deviceAttributes } from '../../device'
|
||||
|
||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||
await sequelize.transaction({
|
||||
type: 'EXCLUSIVE'
|
||||
type: Transaction.TYPES.EXCLUSIVE
|
||||
}, async (transaction) => {
|
||||
await queryInterface.addColumn('Devices', 'isQorLater', {
|
||||
...deviceAttributes.isQorLater
|
||||
@@ -39,7 +39,7 @@ export async function up (queryInterface: QueryInterface, sequelize: Sequelize)
|
||||
|
||||
export async function down (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||
await sequelize.transaction({
|
||||
type: 'EXCLUSIVE'
|
||||
type: Transaction.TYPES.EXCLUSIVE
|
||||
}, async (transaction) => {
|
||||
await queryInterface.removeColumn('Devices', 'isQorLater', { transaction })
|
||||
await queryInterface.removeColumn('Categories', 'timeWarningFlags', { transaction })
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
* 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'
|
||||
|
||||
export async function up (queryInterface: QueryInterface, sequelize: Sequelize) {
|
||||
await sequelize.transaction({
|
||||
type: 'EXCLUSIVE'
|
||||
type: Transaction.TYPES.EXCLUSIVE
|
||||
}, async (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) {
|
||||
await sequelize.transaction({
|
||||
type: 'EXCLUSIVE'
|
||||
type: Transaction.TYPES.EXCLUSIVE
|
||||
}, async (transaction) => {
|
||||
await queryInterface.dropTable('Configs', { transaction })
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user