Commit 947bf54cb6e95d74b36909aaf927289912a9c1ae

Authored by Antonio Terceiro
1 parent 4511d505

db/schema.rb: update to Rails 4 conventions

It uses more modern Ruby syntax, but it's mostly the same thing.
Showing 1 changed file with 287 additions and 284 deletions   Show diff stats
@@ -9,11 +9,14 @@ @@ -9,11 +9,14 @@
9 # from scratch. The latter is a flawed and unsustainable approach (the more migrations 9 # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10 # you'll amass, the slower it'll run and the greater likelihood for issues). 10 # you'll amass, the slower it'll run and the greater likelihood for issues).
11 # 11 #
12 -# It's strongly recommended to check this file into your version control system. 12 +# It's strongly recommended that you check this file into your version control system.
13 13
14 -ActiveRecord::Schema.define(:version => 20150722042714) do 14 +ActiveRecord::Schema.define(version: 20150722042714) do
15 15
16 - create_table "abuse_reports", :force => true do |t| 16 + # These are extensions that must be enabled in order to support this database
  17 + enable_extension "plpgsql"
  18 +
  19 + create_table "abuse_reports", force: :cascade do |t|
17 t.integer "reporter_id" 20 t.integer "reporter_id"
18 t.integer "abuse_complaint_id" 21 t.integer "abuse_complaint_id"
19 t.text "content" 22 t.text "content"
@@ -22,7 +25,7 @@ ActiveRecord::Schema.define(:version => 20150722042714) do @@ -22,7 +25,7 @@ ActiveRecord::Schema.define(:version => 20150722042714) do
22 t.datetime "updated_at" 25 t.datetime "updated_at"
23 end 26 end
24 27
25 - create_table "action_tracker", :force => true do |t| 28 + create_table "action_tracker", force: :cascade do |t|
26 t.integer "user_id" 29 t.integer "user_id"
27 t.string "user_type" 30 t.string "user_type"
28 t.integer "target_id" 31 t.integer "target_id"
@@ -31,34 +34,34 @@ ActiveRecord::Schema.define(:version => 20150722042714) do @@ -31,34 +34,34 @@ ActiveRecord::Schema.define(:version => 20150722042714) do
31 t.string "verb" 34 t.string "verb"
32 t.datetime "created_at" 35 t.datetime "created_at"
33 t.datetime "updated_at" 36 t.datetime "updated_at"
34 - t.integer "comments_count", :default => 0  
35 - t.boolean "visible", :default => true 37 + t.integer "comments_count", default: 0
  38 + t.boolean "visible", default: true
36 end 39 end
37 40
38 - add_index "action_tracker", ["target_id", "target_type"], :name => "index_action_tracker_on_dispatcher_id_and_dispatcher_type"  
39 - add_index "action_tracker", ["user_id", "user_type"], :name => "index_action_tracker_on_user_id_and_user_type"  
40 - add_index "action_tracker", ["verb"], :name => "index_action_tracker_on_verb" 41 + add_index "action_tracker", ["target_id", "target_type"], name: "index_action_tracker_on_dispatcher_id_and_dispatcher_type", using: :btree
  42 + add_index "action_tracker", ["user_id", "user_type"], name: "index_action_tracker_on_user_id_and_user_type", using: :btree
  43 + add_index "action_tracker", ["verb"], name: "index_action_tracker_on_verb", using: :btree
41 44
42 - create_table "action_tracker_notifications", :force => true do |t| 45 + create_table "action_tracker_notifications", force: :cascade do |t|
43 t.integer "action_tracker_id" 46 t.integer "action_tracker_id"
44 t.integer "profile_id" 47 t.integer "profile_id"
45 end 48 end
46 49
47 - add_index "action_tracker_notifications", ["action_tracker_id"], :name => "index_action_tracker_notifications_on_action_tracker_id"  
48 - add_index "action_tracker_notifications", ["profile_id", "action_tracker_id"], :name => "index_action_tracker_notif_on_prof_id_act_tracker_id", :unique => true  
49 - add_index "action_tracker_notifications", ["profile_id"], :name => "index_action_tracker_notifications_on_profile_id" 50 + add_index "action_tracker_notifications", ["action_tracker_id"], name: "index_action_tracker_notifications_on_action_tracker_id", using: :btree
  51 + add_index "action_tracker_notifications", ["profile_id", "action_tracker_id"], name: "index_action_tracker_notif_on_prof_id_act_tracker_id", unique: true, using: :btree
  52 + add_index "action_tracker_notifications", ["profile_id"], name: "index_action_tracker_notifications_on_profile_id", using: :btree
50 53
51 - create_table "article_privacy_exceptions", :id => false, :force => true do |t| 54 + create_table "article_privacy_exceptions", id: false, force: :cascade do |t|
52 t.integer "article_id" 55 t.integer "article_id"
53 t.integer "person_id" 56 t.integer "person_id"
54 end 57 end
55 58
56 - create_table "article_versions", :force => true do |t| 59 + create_table "article_versions", force: :cascade do |t|
57 t.integer "article_id" 60 t.integer "article_id"
58 t.integer "version" 61 t.integer "version"
59 t.string "name" 62 t.string "name"
60 t.string "slug" 63 t.string "slug"
61 - t.text "path", :default => "" 64 + t.text "path", default: ""
62 t.integer "parent_id" 65 t.integer "parent_id"
63 t.text "body" 66 t.text "body"
64 t.text "abstract" 67 t.text "abstract"
@@ -73,43 +76,43 @@ ActiveRecord::Schema.define(:version => 20150722042714) do @@ -73,43 +76,43 @@ ActiveRecord::Schema.define(:version => 20150722042714) do
73 t.integer "width" 76 t.integer "width"
74 t.string "versioned_type" 77 t.string "versioned_type"
75 t.integer "comments_count" 78 t.integer "comments_count"
76 - t.boolean "advertise", :default => true  
77 - t.boolean "published", :default => true 79 + t.boolean "advertise", default: true
  80 + t.boolean "published", default: true
78 t.datetime "start_date" 81 t.datetime "start_date"
79 t.datetime "end_date" 82 t.datetime "end_date"
80 - t.integer "children_count", :default => 0  
81 - t.boolean "accept_comments", :default => true 83 + t.integer "children_count", default: 0
  84 + t.boolean "accept_comments", default: true
82 t.integer "reference_article_id" 85 t.integer "reference_article_id"
83 t.text "setting" 86 t.text "setting"
84 - t.boolean "notify_comments", :default => false  
85 - t.integer "hits", :default => 0 87 + t.boolean "notify_comments", default: false
  88 + t.integer "hits", default: 0
86 t.datetime "published_at" 89 t.datetime "published_at"
87 t.string "source" 90 t.string "source"
88 - t.boolean "highlighted", :default => false 91 + t.boolean "highlighted", default: false
89 t.string "external_link" 92 t.string "external_link"
90 - t.boolean "thumbnails_processed", :default => false  
91 - t.boolean "is_image", :default => false 93 + t.boolean "thumbnails_processed", default: false
  94 + t.boolean "is_image", default: false
92 t.integer "translation_of_id" 95 t.integer "translation_of_id"
93 t.string "language" 96 t.string "language"
94 t.string "source_name" 97 t.string "source_name"
95 t.integer "license_id" 98 t.integer "license_id"
96 t.integer "image_id" 99 t.integer "image_id"
97 t.integer "position" 100 t.integer "position"
98 - t.integer "spam_comments_count", :default => 0 101 + t.integer "spam_comments_count", default: 0
99 t.integer "author_id" 102 t.integer "author_id"
100 t.integer "created_by_id" 103 t.integer "created_by_id"
101 end 104 end
102 105
103 - add_index "article_versions", ["article_id"], :name => "index_article_versions_on_article_id"  
104 - add_index "article_versions", ["parent_id"], :name => "index_article_versions_on_parent_id"  
105 - add_index "article_versions", ["path", "profile_id"], :name => "index_article_versions_on_path_and_profile_id"  
106 - add_index "article_versions", ["path"], :name => "index_article_versions_on_path"  
107 - add_index "article_versions", ["published_at", "id"], :name => "index_article_versions_on_published_at_and_id" 106 + add_index "article_versions", ["article_id"], name: "index_article_versions_on_article_id", using: :btree
  107 + add_index "article_versions", ["parent_id"], name: "index_article_versions_on_parent_id", using: :btree
  108 + add_index "article_versions", ["path", "profile_id"], name: "index_article_versions_on_path_and_profile_id", using: :btree
  109 + add_index "article_versions", ["path"], name: "index_article_versions_on_path", using: :btree
  110 + add_index "article_versions", ["published_at", "id"], name: "index_article_versions_on_published_at_and_id", using: :btree
108 111
109 - create_table "articles", :force => true do |t| 112 + create_table "articles", force: :cascade do |t|
110 t.string "name" 113 t.string "name"
111 t.string "slug" 114 t.string "slug"
112 - t.text "path", :default => "" 115 + t.text "path", default: ""
113 t.integer "parent_id" 116 t.integer "parent_id"
114 t.text "body" 117 t.text "body"
115 t.text "abstract" 118 t.text "abstract"
@@ -124,119 +127,119 @@ ActiveRecord::Schema.define(:version => 20150722042714) do @@ -124,119 +127,119 @@ ActiveRecord::Schema.define(:version => 20150722042714) do
124 t.string "filename" 127 t.string "filename"
125 t.integer "height" 128 t.integer "height"
126 t.integer "width" 129 t.integer "width"
127 - t.integer "comments_count", :default => 0  
128 - t.boolean "advertise", :default => true  
129 - t.boolean "published", :default => true 130 + t.integer "comments_count", default: 0
  131 + t.boolean "advertise", default: true
  132 + t.boolean "published", default: true
130 t.datetime "start_date" 133 t.datetime "start_date"
131 t.datetime "end_date" 134 t.datetime "end_date"
132 - t.integer "children_count", :default => 0  
133 - t.boolean "accept_comments", :default => true 135 + t.integer "children_count", default: 0
  136 + t.boolean "accept_comments", default: true
134 t.integer "reference_article_id" 137 t.integer "reference_article_id"
135 t.text "setting" 138 t.text "setting"
136 - t.boolean "notify_comments", :default => true  
137 - t.integer "hits", :default => 0 139 + t.boolean "notify_comments", default: true
  140 + t.integer "hits", default: 0
138 t.datetime "published_at" 141 t.datetime "published_at"
139 t.string "source" 142 t.string "source"
140 - t.boolean "highlighted", :default => false 143 + t.boolean "highlighted", default: false
141 t.string "external_link" 144 t.string "external_link"
142 - t.boolean "thumbnails_processed", :default => false  
143 - t.boolean "is_image", :default => false 145 + t.boolean "thumbnails_processed", default: false
  146 + t.boolean "is_image", default: false
144 t.integer "translation_of_id" 147 t.integer "translation_of_id"
145 t.string "language" 148 t.string "language"
146 t.string "source_name" 149 t.string "source_name"
147 t.integer "license_id" 150 t.integer "license_id"
148 t.integer "image_id" 151 t.integer "image_id"
149 t.integer "position" 152 t.integer "position"
150 - t.integer "spam_comments_count", :default => 0 153 + t.integer "spam_comments_count", default: 0
151 t.integer "author_id" 154 t.integer "author_id"
152 t.integer "created_by_id" 155 t.integer "created_by_id"
153 - t.boolean "show_to_followers", :default => true  
154 - end  
155 -  
156 - add_index "articles", ["comments_count"], :name => "index_articles_on_comments_count"  
157 - add_index "articles", ["created_at"], :name => "index_articles_on_created_at"  
158 - add_index "articles", ["hits"], :name => "index_articles_on_hits"  
159 - add_index "articles", ["name"], :name => "index_articles_on_name"  
160 - add_index "articles", ["parent_id"], :name => "index_articles_on_parent_id"  
161 - add_index "articles", ["path", "profile_id"], :name => "index_articles_on_path_and_profile_id"  
162 - add_index "articles", ["path"], :name => "index_articles_on_path"  
163 - add_index "articles", ["profile_id"], :name => "index_articles_on_profile_id"  
164 - add_index "articles", ["published_at", "id"], :name => "index_articles_on_published_at_and_id"  
165 - add_index "articles", ["slug"], :name => "index_articles_on_slug"  
166 - add_index "articles", ["translation_of_id"], :name => "index_articles_on_translation_of_id"  
167 - add_index "articles", ["type", "parent_id"], :name => "index_articles_on_type_and_parent_id"  
168 - add_index "articles", ["type", "profile_id"], :name => "index_articles_on_type_and_profile_id"  
169 - add_index "articles", ["type"], :name => "index_articles_on_type"  
170 -  
171 - create_table "articles_categories", :id => false, :force => true do |t| 156 + t.boolean "show_to_followers", default: true
  157 + end
  158 +
  159 + add_index "articles", ["comments_count"], name: "index_articles_on_comments_count", using: :btree
  160 + add_index "articles", ["created_at"], name: "index_articles_on_created_at", using: :btree
  161 + add_index "articles", ["hits"], name: "index_articles_on_hits", using: :btree
  162 + add_index "articles", ["name"], name: "index_articles_on_name", using: :btree
  163 + add_index "articles", ["parent_id"], name: "index_articles_on_parent_id", using: :btree
  164 + add_index "articles", ["path", "profile_id"], name: "index_articles_on_path_and_profile_id", using: :btree
  165 + add_index "articles", ["path"], name: "index_articles_on_path", using: :btree
  166 + add_index "articles", ["profile_id"], name: "index_articles_on_profile_id", using: :btree
  167 + add_index "articles", ["published_at", "id"], name: "index_articles_on_published_at_and_id", using: :btree
  168 + add_index "articles", ["slug"], name: "index_articles_on_slug", using: :btree
  169 + add_index "articles", ["translation_of_id"], name: "index_articles_on_translation_of_id", using: :btree
  170 + add_index "articles", ["type", "parent_id"], name: "index_articles_on_type_and_parent_id", using: :btree
  171 + add_index "articles", ["type", "profile_id"], name: "index_articles_on_type_and_profile_id", using: :btree
  172 + add_index "articles", ["type"], name: "index_articles_on_type", using: :btree
  173 +
  174 + create_table "articles_categories", id: false, force: :cascade do |t|
172 t.integer "article_id" 175 t.integer "article_id"
173 t.integer "category_id" 176 t.integer "category_id"
174 - t.boolean "virtual", :default => false 177 + t.boolean "virtual", default: false
175 end 178 end
176 179
177 - add_index "articles_categories", ["article_id"], :name => "index_articles_categories_on_article_id"  
178 - add_index "articles_categories", ["category_id"], :name => "index_articles_categories_on_category_id" 180 + add_index "articles_categories", ["article_id"], name: "index_articles_categories_on_article_id", using: :btree
  181 + add_index "articles_categories", ["category_id"], name: "index_articles_categories_on_category_id", using: :btree
179 182
180 - create_table "blocks", :force => true do |t| 183 + create_table "blocks", force: :cascade do |t|
181 t.string "title" 184 t.string "title"
182 t.integer "box_id" 185 t.integer "box_id"
183 t.string "type" 186 t.string "type"
184 t.text "settings" 187 t.text "settings"
185 t.integer "position" 188 t.integer "position"
186 - t.boolean "enabled", :default => true 189 + t.boolean "enabled", default: true
187 t.datetime "created_at" 190 t.datetime "created_at"
188 t.datetime "updated_at" 191 t.datetime "updated_at"
189 t.datetime "fetched_at" 192 t.datetime "fetched_at"
190 - t.boolean "mirror", :default => false 193 + t.boolean "mirror", default: false
191 t.integer "mirror_block_id" 194 t.integer "mirror_block_id"
192 t.integer "observers_id" 195 t.integer "observers_id"
193 end 196 end
194 197
195 - add_index "blocks", ["box_id"], :name => "index_blocks_on_box_id"  
196 - add_index "blocks", ["enabled"], :name => "index_blocks_on_enabled"  
197 - add_index "blocks", ["fetched_at"], :name => "index_blocks_on_fetched_at"  
198 - add_index "blocks", ["type"], :name => "index_blocks_on_type" 198 + add_index "blocks", ["box_id"], name: "index_blocks_on_box_id", using: :btree
  199 + add_index "blocks", ["enabled"], name: "index_blocks_on_enabled", using: :btree
  200 + add_index "blocks", ["fetched_at"], name: "index_blocks_on_fetched_at", using: :btree
  201 + add_index "blocks", ["type"], name: "index_blocks_on_type", using: :btree
199 202
200 - create_table "boxes", :force => true do |t| 203 + create_table "boxes", force: :cascade do |t|
201 t.string "owner_type" 204 t.string "owner_type"
202 t.integer "owner_id" 205 t.integer "owner_id"
203 t.integer "position" 206 t.integer "position"
204 end 207 end
205 208
206 - add_index "boxes", ["owner_id", "owner_type"], :name => "index_boxes_on_owner_type_and_owner_id" 209 + add_index "boxes", ["owner_id", "owner_type"], name: "index_boxes_on_owner_type_and_owner_id", using: :btree
207 210
208 - create_table "categories", :force => true do |t| 211 + create_table "categories", force: :cascade do |t|
209 t.string "name" 212 t.string "name"
210 t.string "slug" 213 t.string "slug"
211 - t.text "path", :default => "" 214 + t.text "path", default: ""
212 t.integer "environment_id" 215 t.integer "environment_id"
213 t.integer "parent_id" 216 t.integer "parent_id"
214 t.string "type" 217 t.string "type"
215 t.float "lat" 218 t.float "lat"
216 t.float "lng" 219 t.float "lng"
217 - t.boolean "display_in_menu", :default => false  
218 - t.integer "children_count", :default => 0  
219 - t.boolean "accept_products", :default => true 220 + t.boolean "display_in_menu", default: false
  221 + t.integer "children_count", default: 0
  222 + t.boolean "accept_products", default: true
220 t.integer "image_id" 223 t.integer "image_id"
221 t.string "acronym" 224 t.string "acronym"
222 t.string "abbreviation" 225 t.string "abbreviation"
223 - t.string "display_color", :limit => 6 226 + t.string "display_color", limit: 6
224 t.text "ancestry" 227 t.text "ancestry"
225 end 228 end
226 229
227 - add_index "categories", ["parent_id"], :name => "index_categories_on_parent_id" 230 + add_index "categories", ["parent_id"], name: "index_categories_on_parent_id", using: :btree
228 231
229 - create_table "categories_profiles", :id => false, :force => true do |t| 232 + create_table "categories_profiles", id: false, force: :cascade do |t|
230 t.integer "profile_id" 233 t.integer "profile_id"
231 t.integer "category_id" 234 t.integer "category_id"
232 - t.boolean "virtual", :default => false 235 + t.boolean "virtual", default: false
233 end 236 end
234 237
235 - add_index "categories_profiles", ["category_id"], :name => "index_categories_profiles_on_category_id"  
236 - add_index "categories_profiles", ["profile_id"], :name => "index_categories_profiles_on_profile_id" 238 + add_index "categories_profiles", ["category_id"], name: "index_categories_profiles_on_category_id", using: :btree
  239 + add_index "categories_profiles", ["profile_id"], name: "index_categories_profiles_on_profile_id", using: :btree
237 240
238 - create_table "certifiers", :force => true do |t|  
239 - t.string "name", :null => false 241 + create_table "certifiers", force: :cascade do |t|
  242 + t.string "name", null: false
240 t.text "description" 243 t.text "description"
241 t.string "link" 244 t.string "link"
242 t.integer "environment_id" 245 t.integer "environment_id"
@@ -244,19 +247,19 @@ ActiveRecord::Schema.define(:version => 20150722042714) do @@ -244,19 +247,19 @@ ActiveRecord::Schema.define(:version => 20150722042714) do
244 t.datetime "updated_at" 247 t.datetime "updated_at"
245 end 248 end
246 249
247 - create_table "chat_messages", :force => true do |t|  
248 - t.integer "from_id", :null => false  
249 - t.integer "to_id", :null => false 250 + create_table "chat_messages", force: :cascade do |t|
  251 + t.integer "from_id", null: false
  252 + t.integer "to_id", null: false
250 t.text "body" 253 t.text "body"
251 - t.datetime "created_at", :null => false  
252 - t.datetime "updated_at", :null => false 254 + t.datetime "created_at", null: false
  255 + t.datetime "updated_at", null: false
253 end 256 end
254 257
255 - add_index "chat_messages", ["created_at"], :name => "index_chat_messages_on_created_at"  
256 - add_index "chat_messages", ["from_id"], :name => "index_chat_messages_on_from_id"  
257 - add_index "chat_messages", ["to_id"], :name => "index_chat_messages_on_to_id" 258 + add_index "chat_messages", ["created_at"], name: "index_chat_messages_on_created_at", using: :btree
  259 + add_index "chat_messages", ["from_id"], name: "index_chat_messages_on_from_id", using: :btree
  260 + add_index "chat_messages", ["to_id"], name: "index_chat_messages_on_to_id", using: :btree
258 261
259 - create_table "comments", :force => true do |t| 262 + create_table "comments", force: :cascade do |t|
260 t.string "title" 263 t.string "title"
261 t.text "body" 264 t.text "body"
262 t.integer "source_id" 265 t.integer "source_id"
@@ -273,19 +276,19 @@ ActiveRecord::Schema.define(:version => 20150722042714) do @@ -273,19 +276,19 @@ ActiveRecord::Schema.define(:version => 20150722042714) do
273 t.text "settings" 276 t.text "settings"
274 end 277 end
275 278
276 - add_index "comments", ["source_id", "spam"], :name => "index_comments_on_source_id_and_spam" 279 + add_index "comments", ["source_id", "spam"], name: "index_comments_on_source_id_and_spam", using: :btree
277 280
278 - create_table "contact_lists", :force => true do |t| 281 + create_table "contact_lists", force: :cascade do |t|
279 t.text "list" 282 t.text "list"
280 t.string "error_fetching" 283 t.string "error_fetching"
281 - t.boolean "fetched", :default => false 284 + t.boolean "fetched", default: false
282 t.datetime "created_at" 285 t.datetime "created_at"
283 t.datetime "updated_at" 286 t.datetime "updated_at"
284 end 287 end
285 288
286 - create_table "delayed_jobs", :force => true do |t|  
287 - t.integer "priority", :default => 0  
288 - t.integer "attempts", :default => 0 289 + create_table "delayed_jobs", force: :cascade do |t|
  290 + t.integer "priority", default: 0
  291 + t.integer "attempts", default: 0
289 t.text "handler" 292 t.text "handler"
290 t.text "last_error" 293 t.text "last_error"
291 t.datetime "run_at" 294 t.datetime "run_at"
@@ -297,22 +300,22 @@ ActiveRecord::Schema.define(:version => 20150722042714) do @@ -297,22 +300,22 @@ ActiveRecord::Schema.define(:version => 20150722042714) do
297 t.string "queue" 300 t.string "queue"
298 end 301 end
299 302
300 - add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" 303 + add_index "delayed_jobs", ["priority", "run_at"], name: "delayed_jobs_priority", using: :btree
301 304
302 - create_table "domains", :force => true do |t| 305 + create_table "domains", force: :cascade do |t|
303 t.string "name" 306 t.string "name"
304 t.string "owner_type" 307 t.string "owner_type"
305 t.integer "owner_id" 308 t.integer "owner_id"
306 - t.boolean "is_default", :default => false 309 + t.boolean "is_default", default: false
307 t.string "google_maps_key" 310 t.string "google_maps_key"
308 end 311 end
309 312
310 - add_index "domains", ["is_default"], :name => "index_domains_on_is_default"  
311 - add_index "domains", ["name"], :name => "index_domains_on_name"  
312 - add_index "domains", ["owner_id", "owner_type", "is_default"], :name => "index_domains_on_owner_id_and_owner_type_and_is_default"  
313 - add_index "domains", ["owner_id", "owner_type"], :name => "index_domains_on_owner_id_and_owner_type" 313 + add_index "domains", ["is_default"], name: "index_domains_on_is_default", using: :btree
  314 + add_index "domains", ["name"], name: "index_domains_on_name", using: :btree
  315 + add_index "domains", ["owner_id", "owner_type", "is_default"], name: "index_domains_on_owner_id_and_owner_type_and_is_default", using: :btree
  316 + add_index "domains", ["owner_id", "owner_type"], name: "index_domains_on_owner_id_and_owner_type", using: :btree
314 317
315 - create_table "environments", :force => true do |t| 318 + create_table "environments", force: :cascade do |t|
316 t.string "name" 319 t.string "name"
317 t.string "contact_email" 320 t.string "contact_email"
318 t.boolean "is_default" 321 t.boolean "is_default"
@@ -320,60 +323,60 @@ ActiveRecord::Schema.define(:version => 20150722042714) do @@ -320,60 +323,60 @@ ActiveRecord::Schema.define(:version => 20150722042714) do
320 t.text "design_data" 323 t.text "design_data"
321 t.text "custom_header" 324 t.text "custom_header"
322 t.text "custom_footer" 325 t.text "custom_footer"
323 - t.string "theme", :default => "default", :null => false 326 + t.string "theme", default: "default", null: false
324 t.text "terms_of_use_acceptance_text" 327 t.text "terms_of_use_acceptance_text"
325 t.datetime "created_at" 328 t.datetime "created_at"
326 t.datetime "updated_at" 329 t.datetime "updated_at"
327 - t.integer "reports_lower_bound", :default => 0, :null => false  
328 - t.string "redirection_after_login", :default => "keep_on_same_page" 330 + t.integer "reports_lower_bound", default: 0, null: false
  331 + t.string "redirection_after_login", default: "keep_on_same_page"
329 t.text "signup_welcome_text" 332 t.text "signup_welcome_text"
330 t.string "languages" 333 t.string "languages"
331 t.string "default_language" 334 t.string "default_language"
332 t.string "noreply_email" 335 t.string "noreply_email"
333 - t.string "redirection_after_signup", :default => "keep_on_same_page"  
334 - t.string "date_format", :default => "month_name_with_year" 336 + t.string "redirection_after_signup", default: "keep_on_same_page"
  337 + t.string "date_format", default: "month_name_with_year"
335 end 338 end
336 339
337 - create_table "external_feeds", :force => true do |t| 340 + create_table "external_feeds", force: :cascade do |t|
338 t.string "feed_title" 341 t.string "feed_title"
339 t.datetime "fetched_at" 342 t.datetime "fetched_at"
340 t.text "address" 343 t.text "address"
341 - t.integer "blog_id", :null => false  
342 - t.boolean "enabled", :default => true, :null => false  
343 - t.boolean "only_once", :default => true, :null => false 344 + t.integer "blog_id", null: false
  345 + t.boolean "enabled", default: true, null: false
  346 + t.boolean "only_once", default: true, null: false
344 t.datetime "created_at" 347 t.datetime "created_at"
345 t.datetime "updated_at" 348 t.datetime "updated_at"
346 t.text "error_message" 349 t.text "error_message"
347 - t.integer "update_errors", :default => 0 350 + t.integer "update_errors", default: 0
348 end 351 end
349 352
350 - add_index "external_feeds", ["blog_id"], :name => "index_external_feeds_on_blog_id"  
351 - add_index "external_feeds", ["enabled"], :name => "index_external_feeds_on_enabled"  
352 - add_index "external_feeds", ["fetched_at"], :name => "index_external_feeds_on_fetched_at" 353 + add_index "external_feeds", ["blog_id"], name: "index_external_feeds_on_blog_id", using: :btree
  354 + add_index "external_feeds", ["enabled"], name: "index_external_feeds_on_enabled", using: :btree
  355 + add_index "external_feeds", ["fetched_at"], name: "index_external_feeds_on_fetched_at", using: :btree
353 356
354 - create_table "favorite_enterprise_people", :force => true do |t| 357 + create_table "favorite_enterprise_people", force: :cascade do |t|
355 t.integer "person_id" 358 t.integer "person_id"
356 t.integer "enterprise_id" 359 t.integer "enterprise_id"
357 t.datetime "created_at" 360 t.datetime "created_at"
358 t.datetime "updated_at" 361 t.datetime "updated_at"
359 end 362 end
360 363
361 - add_index "favorite_enterprise_people", ["enterprise_id"], :name => "index_favorite_enterprise_people_on_enterprise_id"  
362 - add_index "favorite_enterprise_people", ["person_id", "enterprise_id"], :name => "index_favorite_enterprise_people_on_person_id_and_enterprise_id"  
363 - add_index "favorite_enterprise_people", ["person_id"], :name => "index_favorite_enterprise_people_on_person_id" 364 + add_index "favorite_enterprise_people", ["enterprise_id"], name: "index_favorite_enterprise_people_on_enterprise_id", using: :btree
  365 + add_index "favorite_enterprise_people", ["person_id", "enterprise_id"], name: "index_favorite_enterprise_people_on_person_id_and_enterprise_id", using: :btree
  366 + add_index "favorite_enterprise_people", ["person_id"], name: "index_favorite_enterprise_people_on_person_id", using: :btree
364 367
365 - create_table "friendships", :force => true do |t| 368 + create_table "friendships", force: :cascade do |t|
366 t.integer "person_id" 369 t.integer "person_id"
367 t.integer "friend_id" 370 t.integer "friend_id"
368 t.datetime "created_at" 371 t.datetime "created_at"
369 t.string "group" 372 t.string "group"
370 end 373 end
371 374
372 - add_index "friendships", ["friend_id"], :name => "index_friendships_on_friend_id"  
373 - add_index "friendships", ["person_id", "friend_id"], :name => "index_friendships_on_person_id_and_friend_id"  
374 - add_index "friendships", ["person_id"], :name => "index_friendships_on_person_id" 375 + add_index "friendships", ["friend_id"], name: "index_friendships_on_friend_id", using: :btree
  376 + add_index "friendships", ["person_id", "friend_id"], name: "index_friendships_on_person_id_and_friend_id", using: :btree
  377 + add_index "friendships", ["person_id"], name: "index_friendships_on_person_id", using: :btree
375 378
376 - create_table "images", :force => true do |t| 379 + create_table "images", force: :cascade do |t|
377 t.integer "parent_id" 380 t.integer "parent_id"
378 t.string "content_type" 381 t.string "content_type"
379 t.string "filename" 382 t.string "filename"
@@ -381,43 +384,43 @@ ActiveRecord::Schema.define(:version => 20150722042714) do @@ -381,43 +384,43 @@ ActiveRecord::Schema.define(:version => 20150722042714) do
381 t.integer "size" 384 t.integer "size"
382 t.integer "width" 385 t.integer "width"
383 t.integer "height" 386 t.integer "height"
384 - t.boolean "thumbnails_processed", :default => false  
385 - t.string "label", :default => "" 387 + t.boolean "thumbnails_processed", default: false
  388 + t.string "label", default: ""
386 end 389 end
387 390
388 - add_index "images", ["parent_id"], :name => "index_images_on_parent_id" 391 + add_index "images", ["parent_id"], name: "index_images_on_parent_id", using: :btree
389 392
390 - create_table "inputs", :force => true do |t|  
391 - t.integer "product_id", :null => false  
392 - t.integer "product_category_id", :null => false 393 + create_table "inputs", force: :cascade do |t|
  394 + t.integer "product_id", null: false
  395 + t.integer "product_category_id", null: false
393 t.datetime "created_at" 396 t.datetime "created_at"
394 t.datetime "updated_at" 397 t.datetime "updated_at"
395 t.integer "position" 398 t.integer "position"
396 t.decimal "price_per_unit" 399 t.decimal "price_per_unit"
397 t.decimal "amount_used" 400 t.decimal "amount_used"
398 - t.boolean "relevant_to_price", :default => true  
399 - t.boolean "is_from_solidarity_economy", :default => false 401 + t.boolean "relevant_to_price", default: true
  402 + t.boolean "is_from_solidarity_economy", default: false
400 t.integer "unit_id" 403 t.integer "unit_id"
401 end 404 end
402 405
403 - add_index "inputs", ["product_category_id"], :name => "index_inputs_on_product_category_id"  
404 - add_index "inputs", ["product_id"], :name => "index_inputs_on_product_id" 406 + add_index "inputs", ["product_category_id"], name: "index_inputs_on_product_category_id", using: :btree
  407 + add_index "inputs", ["product_id"], name: "index_inputs_on_product_id", using: :btree
405 408
406 - create_table "licenses", :force => true do |t|  
407 - t.string "name", :null => false  
408 - t.string "slug", :null => false 409 + create_table "licenses", force: :cascade do |t|
  410 + t.string "name", null: false
  411 + t.string "slug", null: false
409 t.string "url" 412 t.string "url"
410 - t.integer "environment_id", :null => false 413 + t.integer "environment_id", null: false
411 end 414 end
412 415
413 - create_table "mailing_sents", :force => true do |t| 416 + create_table "mailing_sents", force: :cascade do |t|
414 t.integer "mailing_id" 417 t.integer "mailing_id"
415 t.integer "person_id" 418 t.integer "person_id"
416 t.datetime "created_at" 419 t.datetime "created_at"
417 t.datetime "updated_at" 420 t.datetime "updated_at"
418 end 421 end
419 422
420 - create_table "mailings", :force => true do |t| 423 + create_table "mailings", force: :cascade do |t|
421 t.string "type" 424 t.string "type"
422 t.string "subject" 425 t.string "subject"
423 t.text "body" 426 t.text "body"
@@ -429,11 +432,11 @@ ActiveRecord::Schema.define(:version => 20150722042714) do @@ -429,11 +432,11 @@ ActiveRecord::Schema.define(:version => 20150722042714) do
429 t.datetime "updated_at" 432 t.datetime "updated_at"
430 end 433 end
431 434
432 - create_table "national_region_types", :force => true do |t| 435 + create_table "national_region_types", force: :cascade do |t|
433 t.string "name" 436 t.string "name"
434 end 437 end
435 438
436 - create_table "national_regions", :force => true do |t| 439 + create_table "national_regions", force: :cascade do |t|
437 t.string "name" 440 t.string "name"
438 t.string "national_region_code" 441 t.string "national_region_code"
439 t.string "parent_national_region_code" 442 t.string "parent_national_region_code"
@@ -442,18 +445,18 @@ ActiveRecord::Schema.define(:version => 20150722042714) do @@ -442,18 +445,18 @@ ActiveRecord::Schema.define(:version => 20150722042714) do
442 t.integer "national_region_type_id" 445 t.integer "national_region_type_id"
443 end 446 end
444 447
445 - add_index "national_regions", ["name"], :name => "name_index"  
446 - add_index "national_regions", ["national_region_code"], :name => "code_index" 448 + add_index "national_regions", ["name"], name: "name_index", using: :btree
  449 + add_index "national_regions", ["national_region_code"], name: "code_index", using: :btree
447 450
448 - create_table "price_details", :force => true do |t|  
449 - t.decimal "price", :default => 0.0 451 + create_table "price_details", force: :cascade do |t|
  452 + t.decimal "price", default: 0.0
450 t.integer "product_id" 453 t.integer "product_id"
451 t.integer "production_cost_id" 454 t.integer "production_cost_id"
452 t.datetime "created_at" 455 t.datetime "created_at"
453 t.datetime "updated_at" 456 t.datetime "updated_at"
454 end 457 end
455 458
456 - create_table "product_qualifiers", :force => true do |t| 459 + create_table "product_qualifiers", force: :cascade do |t|
457 t.integer "product_id" 460 t.integer "product_id"
458 t.integer "qualifier_id" 461 t.integer "qualifier_id"
459 t.integer "certifier_id" 462 t.integer "certifier_id"
@@ -461,11 +464,11 @@ ActiveRecord::Schema.define(:version => 20150722042714) do @@ -461,11 +464,11 @@ ActiveRecord::Schema.define(:version => 20150722042714) do
461 t.datetime "updated_at" 464 t.datetime "updated_at"
462 end 465 end
463 466
464 - add_index "product_qualifiers", ["certifier_id"], :name => "index_product_qualifiers_on_certifier_id"  
465 - add_index "product_qualifiers", ["product_id"], :name => "index_product_qualifiers_on_product_id"  
466 - add_index "product_qualifiers", ["qualifier_id"], :name => "index_product_qualifiers_on_qualifier_id" 467 + add_index "product_qualifiers", ["certifier_id"], name: "index_product_qualifiers_on_certifier_id", using: :btree
  468 + add_index "product_qualifiers", ["product_id"], name: "index_product_qualifiers_on_product_id", using: :btree
  469 + add_index "product_qualifiers", ["qualifier_id"], name: "index_product_qualifiers_on_qualifier_id", using: :btree
467 470
468 - create_table "production_costs", :force => true do |t| 471 + create_table "production_costs", force: :cascade do |t|
469 t.string "name" 472 t.string "name"
470 t.integer "owner_id" 473 t.integer "owner_id"
471 t.string "owner_type" 474 t.string "owner_type"
@@ -473,7 +476,7 @@ ActiveRecord::Schema.define(:version => 20150722042714) do @@ -473,7 +476,7 @@ ActiveRecord::Schema.define(:version => 20150722042714) do
473 t.datetime "updated_at" 476 t.datetime "updated_at"
474 end 477 end
475 478
476 - create_table "products", :force => true do |t| 479 + create_table "products", force: :cascade do |t|
477 t.integer "profile_id" 480 t.integer "profile_id"
478 t.integer "product_category_id" 481 t.integer "product_category_id"
479 t.string "name" 482 t.string "name"
@@ -482,52 +485,52 @@ ActiveRecord::Schema.define(:version => 20150722042714) do @@ -482,52 +485,52 @@ ActiveRecord::Schema.define(:version => 20150722042714) do
482 t.datetime "created_at" 485 t.datetime "created_at"
483 t.datetime "updated_at" 486 t.datetime "updated_at"
484 t.decimal "discount" 487 t.decimal "discount"
485 - t.boolean "available", :default => true  
486 - t.boolean "highlighted", :default => false 488 + t.boolean "available", default: true
  489 + t.boolean "highlighted", default: false
487 t.integer "unit_id" 490 t.integer "unit_id"
488 t.integer "image_id" 491 t.integer "image_id"
489 t.string "type" 492 t.string "type"
490 t.text "data" 493 t.text "data"
491 - t.boolean "archived", :default => false 494 + t.boolean "archived", default: false
492 end 495 end
493 496
494 - add_index "products", ["created_at"], :name => "index_products_on_created_at"  
495 - add_index "products", ["product_category_id"], :name => "index_products_on_product_category_id"  
496 - add_index "products", ["profile_id"], :name => "index_products_on_profile_id" 497 + add_index "products", ["created_at"], name: "index_products_on_created_at", using: :btree
  498 + add_index "products", ["product_category_id"], name: "index_products_on_product_category_id", using: :btree
  499 + add_index "products", ["profile_id"], name: "index_products_on_profile_id", using: :btree
497 500
498 - create_table "profile_activities", :force => true do |t| 501 + create_table "profile_activities", force: :cascade do |t|
499 t.integer "profile_id" 502 t.integer "profile_id"
500 t.integer "activity_id" 503 t.integer "activity_id"
501 t.string "activity_type" 504 t.string "activity_type"
502 - t.datetime "created_at", :null => false  
503 - t.datetime "updated_at", :null => false 505 + t.datetime "created_at", null: false
  506 + t.datetime "updated_at", null: false
504 end 507 end
505 508
506 - add_index "profile_activities", ["activity_id", "activity_type"], :name => "index_profile_activities_on_activity_id_and_activity_type"  
507 - add_index "profile_activities", ["activity_type"], :name => "index_profile_activities_on_activity_type"  
508 - add_index "profile_activities", ["profile_id"], :name => "index_profile_activities_on_profile_id" 509 + add_index "profile_activities", ["activity_id", "activity_type"], name: "index_profile_activities_on_activity_id_and_activity_type", using: :btree
  510 + add_index "profile_activities", ["activity_type"], name: "index_profile_activities_on_activity_type", using: :btree
  511 + add_index "profile_activities", ["profile_id"], name: "index_profile_activities_on_profile_id", using: :btree
509 512
510 - create_table "profile_suggestions", :force => true do |t| 513 + create_table "profile_suggestions", force: :cascade do |t|
511 t.integer "person_id" 514 t.integer "person_id"
512 t.integer "suggestion_id" 515 t.integer "suggestion_id"
513 t.string "suggestion_type" 516 t.string "suggestion_type"
514 t.text "categories" 517 t.text "categories"
515 - t.boolean "enabled", :default => true  
516 - t.float "score", :default => 0.0  
517 - t.datetime "created_at", :null => false  
518 - t.datetime "updated_at", :null => false 518 + t.boolean "enabled", default: true
  519 + t.float "score", default: 0.0
  520 + t.datetime "created_at", null: false
  521 + t.datetime "updated_at", null: false
519 end 522 end
520 523
521 - add_index "profile_suggestions", ["person_id"], :name => "index_profile_suggestions_on_person_id"  
522 - add_index "profile_suggestions", ["score"], :name => "index_profile_suggestions_on_score"  
523 - add_index "profile_suggestions", ["suggestion_id"], :name => "index_profile_suggestions_on_suggestion_id" 524 + add_index "profile_suggestions", ["person_id"], name: "index_profile_suggestions_on_person_id", using: :btree
  525 + add_index "profile_suggestions", ["score"], name: "index_profile_suggestions_on_score", using: :btree
  526 + add_index "profile_suggestions", ["suggestion_id"], name: "index_profile_suggestions_on_suggestion_id", using: :btree
524 527
525 - create_table "profiles", :force => true do |t| 528 + create_table "profiles", force: :cascade do |t|
526 t.string "name" 529 t.string "name"
527 t.string "type" 530 t.string "type"
528 t.string "identifier" 531 t.string "identifier"
529 t.integer "environment_id" 532 t.integer "environment_id"
530 - t.boolean "active", :default => true 533 + t.boolean "active", default: true
531 t.string "address" 534 t.string "address"
532 t.string "contact_phone" 535 t.string "contact_phone"
533 t.integer "home_page_id" 536 t.integer "home_page_id"
@@ -538,67 +541,67 @@ ActiveRecord::Schema.define(:version => 20150722042714) do @@ -538,67 +541,67 @@ ActiveRecord::Schema.define(:version => 20150722042714) do
538 t.float "lat" 541 t.float "lat"
539 t.float "lng" 542 t.float "lng"
540 t.integer "geocode_precision" 543 t.integer "geocode_precision"
541 - t.boolean "enabled", :default => true  
542 - t.string "nickname", :limit => 16 544 + t.boolean "enabled", default: true
  545 + t.string "nickname", limit: 16
543 t.text "custom_header" 546 t.text "custom_header"
544 t.text "custom_footer" 547 t.text "custom_footer"
545 t.string "theme" 548 t.string "theme"
546 - t.boolean "public_profile", :default => true 549 + t.boolean "public_profile", default: true
547 t.date "birth_date" 550 t.date "birth_date"
548 t.integer "preferred_domain_id" 551 t.integer "preferred_domain_id"
549 t.datetime "updated_at" 552 t.datetime "updated_at"
550 - t.boolean "visible", :default => true 553 + t.boolean "visible", default: true
551 t.integer "image_id" 554 t.integer "image_id"
552 - t.boolean "validated", :default => true 555 + t.boolean "validated", default: true
553 t.string "cnpj" 556 t.string "cnpj"
554 t.string "national_region_code" 557 t.string "national_region_code"
555 - t.boolean "is_template", :default => false 558 + t.boolean "is_template", default: false
556 t.integer "template_id" 559 t.integer "template_id"
557 t.string "redirection_after_login" 560 t.string "redirection_after_login"
558 - t.integer "friends_count", :default => 0, :null => false  
559 - t.integer "members_count", :default => 0, :null => false  
560 - t.integer "activities_count", :default => 0, :null => false 561 + t.integer "friends_count", default: 0, null: false
  562 + t.integer "members_count", default: 0, null: false
  563 + t.integer "activities_count", default: 0, null: false
561 t.string "personal_website" 564 t.string "personal_website"
562 t.string "jabber_id" 565 t.string "jabber_id"
563 t.integer "welcome_page_id" 566 t.integer "welcome_page_id"
564 - t.boolean "allow_members_to_invite", :default => true  
565 - t.boolean "invite_friends_only", :default => false  
566 - t.boolean "secret", :default => false  
567 - end  
568 -  
569 - add_index "profiles", ["activities_count"], :name => "index_profiles_on_activities_count"  
570 - add_index "profiles", ["created_at"], :name => "index_profiles_on_created_at"  
571 - add_index "profiles", ["environment_id"], :name => "index_profiles_on_environment_id"  
572 - add_index "profiles", ["friends_count"], :name => "index_profiles_on_friends_count"  
573 - add_index "profiles", ["identifier"], :name => "index_profiles_on_identifier"  
574 - add_index "profiles", ["members_count"], :name => "index_profiles_on_members_count"  
575 - add_index "profiles", ["region_id"], :name => "index_profiles_on_region_id"  
576 - add_index "profiles", ["user_id", "type"], :name => "index_profiles_on_user_id_and_type"  
577 - add_index "profiles", ["user_id"], :name => "index_profiles_on_user_id"  
578 -  
579 - create_table "qualifier_certifiers", :force => true do |t| 567 + t.boolean "allow_members_to_invite", default: true
  568 + t.boolean "invite_friends_only", default: false
  569 + t.boolean "secret", default: false
  570 + end
  571 +
  572 + add_index "profiles", ["activities_count"], name: "index_profiles_on_activities_count", using: :btree
  573 + add_index "profiles", ["created_at"], name: "index_profiles_on_created_at", using: :btree
  574 + add_index "profiles", ["environment_id"], name: "index_profiles_on_environment_id", using: :btree
  575 + add_index "profiles", ["friends_count"], name: "index_profiles_on_friends_count", using: :btree
  576 + add_index "profiles", ["identifier"], name: "index_profiles_on_identifier", using: :btree
  577 + add_index "profiles", ["members_count"], name: "index_profiles_on_members_count", using: :btree
  578 + add_index "profiles", ["region_id"], name: "index_profiles_on_region_id", using: :btree
  579 + add_index "profiles", ["user_id", "type"], name: "index_profiles_on_user_id_and_type", using: :btree
  580 + add_index "profiles", ["user_id"], name: "index_profiles_on_user_id", using: :btree
  581 +
  582 + create_table "qualifier_certifiers", force: :cascade do |t|
580 t.integer "qualifier_id" 583 t.integer "qualifier_id"
581 t.integer "certifier_id" 584 t.integer "certifier_id"
582 end 585 end
583 586
584 - create_table "qualifiers", :force => true do |t|  
585 - t.string "name", :null => false 587 + create_table "qualifiers", force: :cascade do |t|
  588 + t.string "name", null: false
586 t.integer "environment_id" 589 t.integer "environment_id"
587 t.datetime "created_at" 590 t.datetime "created_at"
588 t.datetime "updated_at" 591 t.datetime "updated_at"
589 end 592 end
590 593
591 - create_table "refused_join_community", :id => false, :force => true do |t| 594 + create_table "refused_join_community", id: false, force: :cascade do |t|
592 t.integer "person_id" 595 t.integer "person_id"
593 t.integer "community_id" 596 t.integer "community_id"
594 end 597 end
595 598
596 - create_table "region_validators", :id => false, :force => true do |t| 599 + create_table "region_validators", id: false, force: :cascade do |t|
597 t.integer "region_id" 600 t.integer "region_id"
598 t.integer "organization_id" 601 t.integer "organization_id"
599 end 602 end
600 603
601 - create_table "reported_images", :force => true do |t| 604 + create_table "reported_images", force: :cascade do |t|
602 t.integer "size" 605 t.integer "size"
603 t.string "content_type" 606 t.string "content_type"
604 t.string "filename" 607 t.string "filename"
@@ -607,25 +610,25 @@ ActiveRecord::Schema.define(:version => 20150722042714) do @@ -607,25 +610,25 @@ ActiveRecord::Schema.define(:version => 20150722042714) do
607 t.integer "abuse_report_id" 610 t.integer "abuse_report_id"
608 end 611 end
609 612
610 - create_table "role_assignments", :force => true do |t|  
611 - t.integer "accessor_id", :null => false 613 + create_table "role_assignments", force: :cascade do |t|
  614 + t.integer "accessor_id", null: false
612 t.string "accessor_type" 615 t.string "accessor_type"
613 t.integer "resource_id" 616 t.integer "resource_id"
614 t.string "resource_type" 617 t.string "resource_type"
615 - t.integer "role_id", :null => false 618 + t.integer "role_id", null: false
616 t.boolean "is_global" 619 t.boolean "is_global"
617 end 620 end
618 621
619 - create_table "roles", :force => true do |t| 622 + create_table "roles", force: :cascade do |t|
620 t.string "name" 623 t.string "name"
621 t.string "key" 624 t.string "key"
622 - t.boolean "system", :default => false 625 + t.boolean "system", default: false
623 t.text "permissions" 626 t.text "permissions"
624 t.integer "environment_id" 627 t.integer "environment_id"
625 t.integer "profile_id" 628 t.integer "profile_id"
626 end 629 end
627 630
628 - create_table "scraps", :force => true do |t| 631 + create_table "scraps", force: :cascade do |t|
629 t.text "content" 632 t.text "content"
630 t.integer "sender_id" 633 t.integer "sender_id"
631 t.integer "receiver_id" 634 t.integer "receiver_id"
@@ -635,104 +638,104 @@ ActiveRecord::Schema.define(:version => 20150722042714) do @@ -635,104 +638,104 @@ ActiveRecord::Schema.define(:version => 20150722042714) do
635 t.integer "context_id" 638 t.integer "context_id"
636 end 639 end
637 640
638 - create_table "search_term_occurrences", :force => true do |t| 641 + create_table "search_term_occurrences", force: :cascade do |t|
639 t.integer "search_term_id" 642 t.integer "search_term_id"
640 t.datetime "created_at" 643 t.datetime "created_at"
641 - t.integer "total", :default => 0  
642 - t.integer "indexed", :default => 0 644 + t.integer "total", default: 0
  645 + t.integer "indexed", default: 0
643 end 646 end
644 647
645 - add_index "search_term_occurrences", ["created_at"], :name => "index_search_term_occurrences_on_created_at" 648 + add_index "search_term_occurrences", ["created_at"], name: "index_search_term_occurrences_on_created_at", using: :btree
646 649
647 - create_table "search_terms", :force => true do |t| 650 + create_table "search_terms", force: :cascade do |t|
648 t.string "term" 651 t.string "term"
649 t.integer "context_id" 652 t.integer "context_id"
650 t.string "context_type" 653 t.string "context_type"
651 - t.string "asset", :default => "all"  
652 - t.float "score", :default => 0.0  
653 - t.float "relevance_score", :default => 0.0  
654 - t.float "occurrence_score", :default => 0.0 654 + t.string "asset", default: "all"
  655 + t.float "score", default: 0.0
  656 + t.float "relevance_score", default: 0.0
  657 + t.float "occurrence_score", default: 0.0
655 end 658 end
656 659
657 - add_index "search_terms", ["asset"], :name => "index_search_terms_on_asset"  
658 - add_index "search_terms", ["occurrence_score"], :name => "index_search_terms_on_occurrence_score"  
659 - add_index "search_terms", ["relevance_score"], :name => "index_search_terms_on_relevance_score"  
660 - add_index "search_terms", ["score"], :name => "index_search_terms_on_score"  
661 - add_index "search_terms", ["term"], :name => "index_search_terms_on_term" 660 + add_index "search_terms", ["asset"], name: "index_search_terms_on_asset", using: :btree
  661 + add_index "search_terms", ["occurrence_score"], name: "index_search_terms_on_occurrence_score", using: :btree
  662 + add_index "search_terms", ["relevance_score"], name: "index_search_terms_on_relevance_score", using: :btree
  663 + add_index "search_terms", ["score"], name: "index_search_terms_on_score", using: :btree
  664 + add_index "search_terms", ["term"], name: "index_search_terms_on_term", using: :btree
662 665
663 - create_table "sessions", :force => true do |t|  
664 - t.string "session_id", :null => false 666 + create_table "sessions", force: :cascade do |t|
  667 + t.string "session_id", null: false
665 t.text "data" 668 t.text "data"
666 t.datetime "created_at" 669 t.datetime "created_at"
667 t.datetime "updated_at" 670 t.datetime "updated_at"
668 t.integer "user_id" 671 t.integer "user_id"
669 end 672 end
670 673
671 - add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id"  
672 - add_index "sessions", ["updated_at"], :name => "index_sessions_on_updated_at"  
673 - add_index "sessions", ["user_id"], :name => "index_sessions_on_user_id" 674 + add_index "sessions", ["session_id"], name: "index_sessions_on_session_id", using: :btree
  675 + add_index "sessions", ["updated_at"], name: "index_sessions_on_updated_at", using: :btree
  676 + add_index "sessions", ["user_id"], name: "index_sessions_on_user_id", using: :btree
674 677
675 - create_table "suggestion_connections", :force => true do |t|  
676 - t.integer "suggestion_id", :null => false  
677 - t.integer "connection_id", :null => false  
678 - t.string "connection_type", :null => false 678 + create_table "suggestion_connections", force: :cascade do |t|
  679 + t.integer "suggestion_id", null: false
  680 + t.integer "connection_id", null: false
  681 + t.string "connection_type", null: false
679 end 682 end
680 683
681 - create_table "taggings", :force => true do |t| 684 + create_table "taggings", force: :cascade do |t|
682 t.integer "tag_id" 685 t.integer "tag_id"
683 t.integer "taggable_id" 686 t.integer "taggable_id"
684 t.string "taggable_type" 687 t.string "taggable_type"
685 t.datetime "created_at" 688 t.datetime "created_at"
686 t.integer "tagger_id" 689 t.integer "tagger_id"
687 t.string "tagger_type" 690 t.string "tagger_type"
688 - t.string "context", :limit => 128 691 + t.string "context", limit: 128
689 end 692 end
690 693
691 - add_index "taggings", ["tag_id", "taggable_id", "taggable_type", "context", "tagger_id", "tagger_type"], :name => "taggings_idx", :unique => true  
692 - add_index "taggings", ["taggable_id", "taggable_type", "context"], :name => "index_taggings_on_taggable_id_and_taggable_type_and_context"  
693 - add_index "taggings", ["taggable_id", "taggable_type"], :name => "index_taggings_on_taggable_id_and_taggable_type" 694 + add_index "taggings", ["tag_id", "taggable_id", "taggable_type", "context", "tagger_id", "tagger_type"], name: "taggings_idx", unique: true, using: :btree
  695 + add_index "taggings", ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context", using: :btree
  696 + add_index "taggings", ["taggable_id", "taggable_type"], name: "index_taggings_on_taggable_id_and_taggable_type", using: :btree
694 697
695 - create_table "tags", :force => true do |t| 698 + create_table "tags", force: :cascade do |t|
696 t.string "name" 699 t.string "name"
697 t.integer "parent_id" 700 t.integer "parent_id"
698 - t.boolean "pending", :default => false  
699 - t.integer "taggings_count", :default => 0 701 + t.boolean "pending", default: false
  702 + t.integer "taggings_count", default: 0
700 end 703 end
701 704
702 - add_index "tags", ["name"], :name => "index_tags_on_name", :unique => true  
703 - add_index "tags", ["parent_id"], :name => "index_tags_on_parent_id" 705 + add_index "tags", ["name"], name: "index_tags_on_name", unique: true, using: :btree
  706 + add_index "tags", ["parent_id"], name: "index_tags_on_parent_id", using: :btree
704 707
705 - create_table "tasks", :force => true do |t| 708 + create_table "tasks", force: :cascade do |t|
706 t.text "data" 709 t.text "data"
707 t.integer "status" 710 t.integer "status"
708 t.date "end_date" 711 t.date "end_date"
709 t.integer "requestor_id" 712 t.integer "requestor_id"
710 t.integer "target_id" 713 t.integer "target_id"
711 - t.string "code", :limit => 40 714 + t.string "code", limit: 40
712 t.string "type" 715 t.string "type"
713 t.datetime "created_at" 716 t.datetime "created_at"
714 t.string "target_type" 717 t.string "target_type"
715 t.integer "image_id" 718 t.integer "image_id"
716 - t.boolean "spam", :default => false 719 + t.boolean "spam", default: false
717 t.integer "responsible_id" 720 t.integer "responsible_id"
718 t.integer "closed_by_id" 721 t.integer "closed_by_id"
719 end 722 end
720 723
721 - add_index "tasks", ["requestor_id"], :name => "index_tasks_on_requestor_id"  
722 - add_index "tasks", ["spam"], :name => "index_tasks_on_spam"  
723 - add_index "tasks", ["status"], :name => "index_tasks_on_status"  
724 - add_index "tasks", ["target_id", "target_type"], :name => "index_tasks_on_target_id_and_target_type"  
725 - add_index "tasks", ["target_id"], :name => "index_tasks_on_target_id"  
726 - add_index "tasks", ["target_type"], :name => "index_tasks_on_target_type" 724 + add_index "tasks", ["requestor_id"], name: "index_tasks_on_requestor_id", using: :btree
  725 + add_index "tasks", ["spam"], name: "index_tasks_on_spam", using: :btree
  726 + add_index "tasks", ["status"], name: "index_tasks_on_status", using: :btree
  727 + add_index "tasks", ["target_id", "target_type"], name: "index_tasks_on_target_id_and_target_type", using: :btree
  728 + add_index "tasks", ["target_id"], name: "index_tasks_on_target_id", using: :btree
  729 + add_index "tasks", ["target_type"], name: "index_tasks_on_target_type", using: :btree
727 730
728 - create_table "terms_forum_people", :id => false, :force => true do |t| 731 + create_table "terms_forum_people", id: false, force: :cascade do |t|
729 t.integer "forum_id" 732 t.integer "forum_id"
730 t.integer "person_id" 733 t.integer "person_id"
731 end 734 end
732 735
733 - add_index "terms_forum_people", ["forum_id", "person_id"], :name => "index_terms_forum_people_on_forum_id_and_person_id" 736 + add_index "terms_forum_people", ["forum_id", "person_id"], name: "index_terms_forum_people_on_forum_id_and_person_id", using: :btree
734 737
735 - create_table "thumbnails", :force => true do |t| 738 + create_table "thumbnails", force: :cascade do |t|
736 t.integer "size" 739 t.integer "size"
737 t.string "content_type" 740 t.string "content_type"
738 t.string "filename" 741 t.string "filename"
@@ -742,33 +745,33 @@ ActiveRecord::Schema.define(:version => 20150722042714) do @@ -742,33 +745,33 @@ ActiveRecord::Schema.define(:version => 20150722042714) do
742 t.string "thumbnail" 745 t.string "thumbnail"
743 end 746 end
744 747
745 - add_index "thumbnails", ["parent_id"], :name => "index_thumbnails_on_parent_id" 748 + add_index "thumbnails", ["parent_id"], name: "index_thumbnails_on_parent_id", using: :btree
746 749
747 - create_table "units", :force => true do |t|  
748 - t.string "singular", :null => false  
749 - t.string "plural", :null => false 750 + create_table "units", force: :cascade do |t|
  751 + t.string "singular", null: false
  752 + t.string "plural", null: false
750 t.integer "position" 753 t.integer "position"
751 - t.integer "environment_id", :null => false 754 + t.integer "environment_id", null: false
752 end 755 end
753 756
754 - create_table "users", :force => true do |t| 757 + create_table "users", force: :cascade do |t|
755 t.string "login" 758 t.string "login"
756 t.string "email" 759 t.string "email"
757 - t.string "crypted_password", :limit => 40  
758 - t.string "salt", :limit => 40 760 + t.string "crypted_password", limit: 40
  761 + t.string "salt", limit: 40
759 t.datetime "created_at" 762 t.datetime "created_at"
760 t.datetime "updated_at" 763 t.datetime "updated_at"
761 t.string "remember_token" 764 t.string "remember_token"
762 t.datetime "remember_token_expires_at" 765 t.datetime "remember_token_expires_at"
763 t.text "terms_of_use" 766 t.text "terms_of_use"
764 - t.string "terms_accepted", :limit => 1 767 + t.string "terms_accepted", limit: 1
765 t.integer "environment_id" 768 t.integer "environment_id"
766 t.string "password_type" 769 t.string "password_type"
767 - t.boolean "enable_email", :default => false  
768 - t.string "last_chat_status", :default => ""  
769 - t.string "chat_status", :default => "" 770 + t.boolean "enable_email", default: false
  771 + t.string "last_chat_status", default: ""
  772 + t.string "chat_status", default: ""
770 t.datetime "chat_status_at" 773 t.datetime "chat_status_at"
771 - t.string "activation_code", :limit => 40 774 + t.string "activation_code", limit: 40
772 t.datetime "activated_at" 775 t.datetime "activated_at"
773 t.string "return_to" 776 t.string "return_to"
774 t.datetime "last_login_at" 777 t.datetime "last_login_at"
@@ -776,23 +779,23 @@ ActiveRecord::Schema.define(:version => 20150722042714) do @@ -776,23 +779,23 @@ ActiveRecord::Schema.define(:version => 20150722042714) do
776 t.datetime "private_token_generated_at" 779 t.datetime "private_token_generated_at"
777 end 780 end
778 781
779 - create_table "validation_infos", :force => true do |t| 782 + create_table "validation_infos", force: :cascade do |t|
780 t.text "validation_methodology" 783 t.text "validation_methodology"
781 t.text "restrictions" 784 t.text "restrictions"
782 t.integer "organization_id" 785 t.integer "organization_id"
783 end 786 end
784 787
785 - create_table "votes", :force => true do |t|  
786 - t.integer "vote", :null => false  
787 - t.integer "voteable_id", :null => false  
788 - t.string "voteable_type", :null => false 788 + create_table "votes", force: :cascade do |t|
  789 + t.integer "vote", null: false
  790 + t.integer "voteable_id", null: false
  791 + t.string "voteable_type", null: false
789 t.integer "voter_id" 792 t.integer "voter_id"
790 t.string "voter_type" 793 t.string "voter_type"
791 t.datetime "created_at" 794 t.datetime "created_at"
792 t.datetime "updated_at" 795 t.datetime "updated_at"
793 end 796 end
794 797
795 - add_index "votes", ["voteable_id", "voteable_type"], :name => "fk_voteables"  
796 - add_index "votes", ["voter_id", "voter_type"], :name => "fk_voters" 798 + add_index "votes", ["voteable_id", "voteable_type"], name: "fk_voteables", using: :btree
  799 + add_index "votes", ["voter_id", "voter_type"], name: "fk_voters", using: :btree
797 800
798 end 801 end