1

I'm creating a test application with Yii and have created my first migration.

<?php

class m111128_223507_reverse_bed_patient extends CDbMigration
{
public function up()
{

    $this->dropForeignKey('fk_bed_patient1', 'bed');
    $this->dropColumn('bed', 'patient_id');
    $this->addColumn('patient', 'bed_id', 'int(11)');
    $this->addForeignKey('fk_patient_bed1', 'patient', 'bed_id', 'bed', 'id', 'NO ACTION', 'NO ACTION');

}

public function down()
{
    echo "m111128_223507_reverse_bed_patient does not support migration down.\n";
    return false;
}

}

for some reason Yii thinks I'm using a SQLite db even though in my app main.php I have MySQL settings which works correctly everywhere else and the SQLite lines commented out.

I'm getting this error when I try my first migrate.

* applying m111128_223507_reverse_bed_patient drop column patient_id from table bed ...exception 'CDbException' with message 'Dropping DB column is not supported by SQLite.' in ..

What am I missing here?

1 Answer 1

4

Probably your yiic tool is using console.php config file (as it is by default in Yii), try to review DB connection settings in protected/config/console.php.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.