-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Column is always integer when running npm run migrate
#2398
Column is always integer when running npm run migrate
#2398
Comments
FYI - my sample repo is here: https://github.com/dhmlau/loopback4-example-todo-customized The workaround for me is to alter the table after being created using
|
I think the PostgreSQL connector is enforcing the type of the primary key to be a number. You can see that the I think the same problem may apply to other SQL connectors too. While this behavior is intended, I can see how it can be confusing for people building LB4 applications. |
FYI, I think it should be possible to replace As I understand the differences, |
In the pull request #4270, we have run into this issue too. When running acceptance tests for
|
Notice: BUT this can be done easily with the existing functionality
With definition, LB3/4 generates uuid for you. Ref: General property properties In PostgreSQL, integer can be auto-generated even the property is not the id property (e.g |
Description / Steps to reproduce / Feature proposal
I have a model property of type
string
. After runningnpm run migrate
, the table gets created, and the type showsinteger
.Running
\d customer
on postgresql, it shows:Current Behavior
custid
is of type integer on the databaseExpected Behavior
custid
should be of typetext
instead.See Reporting Issues for more tips on writing good issues
The text was updated successfully, but these errors were encountered: