Skip to content

Commit

Permalink
fix: index based sync
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelTaylor3D committed Dec 7, 2023
1 parent 3184c65 commit d2ac1a6
Show file tree
Hide file tree
Showing 6 changed files with 276 additions and 171 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
'use strict';

export default {
async up(queryInterface, Sequelize) {
await Promise.all(
['audit'].map((table) => {
queryInterface.addColumn(table, 'generation', {
type: Sequelize.INTEGER,
allowNull: true,
});
}),
);
},

async down(queryInterface) {
await Promise.all(
['audit'].map((table) => {
queryInterface.removeColumn(table, 'generation');
}),
);
},
};
5 changes: 5 additions & 0 deletions src/database/migrations/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import AddIsTransferColumn from './20220825124702-add-isTransfer-column';
import AddOrgMetadata from './20220831023546-add-org-metadata';
import OrgSyncStatus from './20231020201652-OrgSyncStatus';
import OrgSyncRemaining from './20231020214357-OrgSyncRemainingCount';
import AddGenerationIndexToAudit from './20231207142225-AddGenerationIndexToAudit';

export const migrations = [
{
Expand Down Expand Up @@ -174,4 +175,8 @@ export const migrations = [
migration: OrgSyncRemaining,
name: '20231020214357-OrgSyncRemainingCount',
},
{
migration: AddGenerationIndexToAudit,
name: '20231207142225-AddGenerationIndexToAudit',
},
];
3 changes: 3 additions & 0 deletions src/models/audit/audit.modeltypes.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,7 @@ module.exports = {
type: Sequelize.DATE,
defaultValue: Sequelize.NOW,
},
generation: {
type: Sequelize.INTEGER,
}
};
Loading

0 comments on commit d2ac1a6

Please sign in to comment.