Skip to content

Commit

Permalink
Add legacy model
Browse files Browse the repository at this point in the history
  • Loading branch information
manelcecs authored and Pl217 committed Mar 20, 2024
1 parent 53a68a7 commit 2c38410
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/db/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import iatiRecipientCountry from './models/iatiRecipientCountry';
import iatiTransaction from './models/iatiTransaction';
import job from './models/job';
import jobAssociation from './models/jobAssociation';
import legacy from './models/legacy';
import location from './models/location';
import lookup from './models/lookup';
import measurement from './models/measurement';
Expand Down Expand Up @@ -164,6 +165,7 @@ const initializeTables = (conn: Knex) => ({
iatiTransaction: iatiTransaction(conn),
job: job(conn),
jobAssociation: jobAssociation(conn),
legacy: legacy(conn),
location: location(conn),
lookup: lookup(conn),
measurement: measurement(conn),
Expand Down
15 changes: 15 additions & 0 deletions src/db/models/legacy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import * as t from 'io-ts';

import { defineSequelizeModel } from '../util/sequelize-model';

export default defineSequelizeModel({
tableName: 'legacy',
fields: {
required: {
objectType: { kind: 'checked', type: t.string },
objectID: { kind: 'checked', type: t.number },
legacyID: { kind: 'checked', type: t.number },
},
},
softDeletionEnabled: false,
});

0 comments on commit 2c38410

Please sign in to comment.