<?php

class m180524_124702_create_image_roi_table extends CDbMigration {

    public function up() {
        $this->execute('
            CREATE TABLE `images_roi` (
                `id` int(11) NOT NULL AUTO_INCREMENT,
                `image_id` int(11) NOT NULL,
                `roi_x` float NOT NULL,
                `roi_y` float NOT NULL,
                `roi_width` float NOT NULL,
                `roi_height` float NOT NULL,
                `action` varchar(45) NOT NULL,
                PRIMARY KEY (`id`)
              ) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8;
            ');
    }

    public function down() {
        $this->dropTable('images_roi');
    }

    /*
      // Use safeUp/safeDown to do migration with transaction
      public function safeUp()
      {
      }

      public function safeDown()
      {
      }
     */
}
