Jhonatan Bianchi
Jhonatan Bianchi

Reputation: 130

How can I get schema name from sequelize models?

I'm using sequelize 6.3.3 and sequelize-typescript:2.0.0-beta.0 and I'm already able to get the table name with user.constructor.tableName. How can I get the table schema? Or the table with schema already included?

Upvotes: 0

Views: 2333

Answers (2)

Kyle Felipe
Kyle Felipe

Reputation: 21

i solved this problem using this: MyModel.getTableName().schema

Upvotes: 2

Jhonatan Bianchi
Jhonatan Bianchi

Reputation: 130

For anyone looking for the solution, in sequelize 6 this is the answer user.constructor.options.schema

Upvotes: 1

Related Questions