mergec minor changes from live
[selectricity-live] / db / schema.rb
1 # This file is auto-generated from the current state of the database. Instead of editing this file, 
2 # please use the migrations feature of Active Record to incrementally modify your database, and
3 # then regenerate this schema definition.
4 #
5 # Note that this schema.rb definition is the authoritative source for your database schema. If you need
6 # to create the application database on another system, you should be using db:schema:load, not running
7 # all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations
8 # you'll amass, the slower it'll run and the greater likelihood for issues).
9 #
10 # It's strongly recommended to check this file into your version control system.
11
12 ActiveRecord::Schema.define(:version => 3) do
13
14   create_table "candidates", :force => true do |t|
15     t.integer "election_id",                :null => false
16     t.string  "name",        :limit => 100, :null => false
17     t.text    "description"
18   end
19
20   create_table "elections", :force => true do |t|
21     t.string   "name",                :limit => 100,                    :null => false
22     t.text     "description",                                           :null => false
23     t.integer  "anonymous",           :limit => 1,   :default => 1,     :null => false
24     t.datetime "startdate"
25     t.datetime "enddate",                                               :null => false
26     t.integer  "active",              :limit => 1,   :default => 0,     :null => false
27     t.integer  "viewable",            :limit => 1,   :default => 1,     :null => false
28     t.integer  "notices",             :limit => 1,   :default => 0,     :null => false
29     t.integer  "user_id"
30     t.string   "quickuser"
31     t.string   "election_method",     :limit => 100, :default => "ssd"
32     t.string   "type",                :limit => 100,                    :null => false
33     t.boolean  "embeddable",                         :default => false, :null => false
34     t.boolean  "authenticated",                      :default => true,  :null => false
35     t.boolean  "early_results",                      :default => false, :null => false
36     t.string   "embed_custom_string"
37   end
38
39   add_index "elections", ["user_id"], :name => "fk_user_election"
40
41   create_table "pictures", :force => true do |t|
42     t.string   "filename"
43     t.string   "content_type"
44     t.integer  "size"
45     t.integer  "width"
46     t.integer  "height"
47     t.integer  "parent_id"
48     t.string   "thumbnail"
49     t.datetime "created_at"
50     t.integer  "candidate_id"
51   end
52
53   create_table "rankings", :force => true do |t|
54     t.integer "vote_id"
55     t.integer "candidate_id"
56     t.integer "rank"
57   end
58
59   create_table "sessions", :force => true do |t|
60     t.string   "sessid"
61     t.text     "data"
62     t.datetime "updated_at"
63   end
64
65   add_index "sessions", ["sessid"], :name => "session_index"
66
67   create_table "sitealizer", :force => true do |t|
68     t.string   "path"
69     t.string   "ip"
70     t.string   "referer"
71     t.string   "language"
72     t.string   "user_agent"
73     t.datetime "created_at"
74     t.date     "created_on"
75   end
76
77   create_table "skin_pictures", :force => true do |t|
78     t.string   "filename"
79     t.string   "content_type"
80     t.integer  "size"
81     t.integer  "width"
82     t.integer  "height"
83     t.datetime "created_at"
84     t.integer  "user_id"
85   end
86
87   create_table "tokens", :force => true do |t|
88     t.string  "token",   :limit => 100, :null => false
89     t.integer "vote_id",                :null => false
90   end
91
92   add_index "tokens", ["vote_id"], :name => "fk_vote_token"
93
94   create_table "users", :force => true do |t|
95     t.text     "login"
96     t.text     "ip",                                      :null => false
97     t.text     "email"
98     t.string   "crypted_password",          :limit => 40
99     t.string   "salt",                      :limit => 40
100     t.datetime "created_at"
101     t.datetime "updated_at"
102     t.text     "remember_token"
103     t.datetime "remember_token_expires_at"
104   end
105
106   create_table "voters", :force => true do |t|
107     t.string  "email",       :limit => 100
108     t.string  "password",    :limit => 100
109     t.integer "contacted",   :limit => 1,   :default => 0, :null => false
110     t.integer "election_id",                               :null => false
111     t.string  "session_id",  :limit => 32
112     t.string  "ipaddress",   :limit => 32
113     t.string  "type",        :limit => 100,                :null => false
114   end
115
116   add_index "voters", ["election_id"], :name => "fk_election_voter"
117
118   create_table "votes", :force => true do |t|
119     t.integer  "voter_id"
120     t.integer  "confirmed", :limit => 1, :default => 0, :null => false
121     t.datetime "time"
122   end
123
124   add_index "votes", ["voter_id"], :name => "fk_vote_voter"
125
126 end

Benjamin Mako Hill || Want to submit a patch?