createTable('accessory', [ 'id' => 'pk', 'id_producer' => Schema::TYPE_INTEGER.' NOT NULl', 'name' => Schema::TYPE_STRING.' NOT NULl', 'quantity' => Schema::TYPE_INTEGER ]); $this->addForeignKey('fk_accessory_id_producer', 'accessory', 'id_producer', 'producer', 'id'); } /** * {@inheritdoc} */ public function safeDown() { $this->dropTable('accessory'); $this->dropForeignKey('fk_accessory_id_producer', 'accessory'); } }