Project

General

Profile

Enhancement(機能追加・改善) #2078

紹介文一覧の表示を更新時間の降順に表示する

Added by Yuya Watanabe about 9 years ago. Updated over 8 years ago.

Status:
Pending Review(レビュー待ち)
Priority:
Normal(通常)
Assignee:
Start date:
2011-05-11
Due date:
% Done:

50%


Description

概要

紹介文一覧の表示を更新時間の降順に表示する.

実装案

更新時間のデータを保持し,表示時にそのデータを利用して降順に表示を行う処理を行う.

History

#1 Updated by Masato Nagasawa about 9 years ago

  • Target version changed from v0.9.2.1 to 184

#3 Updated by Masato Nagasawa about 9 years ago

  • Target version changed from 184 to v0.9.2.1

#4 Updated by Masato Nagasawa about 9 years ago

  • Status changed from New(新規) to Rejected(差し戻し)
  • % Done changed from 0 to 50

インデックス追加用のマイグレーションファイルの作成をお願いします。

#5 Updated by Masato Nagasawa about 9 years ago

  • Target version changed from v0.9.2.1 to v1.0.0

#6 Updated by Yuya Watanabe almost 9 years ago

  • Target version deleted (v1.0.0)

#7 Updated by Yuya Watanabe over 8 years ago

  • Assignee set to Yuya Watanabe

#8 Updated by Yuya Watanabe over 8 years ago

  • Status changed from Rejected(差し戻し) to Accepted(着手)

新規インストール時には下記のようなDB構造になり,下記マイグレートスクリプトによって同じ構造になることを確認しました.

DB構造

+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table        | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| intro_friend | CREATE TABLE `intro_friend` (
  `id` int(11) NOT NULL auto_increment,
  `member_id_to` int(11) NOT NULL,
  `member_id_from` int(11) NOT NULL,
  `content` text NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `created_at_idx` (`created_at`),
  KEY `member_id_from_member_id_to_idx` (`member_id_from`,`member_id_to`),
  KEY `member_id_to_updated_at_idx` (`member_id_to`,`updated_at`),
  KEY `member_id_to_idx` (`member_id_to`),
  KEY `member_id_from_idx` (`member_id_from`),
  CONSTRAINT `intro_friend_member_id_from_member_id` FOREIGN KEY (`member_id_from`) REFERENCES `member` (`id`) ON DELETE CASCADE,
  CONSTRAINT `intro_friend_member_id_to_member_id` FOREIGN KEY (`member_id_to`) REFERENCES `member` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

マイグレートスクリプト

+class Revision8_addMemberIdToUpdateAtIndex extends opMigration
+{
+  public function up()
+  {
+    $export = Doctrine_Manager::connection()->export;
+
+    $export->createIndex('intro_friend', 'member_id_to_updated_at_idx', array(
+      'fields' => array('member_id_to', 'updated_at'),
+    ));
+  }
+}

#9 Updated by Yuya Watanabe over 8 years ago

  • Status changed from Accepted(着手) to Pending Review(レビュー待ち)

Also available in: Atom PDF