This repository was archived by the owner on Jul 24, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathschema.rb
More file actions
45 lines (40 loc) · 1.31 KB
/
schema.rb
File metadata and controls
45 lines (40 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
ActiveRecord::Schema.define do
unless ActiveRecord::Base.connection.tables.include? 'polls'
create_table :polls do |table|
table.column :title, :string
table.column :status, :string
end
end
unless ActiveRecord::Base.connection.tables.include? 'options'
create_table :options do |table|
table.column :poll_id, :integer
table.column :title, :string
end
end
unless ActiveRecord::Base.connection.tables.include? 'votes'
create_table :votes do |table|
table.column :option_id, :integer
table.column :user_id, :integer
end
end
unless ActiveRecord::Base.connection.tables.include? 'comments'
create_table :comments do |table|
table.column :poll_id, :integer
table.column :comment, :string
end
end
unless ActiveRecord::Base.connection.tables.include? 'users'
create_table :users do |table|
table.column :session_token, :string
table.column :email, :string
table.column :nick, :string
table.column :name, :string
end
end
unless ActiveRecord::Base.connection.tables.include? 'flowdock_integrations'
create_table :flowdock_integrations do |table|
table.column :token, :string
table.column :flowdock_id, :integer
end
end
end