27 lines
1.0 KiB
JavaScript
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');
|
|
},
|
|
};
|