Skip to content

Commit

Permalink
Pull parseDefaultValue from new location
Browse files Browse the repository at this point in the history
  • Loading branch information
rijkvanzanten committed May 17, 2021
1 parent c84c002 commit 8e8f93a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"jsonwebtoken": "^8.5.1",
"keyv": "^4.0.3",
"knex": "^0.95.3",
"knex-schema-inspector": "^1.3.0",
"knex-schema-inspector": "^1.5.2",
"liquidjs": "^9.24.1",
"lodash": "^4.17.21",
"macos-release": "^2.4.1",
Expand Down
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/schema/src/dialects/mssql.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import KnexMSSQL from 'knex-schema-inspector/dist/dialects/mssql';
import KnexMSSQL, { parseDefaultValue } from 'knex-schema-inspector/dist/dialects/mssql';
import { SchemaOverview } from '../types/overview';
import { SchemaInspector } from '../types/schema';

Expand Down Expand Up @@ -46,7 +46,7 @@ export default class MSSQL extends KnexMSSQL implements SchemaInspector {

overview[column.table_name].columns[column.column_name] = {
...column,
default_value: column.is_identity ? 'AUTO_INCREMENT' : this.parseDefaultValue(column.default_value),
default_value: column.is_identity ? 'AUTO_INCREMENT' : parseDefaultValue(column.default_value),
is_nullable: column.is_nullable === 'YES',
};
}
Expand Down
4 changes: 2 additions & 2 deletions packages/schema/src/dialects/mysql.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import KnexMySQL from 'knex-schema-inspector/dist/dialects/mysql';
import KnexMySQL, { parseDefaultValue } from 'knex-schema-inspector/dist/dialects/mysql';
import { SchemaOverview } from '../types/overview';
import { SchemaInspector } from '../types/schema';

Expand Down Expand Up @@ -39,7 +39,7 @@ export default class MySQL extends KnexMySQL implements SchemaInspector {

overview[column.table_name].columns[column.column_name] = {
...column,
default_value: column.extra === 'auto_increment' ? 'AUTO_INCREMENT' : column.default_value,
default_value: column.extra === 'auto_increment' ? 'AUTO_INCREMENT' : parseDefaultValue(column.default_value),
is_nullable: column.is_nullable === 'YES',
};
}
Expand Down
4 changes: 2 additions & 2 deletions packages/schema/src/dialects/postgres.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import KnexPostgres from 'knex-schema-inspector/dist/dialects/postgres';
import KnexPostgres, { parseDefaultValue } from 'knex-schema-inspector/dist/dialects/postgres';
import { SchemaOverview } from '../types/overview';
import { SchemaInspector } from '../types/schema';

Expand Down Expand Up @@ -68,7 +68,7 @@ export default class Postgres extends KnexPostgres implements SchemaInspector {
default_value:
column.is_identity === 'YES' || column.default_value?.startsWith('nextval(')
? 'AUTO_INCREMENT'
: this.parseDefaultValue(column.default_value),
: parseDefaultValue(column.default_value),
is_nullable: column.is_nullable === 'YES',
};
}
Expand Down

0 comments on commit 8e8f93a

Please sign in to comment.