my existing database table name "foo_bar". I generate a model "fooBar".
500 error: relation "schema.foobar" does not exist
where I can define the tablename? I does see reference on doc in lb4. please help. thanks
@rexliu0715 , you can add the settings in the model decorator.
In the example below, my model name is Customer2 but the table name is customer in my postgresql datasource.
@model({
settings: {
postgresql: {
table: 'customer',
},
},
})
export class Customer2 extends Entity {
Hope it helps. If that's the case, do you mind submitting a PR to improve our docs? Thanks!
Closing as a duplicate of #2134.
Most helpful comment
@rexliu0715 , you can add the
settingsin the model decorator.In the example below, my model name is
Customer2but the table name iscustomerin my postgresql datasource.Hope it helps. If that's the case, do you mind submitting a PR to improve our docs? Thanks!