Sha256: 04a11df81c4591db31f4369776267808698fa169e7505982b617ca2815e3c0e9

Contents?: true

Size: 1.4 KB

Versions: 28

Compression:

Stored size: 1.4 KB

Contents

class CreateSocialStreamEvents < ActiveRecord::Migration
  
  def self.up

  create_table :events do |t|
    t.references :actor
    t.datetime :initDate
    t.datetime :endDate
    t.integer :founder_id
    t.timestamps
  end

  create_table :agendas do |t|
    t.references :activity_object
    t.references :event
    t.timestamps
  end

  create_table :sessions do |t|
    t.references :activity_object
    t.references :agenda
    t.datetime :initDate
    t.datetime :endDate
    t.string   :title
    t.string  :description
    t.timestamps
  end


  add_foreign_key "agendas", "activity_objects", :name => "agendas_on_activity_object_id"
  add_foreign_key "agendas", "events", :name => "agendas_on_event_id"

  add_foreign_key "events", "actors", :name => "events_on_actor_id"

  add_foreign_key "sessions", "activity_objects", :name => "sessions_on_activity_object_id"
  add_foreign_key "sessions", "agendas", :name => "sessions_on_agenda_id"
   
  end
  
  def self.down
    remove_foreign_key "agendas", :name => "agendas_on_activity_object_id"
    remove_foreign_key "agendas", :name => "agendas_on_event_id"

    remove_foreign_key "events", :name => "events_on_actor_id"

    remove_foreign_key "sessions", :name => "sessions_on_activity_object_id"
    remove_foreign_key "sessions", :name => "sessions_on_agenda_id"
   
    drop_table :sessions
    drop_table :agendas
    drop_table :events           
  end
  
end

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
social_stream-0.15.8 events/db/migrate/20110910161707_create_social_stream_events.rb
social_stream-0.15.7 events/db/migrate/20110910161707_create_social_stream_events.rb
social_stream-0.15.6 events/db/migrate/20110910161707_create_social_stream_events.rb
social_stream-0.15.5 events/db/migrate/20110910161707_create_social_stream_events.rb
social_stream-0.15.4 events/db/migrate/20110910161707_create_social_stream_events.rb
social_stream-0.15.1 events/db/migrate/20110910161707_create_social_stream_events.rb
social_stream-0.15.0 events/db/migrate/20110910161707_create_social_stream_events.rb
social_stream-events-0.2.0 db/migrate/20110910161707_create_social_stream_events.rb
social_stream-0.14.1 events/db/migrate/20110910161707_create_social_stream_events.rb
social_stream-0.14.0 events/db/migrate/20110910161707_create_social_stream_events.rb
social_stream-0.13.3 events/db/migrate/20110910161707_create_social_stream_events.rb
social_stream-0.13.2 events/db/migrate/20110910161707_create_social_stream_events.rb
social_stream-0.13.1 events/db/migrate/20110910161707_create_social_stream_events.rb
social_stream-0.13.0 events/db/migrate/20110910161707_create_social_stream_events.rb
social_stream-events-0.1.0 db/migrate/20110910161707_create_social_stream_events.rb
social_stream-0.12.14 events/db/migrate/20110910161707_create_social_stream_events.rb
social_stream-0.12.13 events/db/migrate/20110910161707_create_social_stream_events.rb
social_stream-0.12.12 events/db/migrate/20110910161707_create_social_stream_events.rb
social_stream-0.12.11 events/db/migrate/20110910161707_create_social_stream_events.rb
social_stream-0.12.10 events/db/migrate/20110910161707_create_social_stream_events.rb