php - database migration is not working in yii -
php - database migration is not working in yii -
in yii framework used migration ./yiic migrate create tbl_demo made migration file entered values like
<?php class m110714_094912_tbl_demo extends cdbmigration { public function up() { $this-> createtable('{{tbl_demo}}', array( 'id' => 'pk', 'name' => 'varchar \'80\' not null', )) } public function down() { echo "m110714_094912_tbl_demo not back upwards migration down.\n"; homecoming false; } /* // utilize safeup/safedown migration transaction public function safeup() { } public function safedown() { } */ }
after entering showing message
new migration created successfully.
but whenever checking mysql database there no table tbl_demo
found. set values of in safeup not made result.every thing working fine don't know why new table not creating? please help me
you should go command line , phone call yiic migrate up
, inquire if want apply tbl_demo migration , when type in "yes" execute code. message new migration created successfully.
appears when execute yiic migrate create -something-
not when apply migration.
if want apply migration again, should delete row regarding "tbl_demo" migration in "migrations" db table yiic created log migrations.
php yii database-migration
Comments
Post a Comment