2016-08-05 4 views
2

私はデータベース移行のためにPhinxを使用しています。php app-postgreSQLスキーマ用のPhinx - データベース移行が機能しません。

私のケースでは、PostgreSQLスキーマを使用したworkig(例:test.table)はありません。私はphinx migrateを打つとき

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

それはarrorの原因となります。そのための解決策はありますか?

私のエラーです:

--> IMAGE ERROR

エラーがある: "" 構文エラーまたは内

tableメソッドでは、Phinxはドット表記をサポートしていますか?

+0

エラーメッセージは何ですか? – fire

+0

ドキュメントごとにpgsqlアダプタを指定しましたか? http://docs.phinx.org/en/latest/configuration.html#supported-adapters –

+0

imgにエラー[画像エラー]を追加しました – bfcior

答えて

0

ドット表記をそのようなテーブル名で使用できますか?

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

test.table私は別の解決策を見つけたパターンdatabasename.tablename

+1

postgreSQLのドット表記は次のとおりです: 'schema.tablename' – bfcior

1

をたどります。テーブルを変更する前に、私は手動で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(); 
関連する問題