Using Table and column naming convention (#68)
* feat(backend): using sqlstyle naming conventions * fix: using sql conventions
This commit is contained in:
26
backend/migrations/20240930124156-rename_table.js
Normal file
26
backend/migrations/20240930124156-rename_table.js
Normal 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');
|
||||
*/
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user