diff --git a/Config/Migration/1769652195_add_index.php b/Config/Migration/1769652195_add_index.php new file mode 100644 index 0000000..9d89bd2 --- /dev/null +++ b/Config/Migration/1769652195_add_index.php @@ -0,0 +1,57 @@ + array( + 'create_field' => array( + 'content_comments' => array( + 'indexes' => array( + 'idx1_p_content_comments' => array('column' => array('block_key', 'plugin_key','content_key','status'), 'unique' => 0), + ), + ), + ), + ), + 'down' => array( + 'drop_field' => array( + 'content_comments' => array('indexes' => array('idx1_p_content_comments')), + ), + ), + ); + +/** + * Before migration callback + * + * @param string $direction Direction of migration process (up or down) + * @return bool Should process continue + */ + public function before($direction) { + return true; + } + +/** + * After migration callback + * + * @param string $direction Direction of migration process (up or down) + * @return bool Should process continue + */ + public function after($direction) { + return true; + } +} diff --git a/Config/Schema/schema.php b/Config/Schema/schema.php index 9f34aa1..b941ed3 100644 --- a/Config/Schema/schema.php +++ b/Config/Schema/schema.php @@ -62,7 +62,8 @@ public function after($event = array()) { 'modified' => array('type' => 'datetime', 'null' => true, 'default' => null, 'comment' => '更新日時'), 'indexes' => array( 'PRIMARY' => array('column' => 'id', 'unique' => 1), - 'block_key' => array('column' => array('block_key', 'plugin_key', 'content_key', 'created'), 'unique' => 0, 'length' => array('block_key' => '191', 'plugin_key' => '191', 'content_key' => '191')) + 'block_key' => array('column' => array('block_key', 'plugin_key', 'content_key', 'created'), 'unique' => 0, 'length' => array('block_key' => '191', 'plugin_key' => '191', 'content_key' => '191')), + 'idx1_p_content_comments' => array('column' => array('block_key', 'plugin_key', 'content_key', 'status'), 'unique' => 0) ), 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB') );