Files
vitfit-r2/V2/app/modules/clients/migrations/011-client-workouts.js
T
2026-06-13 08:03:45 -04:00

27 lines
1.0 KiB
JavaScript

'use strict';
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.createTable('ClientWorkouts', {
id: { type: Sequelize.INTEGER, primaryKey: true, autoIncrement: true },
organizationId: { type: Sequelize.INTEGER, allowNull: false },
clientId: { type: Sequelize.INTEGER, allowNull: false },
coachId: { type: Sequelize.INTEGER, allowNull: false },
name: { type: Sequelize.STRING },
scheduledDate: { type: Sequelize.DATE },
notes: { type: Sequelize.TEXT },
items: { type: Sequelize.TEXT, defaultValue: '[]' },
completedAt: { type: Sequelize.DATE },
deletedAt: { type: Sequelize.DATE },
createdAt: { type: Sequelize.DATE, allowNull: false },
updatedAt: { type: Sequelize.DATE, allowNull: false },
});
await queryInterface.addIndex('ClientWorkouts', ['clientId', 'deletedAt', 'scheduledDate']);
},
async down(queryInterface) {
await queryInterface.dropTable('ClientWorkouts');
},
};