Using Table and column naming convention (#68)

* feat(backend): using sqlstyle naming conventions

* fix: using sql conventions
This commit is contained in:
Nipe
2024-10-26 08:39:45 +07:00
committed by GitHub
parent b75a719bf0
commit 4dfcff6971
2 changed files with 33 additions and 1 deletions

View File

@@ -0,0 +1,26 @@
'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');
*/
}
};