-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
loopbackio/loopback-connector-postgresql
#404Labels
developer-experienceIssues affecting ease of use and overall experience of LB usersIssues affecting ease of use and overall experience of LB usersfeature
Description
Description / Steps to reproduce / Feature proposal
I have a model property of type string. After running npm run migrate, the table gets created, and the type shows integer.
- I'm using postgresql (not sure if it makes a difference)
- my model ts looks like:
import {Entity, model, property} from '@loopback/repository';
@model()
export class Customer extends Entity {
@property({
type: 'string',
id: true,
generated: true,
})
custid: string;
@property({
type: 'string',
required: true,
})
custname: string;
constructor(data?: Partial<Customer>) {
super(data);
}
}
Running \d customer on postgresql, it shows:
testdb=# \d customer
Table "public.customer"
Column | Type | Collation | Nullable | Default
----------+---------+-----------+----------+------------------------------------------
custid | integer | | not null | nextval('customer_custid_seq'::regclass)
custname | text | | not null |
Indexes:
"customer_pkey" PRIMARY KEY, btree (custid)
Current Behavior
custid is of type integer on the database
Expected Behavior
custid should be of type text instead.
See Reporting Issues for more tips on writing good issues
Metadata
Metadata
Assignees
Labels
developer-experienceIssues affecting ease of use and overall experience of LB usersIssues affecting ease of use and overall experience of LB usersfeature