Turn hash into type

Fixes #3542
This commit is contained in:
rijkvanzanten
2021-01-12 17:03:18 -05:00
parent f00a38737b
commit 05f0bc967e
12 changed files with 51 additions and 47 deletions

View File

@@ -51,6 +51,8 @@ export default async function runSeed(database: Knex) {
column = tableBuilder.increments();
} else if (columnInfo.type === 'csv') {
column = tableBuilder.string(columnName);
} else if (columnInfo.type === 'hash') {
column = tableBuilder.string(columnName, 255);
} else {
column = tableBuilder[columnInfo.type!](columnName);
}

View File

@@ -331,6 +331,8 @@ export class FieldsService {
column = table[type](field.field, field.schema?.numeric_precision || 10, field.schema?.numeric_scale || 5);
} else if (field.type === 'csv') {
column = table.string(field.field);
} else if (field.type === 'hash') {
column = table.string(field.field, 255);
} else {
column = table[field.type](field.field);
}

View File

@@ -526,5 +526,8 @@ class OASService implements SpecificationSubService {
type: 'string',
},
},
hash: {
type: 'string',
},
};
}

View File

@@ -15,6 +15,7 @@ export const types = [
'timestamp',
'binary',
'uuid',
'hash',
'csv',
] as const;

View File

@@ -92,6 +92,7 @@ export default function getLocalType(
}
if (field?.special?.includes('json')) return 'json';
if (field?.special?.includes('hash')) return 'hash';
if (field?.special?.includes('csv')) return 'csv';
if (field?.special?.includes('uuid')) return 'uuid';