i have migration:
function up:
$this->createtable( 'vacancy_moderate', array( 'id' => 'int(10) unsigned not null auto_increment', 'period_days' => 'tinyint(4) not null', 'title' => 'varchar(255) not null default \'\'', 'price'=> 'int(11) default null', 'requirements'=> 'text not null', 'conditions'=> 'text', 'contact_details'=> 'text not null', 'country_id'=> 'int(10) unsigned not null', 'city_id'=> 'int(10) unsigned default null', 'user_id'=> 'int(10) unsigned default null', 'club_id'=> 'int(10) default null', 'primary key (`id`)', 'key `city_id` (`city_id`)', 'key `user_id` (`user_id`)', 'key `country_id` (`country_id`)', 'key `club_id` (`club_id`)', 'constraint `vacancy_moderate_ibfk_1` foreign key (`city_id`) references `city` (`id`) on update cascade', 'constraint `vacancy_moderate_ibfk_2` foreign key (`user_id`) references `user` (`id`) on delete set null on update cascade', 'constraint `vacancy_moderate_ibfk_3` foreign key (`country_id`) references `country` (`id`) on update cascade', 'constraint `vacancy_moderate_ibfk_4` foreign key (`club_id`) references `clubs` (`id`) on update cascade' ), 'engine=innodb default charset=utf8' );
function down:
$this->droptable('vacancy_moderate');
question: should drop foreign keys manually or dropped within droptable?
they'll drop table, going away. :-)
Comments
Post a Comment