summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorhukl <contact@smyck.org>2009-03-16 20:58:49 +0100
committerhukl <contact@smyck.org>2009-03-18 12:16:59 +0100
commitd2bfbfd2810fbee673e43b2515db8bac527b3441 (patch)
tree1b46e8af44c871290a7a74ab17a8c7201e22f7a9 /db
parentd957a33a0d50f00c1968c5d12e728bd73ea186b3 (diff)
Refactored Chaos Calendar by wrapping libical and introducing event and occurrence model. More improvements to come. Enables us to create events with reoccurrence and intervals etc.
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20090316194152_create_events.rb21
-rw-r--r--db/migrate/20090316195143_create_occurrences.rb17
2 files changed, 38 insertions, 0 deletions
diff --git a/db/migrate/20090316194152_create_events.rb b/db/migrate/20090316194152_create_events.rb
new file mode 100644
index 0000000..7f44fdf
--- /dev/null
+++ b/db/migrate/20090316194152_create_events.rb
@@ -0,0 +1,21 @@
1class CreateEvents < ActiveRecord::Migration
2 def self.up
3 create_table :events do |t|
4 t.datetime :start_time
5 t.datetime :end_time
6 t.string :rrule
7 t.boolean :custom_rrule
8 t.boolean :allday
9 t.string :url
10 t.float :latitude
11 t.float :longitude
12 t.integer :node_id
13
14 t.timestamps
15 end
16 end
17
18 def self.down
19 drop_table :events
20 end
21end
diff --git a/db/migrate/20090316195143_create_occurrences.rb b/db/migrate/20090316195143_create_occurrences.rb
new file mode 100644
index 0000000..e0df07b
--- /dev/null
+++ b/db/migrate/20090316195143_create_occurrences.rb
@@ -0,0 +1,17 @@
1class CreateOccurrences < ActiveRecord::Migration
2 def self.up
3 create_table :occurrences do |t|
4 t.string :summary
5 t.datetime :start_time
6 t.datetime :end_time
7 t.integer :node_id
8 t.integer :event_id
9
10 t.timestamps
11 end
12 end
13
14 def self.down
15 drop_table :occurrences
16 end
17end