You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by as...@apache.org on 2008/05/27 21:53:01 UTC

svn commit: r660667 - in /ode/sandbox/singleshot: app/models/ db/ db/migrate/

Author: assaf
Date: Tue May 27 12:52:57 2008
New Revision: 660667

URL: http://svn.apache.org/viewvc?rev=660667&view=rev
Log:
Changed migrations to use Create<Model> naming and belongs_to column type.

Added:
    ode/sandbox/singleshot/db/migrate/20080506014952_create_people.rb
      - copied, changed from r660666, ode/sandbox/singleshot/db/migrate/20080506014952_people.rb
    ode/sandbox/singleshot/db/migrate/20080506015046_create_tasks.rb
      - copied, changed from r660666, ode/sandbox/singleshot/db/migrate/20080506015046_tasks.rb
    ode/sandbox/singleshot/db/migrate/20080506015119_create_stakeholders.rb
      - copied, changed from r660666, ode/sandbox/singleshot/db/migrate/20080506015119_stakeholders.rb
    ode/sandbox/singleshot/db/migrate/20080506015153_create_activities.rb
Removed:
    ode/sandbox/singleshot/db/migrate/20080506014952_people.rb
    ode/sandbox/singleshot/db/migrate/20080506015046_tasks.rb
    ode/sandbox/singleshot/db/migrate/20080506015119_stakeholders.rb
    ode/sandbox/singleshot/db/migrate/20080506015153_activities.rb
Modified:
    ode/sandbox/singleshot/app/models/activity.rb
    ode/sandbox/singleshot/app/models/stakeholder.rb
    ode/sandbox/singleshot/db/schema.rb

Modified: ode/sandbox/singleshot/app/models/activity.rb
URL: http://svn.apache.org/viewvc/ode/sandbox/singleshot/app/models/activity.rb?rev=660667&r1=660666&r2=660667&view=diff
==============================================================================
--- ode/sandbox/singleshot/app/models/activity.rb (original)
+++ ode/sandbox/singleshot/app/models/activity.rb Tue May 27 12:52:57 2008
@@ -4,8 +4,8 @@
 # Table name: activities
 #
 #  id         :integer         not null, primary key
-#  person_id  :integer         not null
-#  task_id    :integer         not null
+#  person_id  :integer
+#  task_id    :integer
 #  action     :string(255)     not null
 #  created_at :datetime        not null
 #

Modified: ode/sandbox/singleshot/app/models/stakeholder.rb
URL: http://svn.apache.org/viewvc/ode/sandbox/singleshot/app/models/stakeholder.rb?rev=660667&r1=660666&r2=660667&view=diff
==============================================================================
--- ode/sandbox/singleshot/app/models/stakeholder.rb (original)
+++ ode/sandbox/singleshot/app/models/stakeholder.rb Tue May 27 12:52:57 2008
@@ -4,8 +4,8 @@
 # Table name: stakeholders
 #
 #  id         :integer         not null, primary key
-#  task_id    :integer         not null
-#  person_id  :integer         not null
+#  task_id    :integer
+#  person_id  :integer
 #  role       :string(255)     not null
 #  created_at :datetime        not null
 #

Copied: ode/sandbox/singleshot/db/migrate/20080506014952_create_people.rb (from r660666, ode/sandbox/singleshot/db/migrate/20080506014952_people.rb)
URL: http://svn.apache.org/viewvc/ode/sandbox/singleshot/db/migrate/20080506014952_create_people.rb?p2=ode/sandbox/singleshot/db/migrate/20080506014952_create_people.rb&p1=ode/sandbox/singleshot/db/migrate/20080506014952_people.rb&r1=660666&r2=660667&rev=660667&view=diff
==============================================================================
--- ode/sandbox/singleshot/db/migrate/20080506014952_people.rb (original)
+++ ode/sandbox/singleshot/db/migrate/20080506014952_create_people.rb Tue May 27 12:52:57 2008
@@ -1,4 +1,4 @@
-class People < ActiveRecord::Migration
+class CreatePeople < ActiveRecord::Migration
   def self.up
     create_table 'people' do |t|
       t.string  'identity',   :null=>false
@@ -10,10 +10,11 @@
       t.string  'access_key', :null=>false, :limit=>32
       t.timestamps
     end
+
     add_index 'people', 'identity',   :unique=>true
     add_index 'people', 'fullname'
     add_index 'people', 'email',      :unique=>true
-    add_index 'people', 'access_key', :unique=>true
+    add_index 'people', 'access_key', :unique=>true 
   end
 
   def self.down

Copied: ode/sandbox/singleshot/db/migrate/20080506015046_create_tasks.rb (from r660666, ode/sandbox/singleshot/db/migrate/20080506015046_tasks.rb)
URL: http://svn.apache.org/viewvc/ode/sandbox/singleshot/db/migrate/20080506015046_create_tasks.rb?p2=ode/sandbox/singleshot/db/migrate/20080506015046_create_tasks.rb&p1=ode/sandbox/singleshot/db/migrate/20080506015046_tasks.rb&r1=660666&r2=660667&rev=660667&view=diff
==============================================================================
--- ode/sandbox/singleshot/db/migrate/20080506015046_tasks.rb (original)
+++ ode/sandbox/singleshot/db/migrate/20080506015046_create_tasks.rb Tue May 27 12:52:57 2008
@@ -1,4 +1,4 @@
-class Tasks < ActiveRecord::Migration
+class CreateTasks < ActiveRecord::Migration
   def self.up
     create_table 'tasks' do |t|
       t.string    'title',        :null=>false

Copied: ode/sandbox/singleshot/db/migrate/20080506015119_create_stakeholders.rb (from r660666, ode/sandbox/singleshot/db/migrate/20080506015119_stakeholders.rb)
URL: http://svn.apache.org/viewvc/ode/sandbox/singleshot/db/migrate/20080506015119_create_stakeholders.rb?p2=ode/sandbox/singleshot/db/migrate/20080506015119_create_stakeholders.rb&p1=ode/sandbox/singleshot/db/migrate/20080506015119_stakeholders.rb&r1=660666&r2=660667&rev=660667&view=diff
==============================================================================
--- ode/sandbox/singleshot/db/migrate/20080506015119_stakeholders.rb (original)
+++ ode/sandbox/singleshot/db/migrate/20080506015119_create_stakeholders.rb Tue May 27 12:52:57 2008
@@ -1,8 +1,8 @@
-class Stakeholders < ActiveRecord::Migration
+class CreateStakeholders < ActiveRecord::Migration
   def self.up
     create_table 'stakeholders' do |t|
-      t.integer   'task_id',    :null=>false
-      t.integer   'person_id',  :null=>false
+      t.belongs_to 'task'
+      t.belongs_to 'person'
       t.string    'role',       :null=>false
       t.datetime  'created_at', :null=>false
     end

Added: ode/sandbox/singleshot/db/migrate/20080506015153_create_activities.rb
URL: http://svn.apache.org/viewvc/ode/sandbox/singleshot/db/migrate/20080506015153_create_activities.rb?rev=660667&view=auto
==============================================================================
--- ode/sandbox/singleshot/db/migrate/20080506015153_create_activities.rb (added)
+++ ode/sandbox/singleshot/db/migrate/20080506015153_create_activities.rb Tue May 27 12:52:57 2008
@@ -0,0 +1,14 @@
+class CreateActivities < ActiveRecord::Migration
+  def self.up
+    create_table  'activities' do |t|
+      t.belongs_to  'person'
+      t.belongs_to  'task'
+      t.string      'action',     :null=>false
+      t.datetime    'created_at', :null=>false
+    end
+  end
+
+  def self.down
+    drop_table 'activities'
+  end
+end

Modified: ode/sandbox/singleshot/db/schema.rb
URL: http://svn.apache.org/viewvc/ode/sandbox/singleshot/db/schema.rb?rev=660667&r1=660666&r2=660667&view=diff
==============================================================================
--- ode/sandbox/singleshot/db/schema.rb (original)
+++ ode/sandbox/singleshot/db/schema.rb Tue May 27 12:52:57 2008
@@ -12,8 +12,8 @@
 ActiveRecord::Schema.define(:version => 20080506015153) do
 
   create_table "activities", :force => true do |t|
-    t.integer  "person_id",  :null => false
-    t.integer  "task_id",    :null => false
+    t.integer  "person_id"
+    t.integer  "task_id"
     t.string   "action",     :null => false
     t.datetime "created_at", :null => false
   end
@@ -36,8 +36,8 @@
   add_index "people", ["identity"], :name => "index_people_on_identity", :unique => true
 
   create_table "stakeholders", :force => true do |t|
-    t.integer  "task_id",    :null => false
-    t.integer  "person_id",  :null => false
+    t.integer  "task_id"
+    t.integer  "person_id"
     t.string   "role",       :null => false
     t.datetime "created_at", :null => false
   end