This commit is contained in:
Ccjcarkbla
2026-06-13 08:03:45 -04:00
parent cfcd6ae11e
commit a2c300678b
121 changed files with 8639 additions and 0 deletions
@@ -0,0 +1,26 @@
'use strict';
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.createTable('DeviceTokens', {
id: { type: Sequelize.INTEGER, primaryKey: true, autoIncrement: true },
userId: { type: Sequelize.INTEGER, allowNull: false },
organizationId: { type: Sequelize.INTEGER, allowNull: false },
token: { type: Sequelize.STRING, allowNull: false, unique: true },
deviceName: { type: Sequelize.STRING },
deviceType: { type: Sequelize.ENUM('kiosk', 'personal'), defaultValue: 'personal' },
lastUsedAt: { type: Sequelize.DATE },
expiresAt: { type: Sequelize.DATE, allowNull: false },
isRevoked: { type: Sequelize.BOOLEAN, defaultValue: false },
createdAt: { type: Sequelize.DATE, allowNull: false },
updatedAt: { type: Sequelize.DATE, allowNull: false },
});
await queryInterface.addIndex('DeviceTokens', ['token']);
await queryInterface.addIndex('DeviceTokens', ['userId', 'isRevoked']);
},
async down(queryInterface) {
await queryInterface.dropTable('DeviceTokens');
},
};