Loopback-next: Bit data type in postgreSQL connector

Created on 3 Dec 2019  路  3Comments  路  Source: strongloop/loopback-next

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?

question

All 3 comments

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!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zero-bugs picture zero-bugs  路  3Comments

teambitcodeGIT picture teambitcodeGIT  路  3Comments

rexliu0715 picture rexliu0715  路  3Comments

shadyanwar picture shadyanwar  路  3Comments

half-blood-programmer picture half-blood-programmer  路  3Comments