Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Phinx-php应用程序的数据库迁移-postgreSQL架构不起作用_Php_Postgresql_Database Migration_Phinx - Fatal编程技术网

Phinx-php应用程序的数据库迁移-postgreSQL架构不起作用

Phinx-php应用程序的数据库迁移-postgreSQL架构不起作用,php,postgresql,database-migration,phinx,Php,Postgresql,Database Migration,Phinx,我正在使用Phinx进行数据库迁移 在我的例子中,它不使用PostgreSQL模式(示例test.table) 当我点击phinx migrate时,它会导致arror。有什么解决办法吗 我的错误是: 错误为:语法错误或在“”内 Phinx是否支持表方法中的点表示法 您确定可以在表名中使用点符号吗 // create the table $table = $this->table('test_table'); $table->addColumn('test', 'integer')

我正在使用Phinx进行数据库迁移

在我的例子中,它不使用PostgreSQL模式(示例test.table

当我点击phinx migrate时,它会导致arror。有什么解决办法吗

我的错误是:

错误为:语法错误或在“”内


Phinx是否支持
方法中的点表示法

您确定可以在表名中使用点符号吗

// create the table
$table = $this->table('test_table');
$table->addColumn('test', 'integer')
    ->create();

test.table
将遵循模式
databasename.tablename

我找到了替代解决方案。在更改表之前,我手动选择了PostgreSQL模式

// changing schema
$this->getAdapter()->setOptions(array_replace($this->getAdapter()->getOptions(), ['schema' => 'your_schema']));

// create the table
$table = $this->table('test_table');
$table->addColumn('test', 'integer')
            ->create();

错误消息是什么?您是否根据文档指定了pgsql适配器?我添加了带有错误[图像错误]的img@JeremyHarris,是的,我添加了。它适用于公共模式,其他模式不适用。在postgreSQL中,点符号如下:
schema.tablename
// changing schema
$this->getAdapter()->setOptions(array_replace($this->getAdapter()->getOptions(), ['schema' => 'your_schema']));

// create the table
$table = $this->table('test_table');
$table->addColumn('test', 'integer')
            ->create();