Answer the question
In order to leave comments, you need to log in
Yii2 migrations to Oracle?
Migrations have strange behavior when I changed the connection from Posgresql to Oracle.
See:
class m190325_054540_add_table_news extends Migration {
public function safeUp() {
$this->createTable('news', [
'id' => Schema::TYPE_PK,
'old_id' => Schema::TYPE_INTEGER . ' NOT NULL',
'category_id' => Schema::TYPE_SMALLINT . ' NOT NULL',
'date' => Schema::TYPE_DATETIME . ' NOT NULL',
'title' => Schema::TYPE_STRING . ' NOT NULL',
'text' => Schema::TYPE_TEXT . ' NOT NULL',
'is_published' => Schema::TYPE_BOOLEAN . ' NOT NULL DEFAULT false',
'is_hot' => Schema::TYPE_BOOLEAN . ' NOT NULL DEFAULT false',
'image' => Schema::TYPE_STRING,
'lang' => Schema::TYPE_STRING,
'insert_stamp' => Schema::TYPE_DATETIME . ' NOT NULL',
'update_stamp' => Schema::TYPE_DATETIME . ' NOT NULL',
]);
$this->createIndex('ix-old-id', 'news', 'old_id', true);
$this->createIndex('ix-cat-dt-pub-l', 'news', ['category_id', 'date', 'is_published', 'lang']);
}
/**
* {@inheritdoc}
*/
public function safeDown() {
$this->dropTable('news');
}
}
Answer the question
In order to leave comments, you need to log in
in general, some kind of nonsense ... Yii makes a migration table, and the second time when you run yii migrate, it does not see it and tries to re-create it:
'ORA-00955: name is already used by an existing object
The SQL being executed was: CREATE TABLE "migration" (
"version" varchar(180) NOT NULL PRIMARY KEY,
"apply_time" NUMBER(10,0)
)'
DEFAULT ON NULL 0
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question