[80731] branches/gsoc11-statistics/stats-server
derek at macports.org
derek at macports.org
Sat Jul 16 08:31:11 PDT 2011
Revision: 80731
http://trac.macports.org/changeset/80731
Author: derek at macports.org
Date: 2011-07-16 08:31:09 -0700 (Sat, 16 Jul 2011)
Log Message:
-----------
installed_ports stores user_id rather than directly storing UUID
-Added migrations to remove uuid column and add user_id to installed_ports
-Updated submissions to store user_id when adding a row to installed_ports
-Updated views to show user_id
Modified Paths:
--------------
branches/gsoc11-statistics/stats-server/app/controllers/submissions_controller.rb
branches/gsoc11-statistics/stats-server/app/views/installed_ports/index.html.erb
branches/gsoc11-statistics/stats-server/app/views/installed_ports/show.html.erb
branches/gsoc11-statistics/stats-server/db/schema.rb
Added Paths:
-----------
branches/gsoc11-statistics/stats-server/db/migrate/20110716021749_add_user_id_to_installed_ports.rb
branches/gsoc11-statistics/stats-server/db/migrate/20110716021834_remove_uuid_from_installed_ports.rb
Modified: branches/gsoc11-statistics/stats-server/app/controllers/submissions_controller.rb
===================================================================
--- branches/gsoc11-statistics/stats-server/app/controllers/submissions_controller.rb 2011-07-16 15:05:53 UTC (rev 80730)
+++ branches/gsoc11-statistics/stats-server/app/controllers/submissions_controller.rb 2011-07-16 15:31:09 UTC (rev 80731)
@@ -58,10 +58,10 @@
end
end
- def add_port(uuid, macports_port, installed_port, month, year)
+ def add_port(user_id, macports_port, installed_port, month, year)
logger.debug {"Adding installed port #{installed_port['name']}"}
- portEntry = InstalledPort.new(:uuid => uuid,
+ portEntry = InstalledPort.new(:user_id => user_id,
:port_id => macports_port.id,
:version => installed_port['version'],
:variants => installed_port['variants'],
Modified: branches/gsoc11-statistics/stats-server/app/views/installed_ports/index.html.erb
===================================================================
--- branches/gsoc11-statistics/stats-server/app/views/installed_ports/index.html.erb 2011-07-16 15:05:53 UTC (rev 80730)
+++ branches/gsoc11-statistics/stats-server/app/views/installed_ports/index.html.erb 2011-07-16 15:31:09 UTC (rev 80731)
@@ -3,7 +3,7 @@
<table border=1>
<tr>
<th> ID </th>
- <th> UUID </th>
+ <th> user_id </th>
<th> Port ID </th>
<th> Version </th>
<th> Variants </th>
@@ -15,7 +15,7 @@
<% @ports.each do |row| %>
<tr>
<td> <%= row.id %> </td>
- <td> <%= row.uuid %> </td>
+ <td> <%= row.user_id %> </td>
<td> <%= row.port_id %> </td>
<td> <%= row.version %></td>
<td> <%= row.variants %> </td>
Modified: branches/gsoc11-statistics/stats-server/app/views/installed_ports/show.html.erb
===================================================================
--- branches/gsoc11-statistics/stats-server/app/views/installed_ports/show.html.erb 2011-07-16 15:05:53 UTC (rev 80730)
+++ branches/gsoc11-statistics/stats-server/app/views/installed_ports/show.html.erb 2011-07-16 15:31:09 UTC (rev 80731)
@@ -1 +1 @@
-MY STUFF :D
\ No newline at end of file
+Todo: Remove or implement
\ No newline at end of file
Added: branches/gsoc11-statistics/stats-server/db/migrate/20110716021749_add_user_id_to_installed_ports.rb
===================================================================
--- branches/gsoc11-statistics/stats-server/db/migrate/20110716021749_add_user_id_to_installed_ports.rb (rev 0)
+++ branches/gsoc11-statistics/stats-server/db/migrate/20110716021749_add_user_id_to_installed_ports.rb 2011-07-16 15:31:09 UTC (rev 80731)
@@ -0,0 +1,9 @@
+class AddUserIdToInstalledPorts < ActiveRecord::Migration
+ def self.up
+ add_column :installed_ports, :user_id, :integer
+ end
+
+ def self.down
+ remove_column :installed_ports, :user_id
+ end
+end
Added: branches/gsoc11-statistics/stats-server/db/migrate/20110716021834_remove_uuid_from_installed_ports.rb
===================================================================
--- branches/gsoc11-statistics/stats-server/db/migrate/20110716021834_remove_uuid_from_installed_ports.rb (rev 0)
+++ branches/gsoc11-statistics/stats-server/db/migrate/20110716021834_remove_uuid_from_installed_ports.rb 2011-07-16 15:31:09 UTC (rev 80731)
@@ -0,0 +1,9 @@
+class RemoveUuidFromInstalledPorts < ActiveRecord::Migration
+ def self.up
+ remove_column :installed_ports, :uuid
+ end
+
+ def self.down
+ add_column :installed_ports, :uuid, :string
+ end
+end
Modified: branches/gsoc11-statistics/stats-server/db/schema.rb
===================================================================
--- branches/gsoc11-statistics/stats-server/db/schema.rb 2011-07-16 15:05:53 UTC (rev 80730)
+++ branches/gsoc11-statistics/stats-server/db/schema.rb 2011-07-16 15:31:09 UTC (rev 80731)
@@ -10,7 +10,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20110714162815) do
+ActiveRecord::Schema.define(:version => 20110716021834) do
create_table "categories", :force => true do |t|
t.string "name"
@@ -19,7 +19,6 @@
end
create_table "installed_ports", :force => true do |t|
- t.string "uuid"
t.integer "port_id"
t.string "version"
t.text "variants"
@@ -27,6 +26,7 @@
t.string "year"
t.datetime "created_at"
t.datetime "updated_at"
+ t.integer "user_id"
end
create_table "os_statistics", :force => true do |t|
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110716/9b82b4f7/attachment.html>
More information about the macports-changes
mailing list