Files
pp-tcms/backend/migrations/20240930124156-rename_table.js
Nipe 4dfcff6971 Using Table and column naming convention (#68)
* feat(backend): using sqlstyle naming conventions

* fix: using sql conventions
2024-10-26 10:39:45 +09:00

27 lines
682 B
JavaScript

'use strict';
/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up (queryInterface, Sequelize) {
/**
* Add altering commands here.
*
* Example:
* await queryInterface.createTable('users', { id: Sequelize.INTEGER });
*/
await queryInterface.renameColumn('users', 'createdAt', 'created_at');
await queryInterface.renameColumn('users', 'updatedAt', 'updated_at');
await queryInterface.renameColumn('users', 'avatarPath', 'avatar_path');
},
async down (queryInterface, Sequelize) {
/**
* Add reverting commands here.
*
* Example:
* await queryInterface.dropTable('users');
*/
}
};