I have implemented model as below:
@property({
type: 'number',
name: 'isActive',
postgresql: {
columnName: 'isActive',
dataType: "bit",
nullable: "NO",
default: 1
},
})
isActive: number;
But error such as Cannot migrate database schema { error: column "isActive" is of type bit but default expression is of type integer
How to implement column have bit data type in postgresql?
Here below I leave a link that leads to the types of data related to loopback
https://npmjs.com/package/loopback-connector-postgresql#postgresql-types-to-loopback
Normally the bit type I use as a boolean, I don't know if that's your case
I don't know if this can be of help to you, anything do not hesitate to ask again
@aceraizel Has @frbuceta's solution help solve the issue? If it has, then we can close this issue. Otherwise, we can discuss further on a possible fix.
I had resolved it. Thank you so much!