diff options
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20100606022209_create_agendas.rb | 18 | ||||
-rw-r--r-- | db/seeds.rb | 21 |
2 files changed, 39 insertions, 0 deletions
diff --git a/db/migrate/20100606022209_create_agendas.rb b/db/migrate/20100606022209_create_agendas.rb new file mode 100644 index 0000000..14a878d --- /dev/null +++ b/db/migrate/20100606022209_create_agendas.rb @@ -0,0 +1,18 @@ +class CreateAgendas < ActiveRecord::Migration + def self.up + create_table :agendas do |t| + t.string :name + t.text :description + t.datetime :start_at + t.datetime :end_at + t.datetime :created_at + t.datetime :updated_at + t.integer :owner_id + end + add_index :agendas, [:owner_id] + end + + def self.down + drop_table :agendas + end +end diff --git a/db/seeds.rb b/db/seeds.rb index 5882a4b..cd12661 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -31,3 +31,24 @@ users = User.create([ :password => 'developer', :password_confirmation => 'developer'} ]) + +puts 'adding agendas...' +agendas = Agenda.create([ + { :name => 'Go to the Zoo', + :description => 'Disneyland', + :start_at => 15.days.from_now, + :end_at => 16.days.from_now, + :owner_id => users[1].id}, + + { :name => 'hosting a party', + :description => 'HIT', + :start_at => 15.days.from_now, + :end_at => 16.days.from_now, + :owner_id => users[1].id}, + + { :name => 'agenda_test_name', + :description => 'agenda_test_description', + :start_at => 15.days.from_now, + :end_at => 16.days.from_now, + :owner_id => users[1].id} +]) |