From bb21f0f10d028f33c5a729d7e4eb206a53dd6e92 Mon Sep 17 00:00:00 2001 From: John Craft Date: Thu, 14 Nov 2024 20:22:01 -0800 Subject: [PATCH] Fix table name capitalization --- .../20241115024643-modify_dob_type_in_users.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/users-api/src/migrations/20241115024643-modify_dob_type_in_users.js b/users-api/src/migrations/20241115024643-modify_dob_type_in_users.js index f6f87b9..7756da8 100644 --- a/users-api/src/migrations/20241115024643-modify_dob_type_in_users.js +++ b/users-api/src/migrations/20241115024643-modify_dob_type_in_users.js @@ -4,25 +4,25 @@ module.exports = { async up (queryInterface, Sequelize) { // Add a temporary column - await queryInterface.addColumn('Users', 'dob_temp', { + await queryInterface.addColumn('users', 'dob_temp', { type: Sequelize.DATEONLY, }); // Convert and move the data from 'dob' to 'dob_temp' await queryInterface.sequelize.query(` - UPDATE "Users" + UPDATE "users" SET "dob_temp" = "dob"::DATE `); // Remove the old 'dob' column - await queryInterface.removeColumn('Users', 'dob'); + await queryInterface.removeColumn('users', 'dob'); // Rename the 'dob_temp' column to 'dob' - await queryInterface.renameColumn('Users', 'dob_temp', 'dob'); + await queryInterface.renameColumn('users', 'dob_temp', 'dob'); }, async down (queryInterface, Sequelize) { - await queryInterface.changeColumn('Users', 'dob', { + await queryInterface.changeColumn('users', 'dob', { type: Sequelize.STRING, allowNull: true });