-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Description/Steps to reproduce
Hi,
Is there any way how to specify a custom column name using the @Property decorator with loopback4?
I have following property
@property({
type: 'number',
name: 'shift_id',
})
shiftId?: number;
But the mssql connector (migrate script) doesn't seem to support this (is attemping to create duplicate columns, ...).
I have wrote a little quick-fix (rewriting modelDefinition when define() is called), but that's ugly
Expected result
To migrate the schema
Actual Result
Cannot migrate database schema { RequestError: Column names in each table must be unique. Column name 'shift_id' in table 'dbo.Ntls' is specified more than once
Additional information
$ node -e 'console.log(process.platform, process.arch, process.versions.node)'
linux x64 10.16.0
$ npm ls --prod --depth 0 | grep loopback
├── @loopback/boot@1.4.2
├── @loopback/context@1.20.0
├── @loopback/core@1.8.3
├── @loopback/openapi-v3@1.6.3
├── @loopback/repository@1.8.0
├── @loopback/rest@1.16.1
├── @loopback/rest-explorer@1.2.3
├── @loopback/service-proxy@1.2.3
├── loopback-connector-mssql@3.3.0