Compare commits

..

No commits in common. "d2893d6d2e51566793675a5b7310867d79e57ebc" and "152a2c2fd1bea37dca27b7d58db291f6264f1522" have entirely different histories.

3 changed files with 1 additions and 31 deletions

View File

@ -1,26 +0,0 @@
const { Sequelize, DataTypes } = require('sequelize');
require('./dbObjects.js');
const { sequelize, BeatenGames } = require ('./dbObjects.js');
// Add a new column to the existing table
(async () => {
try {
await sequelize.sync();
await sequelize.getQueryInterface().addColumn(
'BeatenGames',
'status',
{
type: DataTypes.ENUM('planning', 'playing', 'beat'),
allowNull: false,
defaultValue: 'beat',
},
);
console.log('New column added successfully');
} catch (error) {
console.error('Error adding new column:', error);
} finally {
sequelize.sync();
}
})();

View File

@ -44,4 +44,4 @@ sequelize.sync({ alter: true })
console.log(err); console.log(err);
}); });
module.exports = { sequelize, Users, Games, BeatenGames }; module.exports = { Users, Games, BeatenGames };

View File

@ -1,9 +1,5 @@
module.exports = (sequelize, DataTypes) => { module.exports = (sequelize, DataTypes) => {
return sequelize.define('beatenGames', { return sequelize.define('beatenGames', {
status: {
type: DataTypes.ENUM('planning', 'playing', 'beat'),
allowNull: true,
},
}, { }, {
timestamps: true, timestamps: true,
}); });