update new defined
All checks were successful
Deploy to Production / deploy (push) Successful in 19s
All checks were successful
Deploy to Production / deploy (push) Successful in 19s
This commit is contained in:
26
scripts/sync-gametype.js
Normal file
26
scripts/sync-gametype.js
Normal file
@@ -0,0 +1,26 @@
|
||||
const { sequelize } = require('../config/database');
|
||||
const GameType = require('../models/GameType');
|
||||
|
||||
async function syncGameType() {
|
||||
try {
|
||||
console.log('Starting GameType model synchronization...');
|
||||
|
||||
// Sync with alter: true to update existing table structure
|
||||
await GameType.sync({ alter: true });
|
||||
|
||||
console.log('✅ GameType model synchronized successfully!');
|
||||
console.log('Table structure has been updated to match the model definition.');
|
||||
|
||||
// Test query to verify
|
||||
const count = await GameType.count();
|
||||
console.log(`Current GameType records: ${count}`);
|
||||
|
||||
process.exit(0);
|
||||
} catch (error) {
|
||||
console.error('❌ Error syncing GameType model:', error.message);
|
||||
console.error(error);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
syncGameType();
|
||||
Reference in New Issue
Block a user