Skip to content

Commit

Permalink
Merge pull request #119 from balena-io-modules/remove-serial-hack
Browse files Browse the repository at this point in the history
Remove now unnecessary hack for casting SERIAL types
  • Loading branch information
bulldozer-balena[bot] authored May 3, 2021
2 parents d59de10 + 187bc07 commit e411bb6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@
"dependencies": {
"@balena/sbvr-types": "^3.4.2",
"@types/lodash": "^4.14.168",
"@types/node": "^10.17.55",
"@types/node": "^10.17.59",
"lodash": "^4.17.21"
},
"devDependencies": {
"@balena/lf-to-abstract-sql": "^4.2.1",
"@balena/lint": "^5.4.1",
"@balena/lint": "^5.4.2",
"@balena/odata-parser": "^2.2.3",
"@balena/sbvr-parser": "^1.2.2",
"@resin/odata-to-abstract-sql": "^3.3.0",
"@types/chai": "^4.2.15",
"@types/chai": "^4.2.17",
"@types/common-tags": "^1.8.0",
"@types/mocha": "^8.2.2",
"chai": "^4.3.4",
Expand All @@ -36,7 +36,7 @@
"mocha": "^8.3.2",
"require-npm4-to-publish": "^1.0.0",
"ts-node": "^9.1.1",
"typescript": "^4.2.3"
"typescript": "^4.2.4"
},
"husky": {
"hooks": {
Expand Down
4 changes: 0 additions & 4 deletions src/AbstractSQLRules2SQL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -744,10 +744,6 @@ const typeRules: Dictionary<MatchFn> = {
const dbType = sbvrTypes[typeName].types[engine];
if (typeof dbType === 'function') {
type = dbType.castType;
} else if (dbType.toUpperCase() === 'SERIAL') {
// HACK: SERIAL type in postgres is really an INTEGER with automatic sequence,
// so it's not actually possible to cast to SERIAL, instead you have to cast to INTEGER.
type = 'INTEGER';
} else {
type = dbType;
}
Expand Down

0 comments on commit e411bb6

Please sign in to comment.