* refactored the system so that it keeps pictures in a seperate table
[selectricity-live] / db / schema.rb
1 # This file is autogenerated. Instead of editing this file, please use the
2 # migrations feature of ActiveRecord to incrementally modify your database, and
3 # then regenerate this schema definition.
4
5 ActiveRecord::Schema.define() do
6
7   create_table "candidates", :force => true do |t|
8     t.column "election_id", :integer,                                :null => false
9     t.column "name",        :string,  :limit => 100, :default => "", :null => false
10     t.column "description", :text
11   end
12
13   create_table "elections", :force => true do |t|
14     t.column "name",            :string,   :limit => 100, :default => "",    :null => false
15     t.column "description",     :text,                    :default => "",    :null => false
16     t.column "anonymous",       :integer,  :limit => 4,   :default => 1,     :null => false
17     t.column "startdate",       :datetime
18     t.column "enddate",         :datetime,                                   :null => false
19     t.column "active",          :integer,  :limit => 4,   :default => 0,     :null => false
20     t.column "user_id",         :integer
21     t.column "quickuser",       :string
22     t.column "election_method", :string,   :limit => 100, :default => "ssd"
23     t.column "type",            :string,   :limit => 100, :default => "",    :null => false
24   end
25
26   add_index "elections", ["user_id"], :name => "fk_user_election"
27
28   create_table "pictures", :force => true do |t|
29     t.column "filename",     :string,  :limit => 200
30     t.column "data",         :binary
31     t.column "filetype",     :string,  :limit => 100
32     t.column "candidate_id", :integer
33   end
34
35   add_index "pictures", ["candidate_id"], :name => "fk_candidate_picture"
36
37   create_table "rankings", :force => true do |t|
38     t.column "vote_id",      :integer
39     t.column "candidate_id", :integer
40     t.column "rank",         :integer
41   end
42
43   create_table "tokens", :force => true do |t|
44     t.column "token",   :string,  :limit => 100, :default => "", :null => false
45     t.column "vote_id", :integer,                                :null => false
46   end
47
48   add_index "tokens", ["vote_id"], :name => "fk_vote_token"
49
50   create_table "users", :force => true do |t|
51     t.column "login",                     :text
52     t.column "ip",                        :text,                   :default => "", :null => false
53     t.column "email",                     :text
54     t.column "crypted_password",          :string,   :limit => 40
55     t.column "salt",                      :string,   :limit => 40
56     t.column "created_at",                :datetime
57     t.column "updated_at",                :datetime
58     t.column "remember_token",            :text
59     t.column "remember_token_expires_at", :datetime
60   end
61
62   create_table "voters", :force => true do |t|
63     t.column "email",       :string,  :limit => 100
64     t.column "password",    :string,  :limit => 100
65     t.column "contacted",   :integer, :limit => 4,   :default => 0, :null => false
66     t.column "election_id", :integer,                               :null => false
67     t.column "session_id",  :string,  :limit => 32
68     t.column "ipaddress",   :string,  :limit => 32
69   end
70
71   add_index "voters", ["election_id"], :name => "fk_election_voter"
72
73   create_table "votes", :force => true do |t|
74     t.column "voter_id",  :integer
75     t.column "confirmed", :integer,  :limit => 4, :default => 0, :null => false
76     t.column "time",      :datetime
77   end
78
79   add_index "votes", ["voter_id"], :name => "fk_vote_voter"
80
81 end

Benjamin Mako Hill || Want to submit a patch?