diff --git a/db/migrations/legacy/20240127115605_create-crm-entity.js b/db/migrations/legacy/20240127115605_create-crm-entity.js index 9ce9a4c645..6d49f1564e 100644 --- a/db/migrations/legacy/20240127115605_create-crm-entity.js +++ b/db/migrations/legacy/20240127115605_create-crm-entity.js @@ -8,7 +8,7 @@ exports.up = function (knex) { .withSchema('crm') .createTable(tableName, (table) => { // Primary Key - table.uuid('entity_id').primary().defaultTo(knex.raw('gen_random_uuid()')) + table.string('entity_id').primary() // Data table.string('entity_nm').notNullable() diff --git a/test/models/licence-entity.model.test.js b/test/models/licence-entity.model.test.js index 4b26e43e71..0a259e8b4c 100644 --- a/test/models/licence-entity.model.test.js +++ b/test/models/licence-entity.model.test.js @@ -14,7 +14,7 @@ const LicenceEntityHelper = require('../support/helpers/licence-entity.helper.js // Thing under test const LicenceEntityModel = require('../../app/models/licence-entity.model.js') -describe('Licence Role model', () => { +describe('Licence Entity model', () => { let testRecord beforeEach(async () => { diff --git a/test/support/helpers/licence-entity.helper.js b/test/support/helpers/licence-entity.helper.js index 18901ab060..99356f4ca4 100644 --- a/test/support/helpers/licence-entity.helper.js +++ b/test/support/helpers/licence-entity.helper.js @@ -4,6 +4,7 @@ * @module LicenceEntityHelper */ +const { generateUUID } = require('../../../app/lib/general.lib.js') const LicenceEntityModel = require('../../../app/models/licence-entity.model.js') /** @@ -11,6 +12,7 @@ const LicenceEntityModel = require('../../../app/models/licence-entity.model.js' * * If no `data` is provided, default values will be used. These are * + * - `id` - [random UUID] * - `name` - Grace Hopper * - `type` - individual * @@ -36,6 +38,7 @@ async function add (data = {}) { */ function defaults (data = {}) { const defaults = { + id: generateUUID(), name: 'Grace Hopper', type: 'Licence Holder' }