[80845] branches/gsoc11-statistics/stats-server/db/migrate

derek at macports.org derek at macports.org
Mon Jul 18 15:41:52 PDT 2011


Revision: 80845
          http://trac.macports.org/changeset/80845
Author:   derek at macports.org
Date:     2011-07-18 15:41:52 -0700 (Mon, 18 Jul 2011)
Log Message:
-----------
Added indices to installed_ports, os_statistics and ports tables

installed_ports
-Index on port_id, user_id

os_statistics
-Index on user_id

ports
-Index on name

Added Paths:
-----------
    branches/gsoc11-statistics/stats-server/db/migrate/20110718064015_add_index_to_installed_ports.rb
    branches/gsoc11-statistics/stats-server/db/migrate/20110718064353_add_index_to_os_statistics.rb
    branches/gsoc11-statistics/stats-server/db/migrate/20110718213618_add_index_to_ports.rb

Added: branches/gsoc11-statistics/stats-server/db/migrate/20110718064015_add_index_to_installed_ports.rb
===================================================================
--- branches/gsoc11-statistics/stats-server/db/migrate/20110718064015_add_index_to_installed_ports.rb	                        (rev 0)
+++ branches/gsoc11-statistics/stats-server/db/migrate/20110718064015_add_index_to_installed_ports.rb	2011-07-18 22:41:52 UTC (rev 80845)
@@ -0,0 +1,11 @@
+class AddIndexToInstalledPorts < ActiveRecord::Migration
+  def self.up
+    add_index :installed_ports, :user_id
+    add_index :installed_ports, :port_id
+  end
+
+  def self.down
+    remove_index :installed_ports, :column => :user_id
+    remove_index :installed_ports, :column => :port_id
+  end
+end

Added: branches/gsoc11-statistics/stats-server/db/migrate/20110718064353_add_index_to_os_statistics.rb
===================================================================
--- branches/gsoc11-statistics/stats-server/db/migrate/20110718064353_add_index_to_os_statistics.rb	                        (rev 0)
+++ branches/gsoc11-statistics/stats-server/db/migrate/20110718064353_add_index_to_os_statistics.rb	2011-07-18 22:41:52 UTC (rev 80845)
@@ -0,0 +1,9 @@
+class AddIndexToOsStatistics < ActiveRecord::Migration
+  def self.up
+    add_index :os_statistics, :user_id
+  end
+
+  def self.down
+    remove_index :os_statistics, :column => :user_id
+  end
+end

Added: branches/gsoc11-statistics/stats-server/db/migrate/20110718213618_add_index_to_ports.rb
===================================================================
--- branches/gsoc11-statistics/stats-server/db/migrate/20110718213618_add_index_to_ports.rb	                        (rev 0)
+++ branches/gsoc11-statistics/stats-server/db/migrate/20110718213618_add_index_to_ports.rb	2011-07-18 22:41:52 UTC (rev 80845)
@@ -0,0 +1,9 @@
+class AddIndexToPorts < ActiveRecord::Migration
+  def self.up
+    add_index :ports, :name
+  end
+
+  def self.down
+    remove_index :ports, :column => :name
+  end
+end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110718/74051674/attachment.html>


More information about the macports-changes mailing list