Describe the bug
id will be unconditionally added (and duplicated) in field (table column) name upon declaring it with id in name.
To Reproduce
({
Registry: {},
id: '?Identifier',
});
Actual behavior
Resulting table contains idId column:
CREATE TABLE "Table" (
"idId" bigint NULL,
...
)
...
ALTER TABLE "Table" ADD CONSTRAINT "fkTableId" FOREIGN KEY ("id") REFERENCES "Identifier" ("id");
Expected behavior
Resulting table contains name= id column.
Suggested solution
Only add id to name if it doesn't already have it. Meaning that
identifier => identifier
id => id
link => linkId
name => nameId
Additional context
Using latest impress@2.6.6 + metaschema@1.3.4
See https://github.com/metarhia/metaschema/blob/master/lib/schema.js#L287-L299
Describe the bug
idwill be unconditionally added (and duplicated) in field (table column) name upon declaring it withidin name.To Reproduce
Actual behavior
Resulting table contains
idIdcolumn:Expected behavior
Resulting table contains name=
idcolumn.Suggested solution
Only add
idto name if it doesn't already have it. Meaning thatAdditional context
Using latest
impress@2.6.6+metaschema@1.3.4See https://github.com/metarhia/metaschema/blob/master/lib/schema.js#L287-L299