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/10 02:15:36 UTC

svn commit: r654985 - in /ode/sandbox/singleshot/db/migrate: 20080506014952_people.rb 20080506015046_tasks.rb 20080506015119_stakeholders.rb 20080506015153_events.rb

Author: assaf
Date: Fri May  9 17:15:36 2008
New Revision: 654985

URL: http://svn.apache.org/viewvc?rev=654985&view=rev
Log:
Changed to timestamped migration.

Added:
    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_events.rb

Added: ode/sandbox/singleshot/db/migrate/20080506014952_people.rb
URL: http://svn.apache.org/viewvc/ode/sandbox/singleshot/db/migrate/20080506014952_people.rb?rev=654985&view=auto
==============================================================================
--- ode/sandbox/singleshot/db/migrate/20080506014952_people.rb (added)
+++ ode/sandbox/singleshot/db/migrate/20080506014952_people.rb Fri May  9 17:15:36 2008
@@ -0,0 +1,22 @@
+class People < ActiveRecord::Migration
+  def self.up
+    create_table 'people' do |t|
+      t.string  'identity',   :null=>false
+      t.string  'fullname',   :null=>false
+      t.string  'email',      :null=>false
+      t.string  'language',   :null=>true,  :limit=>5
+      t.integer 'timezone',   :null=>true,  :limit=>4
+      t.string  'password',   :null=>true,  :limit=>64
+      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
+  end
+
+  def self.down
+    drop_table 'people'
+  end
+end

Added: ode/sandbox/singleshot/db/migrate/20080506015046_tasks.rb
URL: http://svn.apache.org/viewvc/ode/sandbox/singleshot/db/migrate/20080506015046_tasks.rb?rev=654985&view=auto
==============================================================================
--- ode/sandbox/singleshot/db/migrate/20080506015046_tasks.rb (added)
+++ ode/sandbox/singleshot/db/migrate/20080506015046_tasks.rb Fri May  9 17:15:36 2008
@@ -0,0 +1,23 @@
+class Tasks < ActiveRecord::Migration
+  def self.up
+    create_table :tasks do |t|
+      t.string    :title,        :null=>true
+      t.integer   :priority,     :null=>true, :default=>1, :limit=>1
+      t.date      :due_on,       :null=>true
+      t.integer   :status,       :null=>false, :default=>0, :limit=>2
+      t.string    :frame_url,    :null=>true
+      t.string    :outcome_url,  :null=>true
+      t.string    :outcome_type, :null=>true
+      t.integer   :cancellation, :null=>true, :limit=>1
+      t.string    :access_key,   :null=>false, :limit=>32
+      t.text      :data,         :null=>false
+      t.integer   :version,      :null=>false, :default=>0
+      t.timestamps
+    end
+    add_index :tasks, [:status, :updated_at]
+  end
+
+  def self.down
+    drop_table :tasks
+  end
+end

Added: ode/sandbox/singleshot/db/migrate/20080506015119_stakeholders.rb
URL: http://svn.apache.org/viewvc/ode/sandbox/singleshot/db/migrate/20080506015119_stakeholders.rb?rev=654985&view=auto
==============================================================================
--- ode/sandbox/singleshot/db/migrate/20080506015119_stakeholders.rb (added)
+++ ode/sandbox/singleshot/db/migrate/20080506015119_stakeholders.rb Fri May  9 17:15:36 2008
@@ -0,0 +1,17 @@
+class Stakeholders < ActiveRecord::Migration
+  def self.up
+    create_table :stakeholders do |t|
+      t.integer :task_id,    :null=>false
+      t.integer :person_id,  :null=>false
+      t.integer :role,       :null=>false, :limit=>2
+      t.timestamps
+    end
+    add_index :stakeholders, [:task_id, :person_id, :role], :unique=>true
+    add_index :stakeholders, [:task_id, :role]
+    add_index :stakeholders, [:person_id, :role]
+  end
+
+  def self.down
+    drop_table :stakeholders
+  end
+end

Added: ode/sandbox/singleshot/db/migrate/20080506015153_events.rb
URL: http://svn.apache.org/viewvc/ode/sandbox/singleshot/db/migrate/20080506015153_events.rb?rev=654985&view=auto
==============================================================================
--- ode/sandbox/singleshot/db/migrate/20080506015153_events.rb (added)
+++ ode/sandbox/singleshot/db/migrate/20080506015153_events.rb Fri May  9 17:15:36 2008
@@ -0,0 +1,14 @@
+class Events < ActiveRecord::Migration
+  def self.up
+    create_table 'events' do |t|
+      t.integer 'person_id',   :null=>false
+      t.integer 'task_id',     :null=>false
+      t.string  'action',      :null=>false
+      t.datetime 'created_at', :null=>false
+    end
+  end
+
+  def self.down
+    drop_table 'events'
+  end
+end