【发布时间】:2017-12-18 04:55:57
【问题描述】:
我想在 PostgreSQL 的非公共架构下创建一个数据库。 在 knexjs 文档中:
knex.schema.withSchema('public').createTable('users', function (table){
table.increments();
})
我的迁移代码是:
this.withSchema('myschema').create('users', table => {
table.increments()
})
但迁移:运行返回此错误:
TypeError: this.withSchema is not a function
如何在自定义架构下创建数据库?
【问题讨论】:
-
在此处粘贴完整代码。
-
@FazalRasel:我的代码很简单,只在myschema、schema下添加一个id的表。我还在运行迁移之前创建了架构。
-
您的简单代码不起作用。要识别实际问题,需要完整的文件代码。