Skip to content

Commit

Permalink
Merge pull request #5 from cycxllin/main
Browse files Browse the repository at this point in the history
Added cluster attribute...
  • Loading branch information
andrewcode-create authored Nov 8, 2024
2 parents d97a16c + eebf867 commit 01ecc5f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
8 changes: 5 additions & 3 deletions search-service/controllers/Upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const uploadSingleJson = async (jsonOld, numtoPrint = 0, printClusters = true) =

const newCluster = await Cluster.create({
coordinate: jsonOld.coordinate,
cluster: jsonOld.cluster,
gameVersion: parseInt(jsonOld["gameVersion"]),
vanilla: vanilla,
spacedOut: spacedOut,
Expand Down Expand Up @@ -162,8 +163,7 @@ const initializeDatabase = async () => {
await TotalGeyserOutput.sync({ alter: true });
*/
console.log("Initializing database...")
setAssociations()
console.log("Set associations. Syncing...")
console.log("Syncing...")
//await sequelize.sync({force:true});
await Cluster.sync({ force: true });
console.log('----------------cluster created------------');
Expand All @@ -173,8 +173,10 @@ const initializeDatabase = async () => {
console.log('----------------asteroid created------------');
await TotalGeyserOutput.sync({ force: true });
console.log('----------------TotalGeyserOutput created------------');

console.log('All tables created successfully!');
setAssociations();
console.log("Set associations.")

database_initialized = true
} catch (error) {
console.error('Error creating tables: ', error);
Expand Down
9 changes: 7 additions & 2 deletions search-service/models/Cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@ const Cluster = sequelize.define('Cluster', {
primaryKey: true,
type: DataTypes.STRING,
allowNull: false
//TODO add validation
//TODO: add validation
},

cluster: {
type: DataTypes.STRING,
allowNull: false
},

gameVersion: {
type: DataTypes.STRING,
allowNull: false
//TODO add validation
//TODO: add validation
},

vanilla: {
Expand Down

0 comments on commit 01ecc5f

Please sign in to comment.