From 1de1cb0353fc18210ee6169655587a71641e90cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 26 Apr 2019 20:03:12 +0200 Subject: [PATCH] Use Rails 5.1 schema file format Rails 5.1 doesn't align the columns in the schema file anymore, so there aren't unrelated changes when we add or remove columns to a table: https://github.com/rails/rails/pull/25675 We're sorry for developers who are really concerned about code alignment. --- db/schema.rb | 2562 +++++++++++++++++++++++++------------------------- 1 file changed, 1281 insertions(+), 1281 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index 1eccac194..3dafb07b9 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -17,1589 +17,1589 @@ ActiveRecord::Schema.define(version: 20191108173350) do enable_extension "unaccent" enable_extension "pg_trgm" - create_table "active_poll_translations", force: :cascade do |t| - t.integer "active_poll_id", null: false - t.string "locale", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.text "description" - t.index ["active_poll_id"], name: "index_active_poll_translations_on_active_poll_id", using: :btree - t.index ["locale"], name: "index_active_poll_translations_on_locale", using: :btree + create_table "active_poll_translations", id: :serial, force: :cascade do |t| + t.integer "active_poll_id", null: false + t.string "locale", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.text "description" + t.index ["active_poll_id"], name: "index_active_poll_translations_on_active_poll_id" + t.index ["locale"], name: "index_active_poll_translations_on_locale" end - create_table "active_polls", force: :cascade do |t| + create_table "active_polls", id: :serial, force: :cascade do |t| t.datetime "created_at", null: false t.datetime "updated_at", null: false end - create_table "activities", force: :cascade do |t| - t.integer "user_id" - t.string "action" - t.string "actionable_type" - t.integer "actionable_id" + create_table "activities", id: :serial, force: :cascade do |t| + t.integer "user_id" + t.string "action" + t.string "actionable_type" + t.integer "actionable_id" t.datetime "created_at" t.datetime "updated_at" - t.index ["actionable_id", "actionable_type"], name: "index_activities_on_actionable_id_and_actionable_type", using: :btree - t.index ["user_id"], name: "index_activities_on_user_id", using: :btree + t.index ["actionable_id", "actionable_type"], name: "index_activities_on_actionable_id_and_actionable_type" + t.index ["user_id"], name: "index_activities_on_user_id" end - create_table "admin_notification_translations", force: :cascade do |t| - t.integer "admin_notification_id", null: false - t.string "locale", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "title" - t.text "body" - t.index ["admin_notification_id"], name: "index_admin_notification_translations_on_admin_notification_id", using: :btree - t.index ["locale"], name: "index_admin_notification_translations_on_locale", using: :btree + create_table "admin_notification_translations", id: :serial, force: :cascade do |t| + t.integer "admin_notification_id", null: false + t.string "locale", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "title" + t.text "body" + t.index ["admin_notification_id"], name: "index_admin_notification_translations_on_admin_notification_id" + t.index ["locale"], name: "index_admin_notification_translations_on_locale" end - create_table "admin_notifications", force: :cascade do |t| - t.string "link" - t.string "segment_recipient" - t.integer "recipients_count" - t.date "sent_at" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + create_table "admin_notifications", id: :serial, force: :cascade do |t| + t.string "link" + t.string "segment_recipient" + t.integer "recipients_count" + t.date "sent_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - create_table "administrators", force: :cascade do |t| + create_table "administrators", id: :serial, force: :cascade do |t| t.integer "user_id" - t.string "description" - t.index ["user_id"], name: "index_administrators_on_user_id", using: :btree + t.string "description" + t.index ["user_id"], name: "index_administrators_on_user_id" end create_table "ahoy_events", id: :uuid, default: nil, force: :cascade do |t| - t.uuid "visit_id" - t.integer "user_id" - t.string "name" - t.jsonb "properties" + t.uuid "visit_id" + t.integer "user_id" + t.string "name" + t.jsonb "properties" t.datetime "time" - t.string "ip" - t.index ["name", "time"], name: "index_ahoy_events_on_name_and_time", using: :btree - t.index ["time"], name: "index_ahoy_events_on_time", using: :btree - t.index ["user_id"], name: "index_ahoy_events_on_user_id", using: :btree - t.index ["visit_id"], name: "index_ahoy_events_on_visit_id", using: :btree + t.string "ip" + t.index ["name", "time"], name: "index_ahoy_events_on_name_and_time" + t.index ["time"], name: "index_ahoy_events_on_time" + t.index ["user_id"], name: "index_ahoy_events_on_user_id" + t.index ["visit_id"], name: "index_ahoy_events_on_visit_id" end - create_table "audits", force: :cascade do |t| - t.integer "auditable_id" - t.string "auditable_type" - t.integer "associated_id" - t.string "associated_type" - t.integer "user_id" - t.string "user_type" - t.string "username" - t.string "action" - t.jsonb "audited_changes" - t.integer "version", default: 0 - t.string "comment" - t.string "remote_address" - t.string "request_uuid" + create_table "audits", id: :serial, force: :cascade do |t| + t.integer "auditable_id" + t.string "auditable_type" + t.integer "associated_id" + t.string "associated_type" + t.integer "user_id" + t.string "user_type" + t.string "username" + t.string "action" + t.jsonb "audited_changes" + t.integer "version", default: 0 + t.string "comment" + t.string "remote_address" + t.string "request_uuid" t.datetime "created_at" - t.index ["associated_type", "associated_id"], name: "associated_index", using: :btree - t.index ["auditable_type", "auditable_id", "version"], name: "auditable_index", using: :btree - t.index ["created_at"], name: "index_audits_on_created_at", using: :btree - t.index ["request_uuid"], name: "index_audits_on_request_uuid", using: :btree - t.index ["user_id", "user_type"], name: "user_index", using: :btree + t.index ["associated_type", "associated_id"], name: "associated_index" + t.index ["auditable_type", "auditable_id", "version"], name: "auditable_index" + t.index ["created_at"], name: "index_audits_on_created_at" + t.index ["request_uuid"], name: "index_audits_on_request_uuid" + t.index ["user_id", "user_type"], name: "user_index" end - create_table "banner_sections", force: :cascade do |t| - t.integer "banner_id" - t.integer "web_section_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - end - - create_table "banner_translations", force: :cascade do |t| - t.integer "banner_id", null: false - t.string "locale", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "title" - t.text "description" - t.datetime "hidden_at" - t.index ["banner_id"], name: "index_banner_translations_on_banner_id", using: :btree - t.index ["hidden_at"], name: "index_banner_translations_on_hidden_at", using: :btree - t.index ["locale"], name: "index_banner_translations_on_locale", using: :btree - end - - create_table "banners", force: :cascade do |t| - t.string "target_url" - t.date "post_started_at" - t.date "post_ended_at" - t.datetime "hidden_at" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.text "background_color" - t.text "font_color" - t.index ["hidden_at"], name: "index_banners_on_hidden_at", using: :btree - end - - create_table "budget_administrators", force: :cascade do |t| - t.integer "budget_id" - t.integer "administrator_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["administrator_id"], name: "index_budget_administrators_on_administrator_id", using: :btree - t.index ["budget_id"], name: "index_budget_administrators_on_budget_id", using: :btree - end - - create_table "budget_ballot_lines", force: :cascade do |t| - t.integer "ballot_id" - t.integer "investment_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.integer "budget_id" - t.integer "group_id" - t.integer "heading_id" - t.index ["ballot_id", "investment_id"], name: "index_budget_ballot_lines_on_ballot_id_and_investment_id", unique: true, using: :btree - t.index ["ballot_id"], name: "index_budget_ballot_lines_on_ballot_id", using: :btree - t.index ["investment_id"], name: "index_budget_ballot_lines_on_investment_id", using: :btree - end - - create_table "budget_ballots", force: :cascade do |t| - t.integer "user_id" - t.integer "budget_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.integer "ballot_lines_count", default: 0 - t.boolean "physical", default: false - t.integer "poll_ballot_id" - end - - create_table "budget_content_blocks", force: :cascade do |t| - t.integer "heading_id" - t.text "body" - t.string "locale" + create_table "banner_sections", id: :serial, force: :cascade do |t| + t.integer "banner_id" + t.integer "web_section_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false - t.index ["heading_id"], name: "index_budget_content_blocks_on_heading_id", using: :btree end - create_table "budget_group_translations", force: :cascade do |t| - t.integer "budget_group_id", null: false - t.string "locale", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "name" - t.index ["budget_group_id"], name: "index_budget_group_translations_on_budget_group_id", using: :btree - t.index ["locale"], name: "index_budget_group_translations_on_locale", using: :btree + create_table "banner_translations", id: :serial, force: :cascade do |t| + t.integer "banner_id", null: false + t.string "locale", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "title" + t.text "description" + t.datetime "hidden_at" + t.index ["banner_id"], name: "index_banner_translations_on_banner_id" + t.index ["hidden_at"], name: "index_banner_translations_on_hidden_at" + t.index ["locale"], name: "index_banner_translations_on_locale" end - create_table "budget_groups", force: :cascade do |t| - t.integer "budget_id" - t.string "slug" - t.integer "max_votable_headings", default: 1 + create_table "banners", id: :serial, force: :cascade do |t| + t.string "target_url" + t.date "post_started_at" + t.date "post_ended_at" + t.datetime "hidden_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.text "background_color" + t.text "font_color" + t.index ["hidden_at"], name: "index_banners_on_hidden_at" + end + + create_table "budget_administrators", id: :serial, force: :cascade do |t| + t.integer "budget_id" + t.integer "administrator_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["administrator_id"], name: "index_budget_administrators_on_administrator_id" + t.index ["budget_id"], name: "index_budget_administrators_on_budget_id" + end + + create_table "budget_ballot_lines", id: :serial, force: :cascade do |t| + t.integer "ballot_id" + t.integer "investment_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "budget_id" + t.integer "group_id" + t.integer "heading_id" + t.index ["ballot_id", "investment_id"], name: "index_budget_ballot_lines_on_ballot_id_and_investment_id", unique: true + t.index ["ballot_id"], name: "index_budget_ballot_lines_on_ballot_id" + t.index ["investment_id"], name: "index_budget_ballot_lines_on_investment_id" + end + + create_table "budget_ballots", id: :serial, force: :cascade do |t| + t.integer "user_id" + t.integer "budget_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "ballot_lines_count", default: 0 + t.boolean "physical", default: false + t.integer "poll_ballot_id" + end + + create_table "budget_content_blocks", id: :serial, force: :cascade do |t| + t.integer "heading_id" + t.text "body" + t.string "locale" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["heading_id"], name: "index_budget_content_blocks_on_heading_id" + end + + create_table "budget_group_translations", id: :serial, force: :cascade do |t| + t.integer "budget_group_id", null: false + t.string "locale", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "name" + t.index ["budget_group_id"], name: "index_budget_group_translations_on_budget_group_id" + t.index ["locale"], name: "index_budget_group_translations_on_locale" + end + + create_table "budget_groups", id: :serial, force: :cascade do |t| + t.integer "budget_id" + t.string "slug" + t.integer "max_votable_headings", default: 1 t.datetime "created_at" t.datetime "updated_at" - t.index ["budget_id"], name: "index_budget_groups_on_budget_id", using: :btree + t.index ["budget_id"], name: "index_budget_groups_on_budget_id" end - create_table "budget_heading_translations", force: :cascade do |t| - t.integer "budget_heading_id", null: false - t.string "locale", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "name" - t.index ["budget_heading_id"], name: "index_budget_heading_translations_on_budget_heading_id", using: :btree - t.index ["locale"], name: "index_budget_heading_translations_on_locale", using: :btree + create_table "budget_heading_translations", id: :serial, force: :cascade do |t| + t.integer "budget_heading_id", null: false + t.string "locale", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "name" + t.index ["budget_heading_id"], name: "index_budget_heading_translations_on_budget_heading_id" + t.index ["locale"], name: "index_budget_heading_translations_on_locale" end - create_table "budget_headings", force: :cascade do |t| - t.integer "group_id" - t.bigint "price" - t.integer "population" - t.string "slug" - t.boolean "allow_custom_content", default: false - t.text "latitude" - t.text "longitude" + create_table "budget_headings", id: :serial, force: :cascade do |t| + t.integer "group_id" + t.bigint "price" + t.integer "population" + t.string "slug" + t.boolean "allow_custom_content", default: false + t.text "latitude" + t.text "longitude" t.datetime "created_at" t.datetime "updated_at" - t.index ["group_id"], name: "index_budget_headings_on_group_id", using: :btree + t.index ["group_id"], name: "index_budget_headings_on_group_id" end - create_table "budget_investment_translations", force: :cascade do |t| - t.integer "budget_investment_id", null: false - t.string "locale", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "title" - t.text "description" + create_table "budget_investment_translations", id: :serial, force: :cascade do |t| + t.integer "budget_investment_id", null: false + t.string "locale", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "title" + t.text "description" t.datetime "hidden_at" - t.index ["budget_investment_id"], name: "index_budget_investment_translations_on_budget_investment_id", using: :btree - t.index ["hidden_at"], name: "index_budget_investment_translations_on_hidden_at", using: :btree - t.index ["locale"], name: "index_budget_investment_translations_on_locale", using: :btree + t.index ["budget_investment_id"], name: "index_budget_investment_translations_on_budget_investment_id" + t.index ["hidden_at"], name: "index_budget_investment_translations_on_hidden_at" + t.index ["locale"], name: "index_budget_investment_translations_on_locale" end - create_table "budget_investments", force: :cascade do |t| - t.integer "author_id" - t.integer "administrator_id" - t.string "deprecated_title" - t.text "deprecated_description" - t.string "external_url" - t.bigint "price" - t.string "feasibility", limit: 15, default: "undecided" - t.text "price_explanation" - t.text "unfeasibility_explanation" - t.boolean "valuation_finished", default: false - t.integer "valuator_assignments_count", default: 0 - t.bigint "price_first_year" - t.string "duration" + create_table "budget_investments", id: :serial, force: :cascade do |t| + t.integer "author_id" + t.integer "administrator_id" + t.string "deprecated_title" + t.text "deprecated_description" + t.string "external_url" + t.bigint "price" + t.string "feasibility", limit: 15, default: "undecided" + t.text "price_explanation" + t.text "unfeasibility_explanation" + t.boolean "valuation_finished", default: false + t.integer "valuator_assignments_count", default: 0 + t.bigint "price_first_year" + t.string "duration" t.datetime "hidden_at" - t.integer "cached_votes_up", default: 0 - t.integer "comments_count", default: 0 - t.integer "confidence_score", default: 0, null: false - t.integer "physical_votes", default: 0 + t.integer "cached_votes_up", default: 0 + t.integer "comments_count", default: 0 + t.integer "confidence_score", default: 0, null: false + t.integer "physical_votes", default: 0 t.tsvector "tsv" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.integer "heading_id" - t.string "responsible_name" - t.integer "budget_id" - t.integer "group_id" - t.boolean "selected", default: false - t.string "location" - t.string "organization_name" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "heading_id" + t.string "responsible_name" + t.integer "budget_id" + t.integer "group_id" + t.boolean "selected", default: false + t.string "location" + t.string "organization_name" t.datetime "unfeasible_email_sent_at" - t.integer "ballot_lines_count", default: 0 - t.integer "previous_heading_id" - t.boolean "winner", default: false - t.boolean "incompatible", default: false - t.integer "community_id" - t.boolean "visible_to_valuators", default: false - t.integer "valuator_group_assignments_count", default: 0 + t.integer "ballot_lines_count", default: 0 + t.integer "previous_heading_id" + t.boolean "winner", default: false + t.boolean "incompatible", default: false + t.integer "community_id" + t.boolean "visible_to_valuators", default: false + t.integer "valuator_group_assignments_count", default: 0 t.datetime "confirmed_hide_at" t.datetime "ignored_flag_at" - t.integer "flags_count", default: 0 - t.integer "original_heading_id" - t.index ["administrator_id"], name: "index_budget_investments_on_administrator_id", using: :btree - t.index ["author_id"], name: "index_budget_investments_on_author_id", using: :btree - t.index ["community_id"], name: "index_budget_investments_on_community_id", using: :btree - t.index ["heading_id"], name: "index_budget_investments_on_heading_id", using: :btree + t.integer "flags_count", default: 0 + t.integer "original_heading_id" + t.index ["administrator_id"], name: "index_budget_investments_on_administrator_id" + t.index ["author_id"], name: "index_budget_investments_on_author_id" + t.index ["community_id"], name: "index_budget_investments_on_community_id" + t.index ["heading_id"], name: "index_budget_investments_on_heading_id" t.index ["tsv"], name: "index_budget_investments_on_tsv", using: :gin end - create_table "budget_phase_translations", force: :cascade do |t| - t.integer "budget_phase_id", null: false - t.string "locale", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.text "description" - t.text "summary" - t.index ["budget_phase_id"], name: "index_budget_phase_translations_on_budget_phase_id", using: :btree - t.index ["locale"], name: "index_budget_phase_translations_on_locale", using: :btree - end - - create_table "budget_phases", force: :cascade do |t| - t.integer "budget_id" - t.integer "next_phase_id" - t.string "kind", null: false - t.datetime "starts_at" - t.datetime "ends_at" - t.boolean "enabled", default: true - t.index ["ends_at"], name: "index_budget_phases_on_ends_at", using: :btree - t.index ["kind"], name: "index_budget_phases_on_kind", using: :btree - t.index ["next_phase_id"], name: "index_budget_phases_on_next_phase_id", using: :btree - t.index ["starts_at"], name: "index_budget_phases_on_starts_at", using: :btree - end - - create_table "budget_reclassified_votes", force: :cascade do |t| - t.integer "user_id" - t.integer "investment_id" - t.string "reason" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - end - - create_table "budget_translations", force: :cascade do |t| - t.integer "budget_id", null: false - t.string "locale", null: false + create_table "budget_phase_translations", id: :serial, force: :cascade do |t| + t.integer "budget_phase_id", null: false + t.string "locale", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false - t.string "name" - t.index ["budget_id"], name: "index_budget_translations_on_budget_id", using: :btree - t.index ["locale"], name: "index_budget_translations_on_locale", using: :btree + t.text "description" + t.text "summary" + t.index ["budget_phase_id"], name: "index_budget_phase_translations_on_budget_phase_id" + t.index ["locale"], name: "index_budget_phase_translations_on_locale" end - create_table "budget_valuator_assignments", force: :cascade do |t| - t.integer "valuator_id" - t.integer "investment_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["investment_id"], name: "index_budget_valuator_assignments_on_investment_id", using: :btree + create_table "budget_phases", id: :serial, force: :cascade do |t| + t.integer "budget_id" + t.integer "next_phase_id" + t.string "kind", null: false + t.datetime "starts_at" + t.datetime "ends_at" + t.boolean "enabled", default: true + t.index ["ends_at"], name: "index_budget_phases_on_ends_at" + t.index ["kind"], name: "index_budget_phases_on_kind" + t.index ["next_phase_id"], name: "index_budget_phases_on_next_phase_id" + t.index ["starts_at"], name: "index_budget_phases_on_starts_at" end - create_table "budget_valuator_group_assignments", force: :cascade do |t| + create_table "budget_reclassified_votes", id: :serial, force: :cascade do |t| + t.integer "user_id" + t.integer "investment_id" + t.string "reason" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "budget_translations", id: :serial, force: :cascade do |t| + t.integer "budget_id", null: false + t.string "locale", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "name" + t.index ["budget_id"], name: "index_budget_translations_on_budget_id" + t.index ["locale"], name: "index_budget_translations_on_locale" + end + + create_table "budget_valuator_assignments", id: :serial, force: :cascade do |t| + t.integer "valuator_id" + t.integer "investment_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["investment_id"], name: "index_budget_valuator_assignments_on_investment_id" + end + + create_table "budget_valuator_group_assignments", id: :serial, force: :cascade do |t| t.integer "valuator_group_id" t.integer "investment_id" end - create_table "budget_valuators", force: :cascade do |t| - t.integer "budget_id" - t.integer "valuator_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["budget_id"], name: "index_budget_valuators_on_budget_id", using: :btree - t.index ["valuator_id"], name: "index_budget_valuators_on_valuator_id", using: :btree + create_table "budget_valuators", id: :serial, force: :cascade do |t| + t.integer "budget_id" + t.integer "valuator_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["budget_id"], name: "index_budget_valuators_on_budget_id" + t.index ["valuator_id"], name: "index_budget_valuators_on_valuator_id" end - create_table "budgets", force: :cascade do |t| - t.string "currency_symbol", limit: 10 - t.string "phase", limit: 40, default: "accepting" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.text "description_accepting" - t.text "description_reviewing" - t.text "description_selecting" - t.text "description_valuating" - t.text "description_balloting" - t.text "description_reviewing_ballots" - t.text "description_finished" - t.string "slug" - t.text "description_drafting" - t.text "description_publishing_prices" - t.text "description_informing" + create_table "budgets", id: :serial, force: :cascade do |t| + t.string "currency_symbol", limit: 10 + t.string "phase", limit: 40, default: "accepting" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.text "description_accepting" + t.text "description_reviewing" + t.text "description_selecting" + t.text "description_valuating" + t.text "description_balloting" + t.text "description_reviewing_ballots" + t.text "description_finished" + t.string "slug" + t.text "description_drafting" + t.text "description_publishing_prices" + t.text "description_informing" end - create_table "campaigns", force: :cascade do |t| - t.string "name" - t.string "track_id" + create_table "campaigns", id: :serial, force: :cascade do |t| + t.string "name" + t.string "track_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false end - create_table "ckeditor_assets", force: :cascade do |t| - t.string "data_file_name", null: false - t.string "data_content_type" - t.integer "data_file_size" - t.string "data_fingerprint" - t.string "type", limit: 30 - t.integer "width" - t.integer "height" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["type"], name: "index_ckeditor_assets_on_type", using: :btree - end - - create_table "comment_translations", force: :cascade do |t| - t.integer "comment_id", null: false - t.string "locale", null: false + create_table "ckeditor_assets", id: :serial, force: :cascade do |t| + t.string "data_file_name", null: false + t.string "data_content_type" + t.integer "data_file_size" + t.string "data_fingerprint" + t.string "type", limit: 30 + t.integer "width" + t.integer "height" t.datetime "created_at", null: false t.datetime "updated_at", null: false - t.text "body" + t.index ["type"], name: "index_ckeditor_assets_on_type" + end + + create_table "comment_translations", id: :serial, force: :cascade do |t| + t.integer "comment_id", null: false + t.string "locale", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.text "body" t.datetime "hidden_at" - t.index ["comment_id"], name: "index_comment_translations_on_comment_id", using: :btree - t.index ["hidden_at"], name: "index_comment_translations_on_hidden_at", using: :btree - t.index ["locale"], name: "index_comment_translations_on_locale", using: :btree + t.index ["comment_id"], name: "index_comment_translations_on_comment_id" + t.index ["hidden_at"], name: "index_comment_translations_on_hidden_at" + t.index ["locale"], name: "index_comment_translations_on_locale" end - create_table "comments", force: :cascade do |t| - t.integer "commentable_id" - t.string "commentable_type" - t.text "deprecated_body" - t.string "subject" - t.integer "user_id", null: false + create_table "comments", id: :serial, force: :cascade do |t| + t.integer "commentable_id" + t.string "commentable_type" + t.text "deprecated_body" + t.string "subject" + t.integer "user_id", null: false t.datetime "created_at" t.datetime "updated_at" t.datetime "hidden_at" - t.integer "flags_count", default: 0 + t.integer "flags_count", default: 0 t.datetime "ignored_flag_at" - t.integer "moderator_id" - t.integer "administrator_id" - t.integer "cached_votes_total", default: 0 - t.integer "cached_votes_up", default: 0 - t.integer "cached_votes_down", default: 0 + t.integer "moderator_id" + t.integer "administrator_id" + t.integer "cached_votes_total", default: 0 + t.integer "cached_votes_up", default: 0 + t.integer "cached_votes_down", default: 0 t.datetime "confirmed_hide_at" - t.string "ancestry" - t.integer "confidence_score", default: 0, null: false - t.boolean "valuation", default: false - t.index ["ancestry"], name: "index_comments_on_ancestry", using: :btree - t.index ["cached_votes_down"], name: "index_comments_on_cached_votes_down", using: :btree - t.index ["cached_votes_total"], name: "index_comments_on_cached_votes_total", using: :btree - t.index ["cached_votes_up"], name: "index_comments_on_cached_votes_up", using: :btree - t.index ["commentable_id", "commentable_type"], name: "index_comments_on_commentable_id_and_commentable_type", using: :btree - t.index ["hidden_at"], name: "index_comments_on_hidden_at", using: :btree - t.index ["user_id"], name: "index_comments_on_user_id", using: :btree - t.index ["valuation"], name: "index_comments_on_valuation", using: :btree + t.string "ancestry" + t.integer "confidence_score", default: 0, null: false + t.boolean "valuation", default: false + t.index ["ancestry"], name: "index_comments_on_ancestry" + t.index ["cached_votes_down"], name: "index_comments_on_cached_votes_down" + t.index ["cached_votes_total"], name: "index_comments_on_cached_votes_total" + t.index ["cached_votes_up"], name: "index_comments_on_cached_votes_up" + t.index ["commentable_id", "commentable_type"], name: "index_comments_on_commentable_id_and_commentable_type" + t.index ["hidden_at"], name: "index_comments_on_hidden_at" + t.index ["user_id"], name: "index_comments_on_user_id" + t.index ["valuation"], name: "index_comments_on_valuation" end - create_table "communities", force: :cascade do |t| + create_table "communities", id: :serial, force: :cascade do |t| t.datetime "created_at", null: false t.datetime "updated_at", null: false end - create_table "dashboard_actions", force: :cascade do |t| - t.string "title", limit: 80 - t.text "description" - t.string "link" - t.boolean "request_to_administrators", default: false - t.integer "day_offset", default: 0 - t.integer "required_supports", default: 0 - t.integer "order", default: 0 - t.boolean "active", default: true + create_table "dashboard_actions", id: :serial, force: :cascade do |t| + t.string "title", limit: 80 + t.text "description" + t.string "link" + t.boolean "request_to_administrators", default: false + t.integer "day_offset", default: 0 + t.integer "required_supports", default: 0 + t.integer "order", default: 0 + t.boolean "active", default: true t.datetime "hidden_at" - t.integer "action_type", default: 0, null: false - t.string "short_description" + t.integer "action_type", default: 0, null: false + t.string "short_description" t.datetime "created_at" t.datetime "updated_at" - t.boolean "published_proposal", default: false + t.boolean "published_proposal", default: false end - create_table "dashboard_administrator_tasks", force: :cascade do |t| - t.string "source_type" - t.integer "source_id" - t.integer "user_id" + create_table "dashboard_administrator_tasks", id: :serial, force: :cascade do |t| + t.string "source_type" + t.integer "source_id" + t.integer "user_id" t.datetime "executed_at" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["source_type", "source_id"], name: "index_dashboard_administrator_tasks_on_source", using: :btree - t.index ["user_id"], name: "index_dashboard_administrator_tasks_on_user_id", using: :btree + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["source_type", "source_id"], name: "index_dashboard_administrator_tasks_on_source" + t.index ["user_id"], name: "index_dashboard_administrator_tasks_on_user_id" end - create_table "dashboard_executed_actions", force: :cascade do |t| - t.integer "proposal_id" - t.integer "action_id" + create_table "dashboard_executed_actions", id: :serial, force: :cascade do |t| + t.integer "proposal_id" + t.integer "action_id" t.datetime "executed_at" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["action_id"], name: "index_proposal_action", using: :btree - t.index ["proposal_id"], name: "index_dashboard_executed_actions_on_proposal_id", using: :btree + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["action_id"], name: "index_proposal_action" + t.index ["proposal_id"], name: "index_dashboard_executed_actions_on_proposal_id" end - create_table "debate_translations", force: :cascade do |t| - t.integer "debate_id", null: false - t.string "locale", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "title" - t.text "description" + create_table "debate_translations", id: :serial, force: :cascade do |t| + t.integer "debate_id", null: false + t.string "locale", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "title" + t.text "description" t.datetime "hidden_at" - t.index ["debate_id"], name: "index_debate_translations_on_debate_id", using: :btree - t.index ["hidden_at"], name: "index_debate_translations_on_hidden_at", using: :btree - t.index ["locale"], name: "index_debate_translations_on_locale", using: :btree + t.index ["debate_id"], name: "index_debate_translations_on_debate_id" + t.index ["hidden_at"], name: "index_debate_translations_on_hidden_at" + t.index ["locale"], name: "index_debate_translations_on_locale" end - create_table "debates", force: :cascade do |t| - t.string "deprecated_title", limit: 80 - t.text "deprecated_description" - t.integer "author_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "visit_id" + create_table "debates", id: :serial, force: :cascade do |t| + t.string "deprecated_title", limit: 80 + t.text "deprecated_description" + t.integer "author_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "visit_id" t.datetime "hidden_at" - t.integer "flags_count", default: 0 + t.integer "flags_count", default: 0 t.datetime "ignored_flag_at" - t.integer "cached_votes_total", default: 0 - t.integer "cached_votes_up", default: 0 - t.integer "cached_votes_down", default: 0 - t.integer "comments_count", default: 0 + t.integer "cached_votes_total", default: 0 + t.integer "cached_votes_up", default: 0 + t.integer "cached_votes_down", default: 0 + t.integer "comments_count", default: 0 t.datetime "confirmed_hide_at" - t.integer "cached_anonymous_votes_total", default: 0 - t.integer "cached_votes_score", default: 0 - t.bigint "hot_score", default: 0 - t.integer "confidence_score", default: 0 - t.integer "geozone_id" + t.integer "cached_anonymous_votes_total", default: 0 + t.integer "cached_votes_score", default: 0 + t.bigint "hot_score", default: 0 + t.integer "confidence_score", default: 0 + t.integer "geozone_id" t.tsvector "tsv" t.datetime "featured_at" - t.index ["author_id", "hidden_at"], name: "index_debates_on_author_id_and_hidden_at", using: :btree - t.index ["author_id"], name: "index_debates_on_author_id", using: :btree - t.index ["cached_votes_down"], name: "index_debates_on_cached_votes_down", using: :btree - t.index ["cached_votes_score"], name: "index_debates_on_cached_votes_score", using: :btree - t.index ["cached_votes_total"], name: "index_debates_on_cached_votes_total", using: :btree - t.index ["cached_votes_up"], name: "index_debates_on_cached_votes_up", using: :btree - t.index ["confidence_score"], name: "index_debates_on_confidence_score", using: :btree - t.index ["geozone_id"], name: "index_debates_on_geozone_id", using: :btree - t.index ["hidden_at"], name: "index_debates_on_hidden_at", using: :btree - t.index ["hot_score"], name: "index_debates_on_hot_score", using: :btree + t.index ["author_id", "hidden_at"], name: "index_debates_on_author_id_and_hidden_at" + t.index ["author_id"], name: "index_debates_on_author_id" + t.index ["cached_votes_down"], name: "index_debates_on_cached_votes_down" + t.index ["cached_votes_score"], name: "index_debates_on_cached_votes_score" + t.index ["cached_votes_total"], name: "index_debates_on_cached_votes_total" + t.index ["cached_votes_up"], name: "index_debates_on_cached_votes_up" + t.index ["confidence_score"], name: "index_debates_on_confidence_score" + t.index ["geozone_id"], name: "index_debates_on_geozone_id" + t.index ["hidden_at"], name: "index_debates_on_hidden_at" + t.index ["hot_score"], name: "index_debates_on_hot_score" t.index ["tsv"], name: "index_debates_on_tsv", using: :gin end - create_table "delayed_jobs", force: :cascade do |t| - t.integer "priority", default: 0, null: false - t.integer "attempts", default: 0, null: false - t.text "handler", null: false - t.text "last_error" + create_table "delayed_jobs", id: :serial, force: :cascade do |t| + t.integer "priority", default: 0, null: false + t.integer "attempts", default: 0, null: false + t.text "handler", null: false + t.text "last_error" t.datetime "run_at" t.datetime "locked_at" t.datetime "failed_at" - t.string "locked_by" - t.string "queue" + t.string "locked_by" + t.string "queue" t.datetime "created_at" t.datetime "updated_at" - t.index ["priority", "run_at"], name: "delayed_jobs_priority", using: :btree + t.index ["priority", "run_at"], name: "delayed_jobs_priority" end - create_table "direct_messages", force: :cascade do |t| - t.integer "sender_id" - t.integer "receiver_id" - t.string "title" - t.text "body" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + create_table "direct_messages", id: :serial, force: :cascade do |t| + t.integer "sender_id" + t.integer "receiver_id" + t.string "title" + t.text "body" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - create_table "documents", force: :cascade do |t| - t.string "title" - t.string "attachment_file_name" - t.string "attachment_content_type" - t.integer "attachment_file_size" + create_table "documents", id: :serial, force: :cascade do |t| + t.string "title" + t.string "attachment_file_name" + t.string "attachment_content_type" + t.integer "attachment_file_size" t.datetime "attachment_updated_at" - t.integer "user_id" - t.string "documentable_type" - t.integer "documentable_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.boolean "admin", default: false - t.index ["documentable_type", "documentable_id"], name: "index_documents_on_documentable_type_and_documentable_id", using: :btree - t.index ["user_id", "documentable_type", "documentable_id"], name: "access_documents", using: :btree - t.index ["user_id"], name: "index_documents_on_user_id", using: :btree + t.integer "user_id" + t.string "documentable_type" + t.integer "documentable_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.boolean "admin", default: false + t.index ["documentable_type", "documentable_id"], name: "index_documents_on_documentable_type_and_documentable_id" + t.index ["user_id", "documentable_type", "documentable_id"], name: "access_documents" + t.index ["user_id"], name: "index_documents_on_user_id" end - create_table "failed_census_calls", force: :cascade do |t| - t.integer "user_id" - t.string "document_number" - t.string "document_type" - t.date "date_of_birth" - t.string "postal_code" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "district_code" - t.integer "poll_officer_id" - t.integer "year_of_birth" - t.index ["user_id"], name: "index_failed_census_calls_on_user_id", using: :btree + create_table "failed_census_calls", id: :serial, force: :cascade do |t| + t.integer "user_id" + t.string "document_number" + t.string "document_type" + t.date "date_of_birth" + t.string "postal_code" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "district_code" + t.integer "poll_officer_id" + t.integer "year_of_birth" + t.index ["user_id"], name: "index_failed_census_calls_on_user_id" end - create_table "flags", force: :cascade do |t| - t.integer "user_id" - t.string "flaggable_type" - t.integer "flaggable_id" + create_table "flags", id: :serial, force: :cascade do |t| + t.integer "user_id" + t.string "flaggable_type" + t.integer "flaggable_id" t.datetime "created_at" t.datetime "updated_at" - t.index ["flaggable_type", "flaggable_id"], name: "index_flags_on_flaggable_type_and_flaggable_id", using: :btree - t.index ["user_id", "flaggable_type", "flaggable_id"], name: "access_inappropiate_flags", using: :btree - t.index ["user_id"], name: "index_flags_on_user_id", using: :btree + t.index ["flaggable_type", "flaggable_id"], name: "index_flags_on_flaggable_type_and_flaggable_id" + t.index ["user_id", "flaggable_type", "flaggable_id"], name: "access_inappropiate_flags" + t.index ["user_id"], name: "index_flags_on_user_id" end - create_table "follows", force: :cascade do |t| - t.integer "user_id" - t.string "followable_type" - t.integer "followable_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["followable_type", "followable_id"], name: "index_follows_on_followable_type_and_followable_id", using: :btree - t.index ["user_id", "followable_type", "followable_id"], name: "access_follows", using: :btree - t.index ["user_id"], name: "index_follows_on_user_id", using: :btree + create_table "follows", id: :serial, force: :cascade do |t| + t.integer "user_id" + t.string "followable_type" + t.integer "followable_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["followable_type", "followable_id"], name: "index_follows_on_followable_type_and_followable_id" + t.index ["user_id", "followable_type", "followable_id"], name: "access_follows" + t.index ["user_id"], name: "index_follows_on_user_id" end - create_table "geozones", force: :cascade do |t| - t.string "name" - t.string "html_map_coordinates" - t.string "external_code" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "census_code" + create_table "geozones", id: :serial, force: :cascade do |t| + t.string "name" + t.string "html_map_coordinates" + t.string "external_code" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "census_code" end - create_table "geozones_polls", force: :cascade do |t| + create_table "geozones_polls", id: :serial, force: :cascade do |t| t.integer "geozone_id" t.integer "poll_id" - t.index ["geozone_id"], name: "index_geozones_polls_on_geozone_id", using: :btree - t.index ["poll_id"], name: "index_geozones_polls_on_poll_id", using: :btree + t.index ["geozone_id"], name: "index_geozones_polls_on_geozone_id" + t.index ["poll_id"], name: "index_geozones_polls_on_poll_id" end - create_table "i18n_content_translations", force: :cascade do |t| - t.integer "i18n_content_id", null: false - t.string "locale", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.text "value" - t.index ["i18n_content_id"], name: "index_i18n_content_translations_on_i18n_content_id", using: :btree - t.index ["locale"], name: "index_i18n_content_translations_on_locale", using: :btree + create_table "i18n_content_translations", id: :serial, force: :cascade do |t| + t.integer "i18n_content_id", null: false + t.string "locale", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.text "value" + t.index ["i18n_content_id"], name: "index_i18n_content_translations_on_i18n_content_id" + t.index ["locale"], name: "index_i18n_content_translations_on_locale" end - create_table "i18n_contents", force: :cascade do |t| + create_table "i18n_contents", id: :serial, force: :cascade do |t| t.string "key" end - create_table "identities", force: :cascade do |t| - t.integer "user_id" - t.string "provider" - t.string "uid" + create_table "identities", id: :serial, force: :cascade do |t| + t.integer "user_id" + t.string "provider" + t.string "uid" t.datetime "created_at", null: false t.datetime "updated_at", null: false - t.index ["user_id"], name: "index_identities_on_user_id", using: :btree + t.index ["user_id"], name: "index_identities_on_user_id" end - create_table "images", force: :cascade do |t| - t.string "imageable_type" - t.integer "imageable_id" - t.string "title", limit: 80 - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "attachment_file_name" - t.string "attachment_content_type" - t.integer "attachment_file_size" + create_table "images", id: :serial, force: :cascade do |t| + t.string "imageable_type" + t.integer "imageable_id" + t.string "title", limit: 80 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "attachment_file_name" + t.string "attachment_content_type" + t.integer "attachment_file_size" t.datetime "attachment_updated_at" - t.integer "user_id" - t.index ["imageable_type", "imageable_id"], name: "index_images_on_imageable_type_and_imageable_id", using: :btree - t.index ["user_id"], name: "index_images_on_user_id", using: :btree - end - - create_table "legislation_annotations", force: :cascade do |t| - t.string "quote" - t.text "ranges" - t.text "text" - t.integer "legislation_draft_version_id" - t.integer "author_id" - t.datetime "hidden_at" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.integer "comments_count", default: 0 - t.string "range_start" - t.integer "range_start_offset" - t.string "range_end" - t.integer "range_end_offset" - t.text "context" - t.index ["author_id"], name: "index_legislation_annotations_on_author_id", using: :btree - t.index ["hidden_at"], name: "index_legislation_annotations_on_hidden_at", using: :btree - t.index ["legislation_draft_version_id"], name: "index_legislation_annotations_on_legislation_draft_version_id", using: :btree - t.index ["range_start", "range_end"], name: "index_legislation_annotations_on_range_start_and_range_end", using: :btree - end - - create_table "legislation_answers", force: :cascade do |t| - t.integer "legislation_question_id" - t.integer "legislation_question_option_id" - t.integer "user_id" - t.datetime "hidden_at" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["hidden_at"], name: "index_legislation_answers_on_hidden_at", using: :btree - t.index ["legislation_question_id"], name: "index_legislation_answers_on_legislation_question_id", using: :btree - t.index ["legislation_question_option_id"], name: "index_legislation_answers_on_legislation_question_option_id", using: :btree - t.index ["user_id"], name: "index_legislation_answers_on_user_id", using: :btree - end - - create_table "legislation_draft_version_translations", force: :cascade do |t| - t.integer "legislation_draft_version_id", null: false - t.string "locale", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "title" - t.text "changelog" - t.text "body" - t.datetime "hidden_at" - t.index ["hidden_at"], name: "index_legislation_draft_version_translations_on_hidden_at", using: :btree - t.index ["legislation_draft_version_id"], name: "index_900e5ba94457606e69e89193db426e8ddff809bc", using: :btree - t.index ["locale"], name: "index_legislation_draft_version_translations_on_locale", using: :btree - end - - create_table "legislation_draft_versions", force: :cascade do |t| - t.integer "legislation_process_id" - t.string "status", default: "draft" - t.boolean "final_version", default: false - t.datetime "hidden_at" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["hidden_at"], name: "index_legislation_draft_versions_on_hidden_at", using: :btree - t.index ["legislation_process_id"], name: "index_legislation_draft_versions_on_legislation_process_id", using: :btree - t.index ["status"], name: "index_legislation_draft_versions_on_status", using: :btree - end - - create_table "legislation_process_translations", force: :cascade do |t| - t.integer "legislation_process_id", null: false - t.string "locale", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "title" - t.text "summary" - t.text "description" - t.text "additional_info" - t.text "milestones_summary" - t.text "homepage" - t.datetime "hidden_at" - t.index ["hidden_at"], name: "index_legislation_process_translations_on_hidden_at", using: :btree - t.index ["legislation_process_id"], name: "index_199e5fed0aca73302243f6a1fca885ce10cdbb55", using: :btree - t.index ["locale"], name: "index_legislation_process_translations_on_locale", using: :btree - end - - create_table "legislation_processes", force: :cascade do |t| - t.date "start_date" - t.date "end_date" - t.date "debate_start_date" - t.date "debate_end_date" - t.date "draft_publication_date" - t.date "allegations_start_date" - t.date "allegations_end_date" - t.date "result_publication_date" - t.datetime "hidden_at" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.boolean "debate_phase_enabled", default: false - t.boolean "allegations_phase_enabled", default: false - t.boolean "draft_publication_enabled", default: false - t.boolean "result_publication_enabled", default: false - t.boolean "published", default: true - t.date "proposals_phase_start_date" - t.date "proposals_phase_end_date" - t.boolean "proposals_phase_enabled" - t.text "proposals_description" - t.date "draft_start_date" - t.date "draft_end_date" - t.boolean "draft_phase_enabled", default: false - t.boolean "homepage_enabled", default: false - t.text "background_color" - t.text "font_color" - t.index ["allegations_end_date"], name: "index_legislation_processes_on_allegations_end_date", using: :btree - t.index ["allegations_start_date"], name: "index_legislation_processes_on_allegations_start_date", using: :btree - t.index ["debate_end_date"], name: "index_legislation_processes_on_debate_end_date", using: :btree - t.index ["debate_start_date"], name: "index_legislation_processes_on_debate_start_date", using: :btree - t.index ["draft_end_date"], name: "index_legislation_processes_on_draft_end_date", using: :btree - t.index ["draft_publication_date"], name: "index_legislation_processes_on_draft_publication_date", using: :btree - t.index ["draft_start_date"], name: "index_legislation_processes_on_draft_start_date", using: :btree - t.index ["end_date"], name: "index_legislation_processes_on_end_date", using: :btree - t.index ["hidden_at"], name: "index_legislation_processes_on_hidden_at", using: :btree - t.index ["result_publication_date"], name: "index_legislation_processes_on_result_publication_date", using: :btree - t.index ["start_date"], name: "index_legislation_processes_on_start_date", using: :btree - end - - create_table "legislation_proposals", force: :cascade do |t| - t.integer "legislation_process_id" - t.string "title", limit: 80 - t.text "description" - t.integer "author_id" - t.datetime "hidden_at" - t.integer "flags_count", default: 0 - t.datetime "ignored_flag_at" - t.integer "cached_votes_up", default: 0 - t.integer "comments_count", default: 0 - t.datetime "confirmed_hide_at" - t.bigint "hot_score", default: 0 - t.integer "confidence_score", default: 0 - t.string "responsible_name", limit: 60 - t.text "summary" - t.string "video_url" - t.tsvector "tsv" - t.integer "geozone_id" - t.datetime "retired_at" - t.string "retired_reason" - t.text "retired_explanation" - t.integer "community_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.integer "cached_votes_total", default: 0 - t.integer "cached_votes_down", default: 0 - t.boolean "selected" - t.integer "cached_votes_score", default: 0 - t.index ["cached_votes_score"], name: "index_legislation_proposals_on_cached_votes_score", using: :btree - t.index ["legislation_process_id"], name: "index_legislation_proposals_on_legislation_process_id", using: :btree - end - - create_table "legislation_question_option_translations", force: :cascade do |t| - t.integer "legislation_question_option_id", null: false - t.string "locale", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "value" - t.datetime "hidden_at" - t.index ["hidden_at"], name: "index_legislation_question_option_translations_on_hidden_at", using: :btree - t.index ["legislation_question_option_id"], name: "index_61bcec8729110b7f8e1e9e5ce08780878597a209", using: :btree - t.index ["locale"], name: "index_legislation_question_option_translations_on_locale", using: :btree - end - - create_table "legislation_question_options", force: :cascade do |t| - t.integer "legislation_question_id" - t.integer "answers_count", default: 0 - t.datetime "hidden_at" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["hidden_at"], name: "index_legislation_question_options_on_hidden_at", using: :btree - t.index ["legislation_question_id"], name: "index_legislation_question_options_on_legislation_question_id", using: :btree - end - - create_table "legislation_question_translations", force: :cascade do |t| - t.integer "legislation_question_id", null: false - t.string "locale", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.text "title" - t.datetime "hidden_at" - t.index ["hidden_at"], name: "index_legislation_question_translations_on_hidden_at", using: :btree - t.index ["legislation_question_id"], name: "index_d34cc1e1fe6d5162210c41ce56533c5afabcdbd3", using: :btree - t.index ["locale"], name: "index_legislation_question_translations_on_locale", using: :btree - end - - create_table "legislation_questions", force: :cascade do |t| - t.integer "legislation_process_id" - t.integer "answers_count", default: 0 - t.datetime "hidden_at" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.integer "comments_count", default: 0 - t.integer "author_id" - t.index ["hidden_at"], name: "index_legislation_questions_on_hidden_at", using: :btree - t.index ["legislation_process_id"], name: "index_legislation_questions_on_legislation_process_id", using: :btree - end - - create_table "links", force: :cascade do |t| - t.string "label" - t.string "url" - t.string "linkable_type" - t.integer "linkable_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["linkable_type", "linkable_id"], name: "index_links_on_linkable_type_and_linkable_id", using: :btree - end - - create_table "local_census_records", force: :cascade do |t| - t.string "document_number", null: false - t.string "document_type", null: false - t.date "date_of_birth", null: false - t.string "postal_code", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["document_number", "document_type"], name: "index_local_census_records_on_document_number_and_document_type", unique: true, using: :btree - t.index ["document_number"], name: "index_local_census_records_on_document_number", using: :btree - end - - create_table "locks", force: :cascade do |t| - t.integer "user_id" - t.integer "tries", default: 0 - t.datetime "locked_until", default: '2000-01-01 01:01:01', null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["user_id"], name: "index_locks_on_user_id", using: :btree - end - - create_table "managers", force: :cascade do |t| t.integer "user_id" - t.index ["user_id"], name: "index_managers_on_user_id", using: :btree + t.index ["imageable_type", "imageable_id"], name: "index_images_on_imageable_type_and_imageable_id" + t.index ["user_id"], name: "index_images_on_user_id" end - create_table "map_locations", force: :cascade do |t| - t.float "latitude" - t.float "longitude" + create_table "legislation_annotations", id: :serial, force: :cascade do |t| + t.string "quote" + t.text "ranges" + t.text "text" + t.integer "legislation_draft_version_id" + t.integer "author_id" + t.datetime "hidden_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "comments_count", default: 0 + t.string "range_start" + t.integer "range_start_offset" + t.string "range_end" + t.integer "range_end_offset" + t.text "context" + t.index ["author_id"], name: "index_legislation_annotations_on_author_id" + t.index ["hidden_at"], name: "index_legislation_annotations_on_hidden_at" + t.index ["legislation_draft_version_id"], name: "index_legislation_annotations_on_legislation_draft_version_id" + t.index ["range_start", "range_end"], name: "index_legislation_annotations_on_range_start_and_range_end" + end + + create_table "legislation_answers", id: :serial, force: :cascade do |t| + t.integer "legislation_question_id" + t.integer "legislation_question_option_id" + t.integer "user_id" + t.datetime "hidden_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["hidden_at"], name: "index_legislation_answers_on_hidden_at" + t.index ["legislation_question_id"], name: "index_legislation_answers_on_legislation_question_id" + t.index ["legislation_question_option_id"], name: "index_legislation_answers_on_legislation_question_option_id" + t.index ["user_id"], name: "index_legislation_answers_on_user_id" + end + + create_table "legislation_draft_version_translations", id: :serial, force: :cascade do |t| + t.integer "legislation_draft_version_id", null: false + t.string "locale", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "title" + t.text "changelog" + t.text "body" + t.datetime "hidden_at" + t.index ["hidden_at"], name: "index_legislation_draft_version_translations_on_hidden_at" + t.index ["legislation_draft_version_id"], name: "index_900e5ba94457606e69e89193db426e8ddff809bc" + t.index ["locale"], name: "index_legislation_draft_version_translations_on_locale" + end + + create_table "legislation_draft_versions", id: :serial, force: :cascade do |t| + t.integer "legislation_process_id" + t.string "status", default: "draft" + t.boolean "final_version", default: false + t.datetime "hidden_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["hidden_at"], name: "index_legislation_draft_versions_on_hidden_at" + t.index ["legislation_process_id"], name: "index_legislation_draft_versions_on_legislation_process_id" + t.index ["status"], name: "index_legislation_draft_versions_on_status" + end + + create_table "legislation_process_translations", id: :serial, force: :cascade do |t| + t.integer "legislation_process_id", null: false + t.string "locale", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "title" + t.text "summary" + t.text "description" + t.text "additional_info" + t.text "milestones_summary" + t.text "homepage" + t.datetime "hidden_at" + t.index ["hidden_at"], name: "index_legislation_process_translations_on_hidden_at" + t.index ["legislation_process_id"], name: "index_199e5fed0aca73302243f6a1fca885ce10cdbb55" + t.index ["locale"], name: "index_legislation_process_translations_on_locale" + end + + create_table "legislation_processes", id: :serial, force: :cascade do |t| + t.date "start_date" + t.date "end_date" + t.date "debate_start_date" + t.date "debate_end_date" + t.date "draft_publication_date" + t.date "allegations_start_date" + t.date "allegations_end_date" + t.date "result_publication_date" + t.datetime "hidden_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.boolean "debate_phase_enabled", default: false + t.boolean "allegations_phase_enabled", default: false + t.boolean "draft_publication_enabled", default: false + t.boolean "result_publication_enabled", default: false + t.boolean "published", default: true + t.date "proposals_phase_start_date" + t.date "proposals_phase_end_date" + t.boolean "proposals_phase_enabled" + t.text "proposals_description" + t.date "draft_start_date" + t.date "draft_end_date" + t.boolean "draft_phase_enabled", default: false + t.boolean "homepage_enabled", default: false + t.text "background_color" + t.text "font_color" + t.index ["allegations_end_date"], name: "index_legislation_processes_on_allegations_end_date" + t.index ["allegations_start_date"], name: "index_legislation_processes_on_allegations_start_date" + t.index ["debate_end_date"], name: "index_legislation_processes_on_debate_end_date" + t.index ["debate_start_date"], name: "index_legislation_processes_on_debate_start_date" + t.index ["draft_end_date"], name: "index_legislation_processes_on_draft_end_date" + t.index ["draft_publication_date"], name: "index_legislation_processes_on_draft_publication_date" + t.index ["draft_start_date"], name: "index_legislation_processes_on_draft_start_date" + t.index ["end_date"], name: "index_legislation_processes_on_end_date" + t.index ["hidden_at"], name: "index_legislation_processes_on_hidden_at" + t.index ["result_publication_date"], name: "index_legislation_processes_on_result_publication_date" + t.index ["start_date"], name: "index_legislation_processes_on_start_date" + end + + create_table "legislation_proposals", id: :serial, force: :cascade do |t| + t.integer "legislation_process_id" + t.string "title", limit: 80 + t.text "description" + t.integer "author_id" + t.datetime "hidden_at" + t.integer "flags_count", default: 0 + t.datetime "ignored_flag_at" + t.integer "cached_votes_up", default: 0 + t.integer "comments_count", default: 0 + t.datetime "confirmed_hide_at" + t.bigint "hot_score", default: 0 + t.integer "confidence_score", default: 0 + t.string "responsible_name", limit: 60 + t.text "summary" + t.string "video_url" + t.tsvector "tsv" + t.integer "geozone_id" + t.datetime "retired_at" + t.string "retired_reason" + t.text "retired_explanation" + t.integer "community_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "cached_votes_total", default: 0 + t.integer "cached_votes_down", default: 0 + t.boolean "selected" + t.integer "cached_votes_score", default: 0 + t.index ["cached_votes_score"], name: "index_legislation_proposals_on_cached_votes_score" + t.index ["legislation_process_id"], name: "index_legislation_proposals_on_legislation_process_id" + end + + create_table "legislation_question_option_translations", id: :serial, force: :cascade do |t| + t.integer "legislation_question_option_id", null: false + t.string "locale", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "value" + t.datetime "hidden_at" + t.index ["hidden_at"], name: "index_legislation_question_option_translations_on_hidden_at" + t.index ["legislation_question_option_id"], name: "index_61bcec8729110b7f8e1e9e5ce08780878597a209" + t.index ["locale"], name: "index_legislation_question_option_translations_on_locale" + end + + create_table "legislation_question_options", id: :serial, force: :cascade do |t| + t.integer "legislation_question_id" + t.integer "answers_count", default: 0 + t.datetime "hidden_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["hidden_at"], name: "index_legislation_question_options_on_hidden_at" + t.index ["legislation_question_id"], name: "index_legislation_question_options_on_legislation_question_id" + end + + create_table "legislation_question_translations", id: :serial, force: :cascade do |t| + t.integer "legislation_question_id", null: false + t.string "locale", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.text "title" + t.datetime "hidden_at" + t.index ["hidden_at"], name: "index_legislation_question_translations_on_hidden_at" + t.index ["legislation_question_id"], name: "index_d34cc1e1fe6d5162210c41ce56533c5afabcdbd3" + t.index ["locale"], name: "index_legislation_question_translations_on_locale" + end + + create_table "legislation_questions", id: :serial, force: :cascade do |t| + t.integer "legislation_process_id" + t.integer "answers_count", default: 0 + t.datetime "hidden_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "comments_count", default: 0 + t.integer "author_id" + t.index ["hidden_at"], name: "index_legislation_questions_on_hidden_at" + t.index ["legislation_process_id"], name: "index_legislation_questions_on_legislation_process_id" + end + + create_table "links", id: :serial, force: :cascade do |t| + t.string "label" + t.string "url" + t.string "linkable_type" + t.integer "linkable_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["linkable_type", "linkable_id"], name: "index_links_on_linkable_type_and_linkable_id" + end + + create_table "local_census_records", id: :serial, force: :cascade do |t| + t.string "document_number", null: false + t.string "document_type", null: false + t.date "date_of_birth", null: false + t.string "postal_code", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["document_number", "document_type"], name: "index_local_census_records_on_document_number_and_document_type", unique: true + t.index ["document_number"], name: "index_local_census_records_on_document_number" + end + + create_table "locks", id: :serial, force: :cascade do |t| + t.integer "user_id" + t.integer "tries", default: 0 + t.datetime "locked_until", default: "2000-01-01 01:01:01", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["user_id"], name: "index_locks_on_user_id" + end + + create_table "managers", id: :serial, force: :cascade do |t| + t.integer "user_id" + t.index ["user_id"], name: "index_managers_on_user_id" + end + + create_table "map_locations", id: :serial, force: :cascade do |t| + t.float "latitude" + t.float "longitude" t.integer "zoom" t.integer "proposal_id" t.integer "investment_id" - t.index ["investment_id"], name: "index_map_locations_on_investment_id", using: :btree - t.index ["proposal_id"], name: "index_map_locations_on_proposal_id", using: :btree + t.index ["investment_id"], name: "index_map_locations_on_investment_id" + t.index ["proposal_id"], name: "index_map_locations_on_proposal_id" end - create_table "milestone_statuses", force: :cascade do |t| - t.string "name" - t.text "description" + create_table "milestone_statuses", id: :serial, force: :cascade do |t| + t.string "name" + t.text "description" t.datetime "hidden_at" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["hidden_at"], name: "index_milestone_statuses_on_hidden_at", using: :btree - end - - create_table "milestone_translations", force: :cascade do |t| - t.integer "milestone_id", null: false - t.string "locale", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "title" - t.text "description" - t.index ["locale"], name: "index_milestone_translations_on_locale", using: :btree - t.index ["milestone_id"], name: "index_milestone_translations_on_milestone_id", using: :btree - end - - create_table "milestones", force: :cascade do |t| - t.string "milestoneable_type" - t.integer "milestoneable_id" - t.datetime "publication_date" - t.integer "status_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["status_id"], name: "index_milestones_on_status_id", using: :btree - end - - create_table "moderators", force: :cascade do |t| - t.integer "user_id" - t.index ["user_id"], name: "index_moderators_on_user_id", using: :btree - end - - create_table "newsletters", force: :cascade do |t| - t.string "subject" - t.string "segment_recipient", null: false - t.string "from" - t.text "body" - t.date "sent_at" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.datetime "hidden_at" - end - - create_table "notifications", force: :cascade do |t| - t.integer "user_id" - t.string "notifiable_type" - t.integer "notifiable_id" - t.integer "counter", default: 1 - t.datetime "emailed_at" - t.datetime "read_at" - t.index ["user_id"], name: "index_notifications_on_user_id", using: :btree - end - - create_table "organizations", force: :cascade do |t| - t.integer "user_id" - t.string "name", limit: 60 - t.datetime "verified_at" - t.datetime "rejected_at" - t.string "responsible_name", limit: 60 - t.index ["user_id"], name: "index_organizations_on_user_id", using: :btree - end - - create_table "poll_answers", force: :cascade do |t| - t.integer "question_id" - t.integer "author_id" - t.string "answer" - t.datetime "created_at" - t.datetime "updated_at" - t.index ["author_id"], name: "index_poll_answers_on_author_id", using: :btree - t.index ["question_id", "answer"], name: "index_poll_answers_on_question_id_and_answer", using: :btree - t.index ["question_id"], name: "index_poll_answers_on_question_id", using: :btree - end - - create_table "poll_ballot_sheets", force: :cascade do |t| - t.text "data" - t.integer "poll_id" - t.integer "officer_assignment_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["officer_assignment_id"], name: "index_poll_ballot_sheets_on_officer_assignment_id", using: :btree - t.index ["poll_id"], name: "index_poll_ballot_sheets_on_poll_id", using: :btree - end - - create_table "poll_ballots", force: :cascade do |t| - t.integer "ballot_sheet_id" - t.text "data" - t.integer "external_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - end - - create_table "poll_booth_assignments", force: :cascade do |t| - t.integer "booth_id" - t.integer "poll_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false - t.index ["booth_id"], name: "index_poll_booth_assignments_on_booth_id", using: :btree - t.index ["poll_id"], name: "index_poll_booth_assignments_on_poll_id", using: :btree + t.index ["hidden_at"], name: "index_milestone_statuses_on_hidden_at" end - create_table "poll_booths", force: :cascade do |t| + create_table "milestone_translations", id: :serial, force: :cascade do |t| + t.integer "milestone_id", null: false + t.string "locale", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "title" + t.text "description" + t.index ["locale"], name: "index_milestone_translations_on_locale" + t.index ["milestone_id"], name: "index_milestone_translations_on_milestone_id" + end + + create_table "milestones", id: :serial, force: :cascade do |t| + t.string "milestoneable_type" + t.integer "milestoneable_id" + t.datetime "publication_date" + t.integer "status_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["status_id"], name: "index_milestones_on_status_id" + end + + create_table "moderators", id: :serial, force: :cascade do |t| + t.integer "user_id" + t.index ["user_id"], name: "index_moderators_on_user_id" + end + + create_table "newsletters", id: :serial, force: :cascade do |t| + t.string "subject" + t.string "segment_recipient", null: false + t.string "from" + t.text "body" + t.date "sent_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.datetime "hidden_at" + end + + create_table "notifications", id: :serial, force: :cascade do |t| + t.integer "user_id" + t.string "notifiable_type" + t.integer "notifiable_id" + t.integer "counter", default: 1 + t.datetime "emailed_at" + t.datetime "read_at" + t.index ["user_id"], name: "index_notifications_on_user_id" + end + + create_table "organizations", id: :serial, force: :cascade do |t| + t.integer "user_id" + t.string "name", limit: 60 + t.datetime "verified_at" + t.datetime "rejected_at" + t.string "responsible_name", limit: 60 + t.index ["user_id"], name: "index_organizations_on_user_id" + end + + create_table "poll_answers", id: :serial, force: :cascade do |t| + t.integer "question_id" + t.integer "author_id" + t.string "answer" + t.datetime "created_at" + t.datetime "updated_at" + t.index ["author_id"], name: "index_poll_answers_on_author_id" + t.index ["question_id", "answer"], name: "index_poll_answers_on_question_id_and_answer" + t.index ["question_id"], name: "index_poll_answers_on_question_id" + end + + create_table "poll_ballot_sheets", id: :serial, force: :cascade do |t| + t.text "data" + t.integer "poll_id" + t.integer "officer_assignment_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["officer_assignment_id"], name: "index_poll_ballot_sheets_on_officer_assignment_id" + t.index ["poll_id"], name: "index_poll_ballot_sheets_on_poll_id" + end + + create_table "poll_ballots", id: :serial, force: :cascade do |t| + t.integer "ballot_sheet_id" + t.text "data" + t.integer "external_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "poll_booth_assignments", id: :serial, force: :cascade do |t| + t.integer "booth_id" + t.integer "poll_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["booth_id"], name: "index_poll_booth_assignments_on_booth_id" + t.index ["poll_id"], name: "index_poll_booth_assignments_on_poll_id" + end + + create_table "poll_booths", id: :serial, force: :cascade do |t| t.string "name" t.string "location" end - create_table "poll_officer_assignments", force: :cascade do |t| - t.integer "booth_assignment_id" - t.integer "officer_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.date "date", null: false - t.boolean "final", default: false - t.string "user_data_log", default: "" - t.index ["booth_assignment_id"], name: "index_poll_officer_assignments_on_booth_assignment_id", using: :btree - t.index ["officer_id"], name: "index_poll_officer_assignments_on_officer_id", using: :btree + create_table "poll_officer_assignments", id: :serial, force: :cascade do |t| + t.integer "booth_assignment_id" + t.integer "officer_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.date "date", null: false + t.boolean "final", default: false + t.string "user_data_log", default: "" + t.index ["booth_assignment_id"], name: "index_poll_officer_assignments_on_booth_assignment_id" + t.index ["officer_id"], name: "index_poll_officer_assignments_on_officer_id" end - create_table "poll_officers", force: :cascade do |t| + create_table "poll_officers", id: :serial, force: :cascade do |t| t.integer "user_id" t.integer "failed_census_calls_count", default: 0 - t.index ["user_id"], name: "index_poll_officers_on_user_id", using: :btree + t.index ["user_id"], name: "index_poll_officers_on_user_id" end - create_table "poll_partial_results", force: :cascade do |t| + create_table "poll_partial_results", id: :serial, force: :cascade do |t| t.integer "question_id" t.integer "author_id" - t.string "answer" + t.string "answer" t.integer "amount" - t.string "origin" - t.date "date" + t.string "origin" + t.date "date" t.integer "booth_assignment_id" t.integer "officer_assignment_id" - t.text "amount_log", default: "" - t.text "officer_assignment_id_log", default: "" - t.text "author_id_log", default: "" - t.index ["answer"], name: "index_poll_partial_results_on_answer", using: :btree - t.index ["author_id"], name: "index_poll_partial_results_on_author_id", using: :btree - t.index ["booth_assignment_id", "date"], name: "index_poll_partial_results_on_booth_assignment_id_and_date", using: :btree - t.index ["origin"], name: "index_poll_partial_results_on_origin", using: :btree - t.index ["question_id"], name: "index_poll_partial_results_on_question_id", using: :btree + t.text "amount_log", default: "" + t.text "officer_assignment_id_log", default: "" + t.text "author_id_log", default: "" + t.index ["answer"], name: "index_poll_partial_results_on_answer" + t.index ["author_id"], name: "index_poll_partial_results_on_author_id" + t.index ["booth_assignment_id", "date"], name: "index_poll_partial_results_on_booth_assignment_id_and_date" + t.index ["origin"], name: "index_poll_partial_results_on_origin" + t.index ["question_id"], name: "index_poll_partial_results_on_question_id" end - create_table "poll_question_answer_translations", force: :cascade do |t| - t.integer "poll_question_answer_id", null: false - t.string "locale", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "title" - t.text "description" - t.index ["locale"], name: "index_poll_question_answer_translations_on_locale", using: :btree - t.index ["poll_question_answer_id"], name: "index_85270fa85f62081a3a227186b4c95fe4f7fa94b9", using: :btree + create_table "poll_question_answer_translations", id: :serial, force: :cascade do |t| + t.integer "poll_question_answer_id", null: false + t.string "locale", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "title" + t.text "description" + t.index ["locale"], name: "index_poll_question_answer_translations_on_locale" + t.index ["poll_question_answer_id"], name: "index_85270fa85f62081a3a227186b4c95fe4f7fa94b9" end - create_table "poll_question_answer_videos", force: :cascade do |t| - t.string "title" - t.string "url" + create_table "poll_question_answer_videos", id: :serial, force: :cascade do |t| + t.string "title" + t.string "url" t.integer "answer_id" - t.index ["answer_id"], name: "index_poll_question_answer_videos_on_answer_id", using: :btree + t.index ["answer_id"], name: "index_poll_question_answer_videos_on_answer_id" end - create_table "poll_question_answers", force: :cascade do |t| + create_table "poll_question_answers", id: :serial, force: :cascade do |t| t.integer "question_id" t.integer "given_order", default: 1 - t.boolean "most_voted", default: false - t.index ["question_id"], name: "index_poll_question_answers_on_question_id", using: :btree + t.boolean "most_voted", default: false + t.index ["question_id"], name: "index_poll_question_answers_on_question_id" end - create_table "poll_question_translations", force: :cascade do |t| - t.integer "poll_question_id", null: false - t.string "locale", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "title" + create_table "poll_question_translations", id: :serial, force: :cascade do |t| + t.integer "poll_question_id", null: false + t.string "locale", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "title" t.datetime "hidden_at" - t.index ["hidden_at"], name: "index_poll_question_translations_on_hidden_at", using: :btree - t.index ["locale"], name: "index_poll_question_translations_on_locale", using: :btree - t.index ["poll_question_id"], name: "index_poll_question_translations_on_poll_question_id", using: :btree + t.index ["hidden_at"], name: "index_poll_question_translations_on_hidden_at" + t.index ["locale"], name: "index_poll_question_translations_on_locale" + t.index ["poll_question_id"], name: "index_poll_question_translations_on_poll_question_id" end - create_table "poll_questions", force: :cascade do |t| - t.integer "proposal_id" - t.integer "poll_id" - t.integer "author_id" - t.string "author_visible_name" - t.integer "comments_count" + create_table "poll_questions", id: :serial, force: :cascade do |t| + t.integer "proposal_id" + t.integer "poll_id" + t.integer "author_id" + t.string "author_visible_name" + t.integer "comments_count" t.datetime "hidden_at" t.datetime "created_at" t.datetime "updated_at" t.tsvector "tsv" - t.string "video_url" - t.index ["author_id"], name: "index_poll_questions_on_author_id", using: :btree - t.index ["poll_id"], name: "index_poll_questions_on_poll_id", using: :btree - t.index ["proposal_id"], name: "index_poll_questions_on_proposal_id", using: :btree + t.string "video_url" + t.index ["author_id"], name: "index_poll_questions_on_author_id" + t.index ["poll_id"], name: "index_poll_questions_on_poll_id" + t.index ["proposal_id"], name: "index_poll_questions_on_proposal_id" t.index ["tsv"], name: "index_poll_questions_on_tsv", using: :gin end - create_table "poll_recounts", force: :cascade do |t| + create_table "poll_recounts", id: :serial, force: :cascade do |t| t.integer "author_id" - t.string "origin" - t.date "date" + t.string "origin" + t.date "date" t.integer "booth_assignment_id" t.integer "officer_assignment_id" - t.text "officer_assignment_id_log", default: "" - t.text "author_id_log", default: "" - t.integer "white_amount", default: 0 - t.text "white_amount_log", default: "" - t.integer "null_amount", default: 0 - t.text "null_amount_log", default: "" - t.integer "total_amount", default: 0 - t.text "total_amount_log", default: "" - t.index ["booth_assignment_id"], name: "index_poll_recounts_on_booth_assignment_id", using: :btree - t.index ["officer_assignment_id"], name: "index_poll_recounts_on_officer_assignment_id", using: :btree + t.text "officer_assignment_id_log", default: "" + t.text "author_id_log", default: "" + t.integer "white_amount", default: 0 + t.text "white_amount_log", default: "" + t.integer "null_amount", default: 0 + t.text "null_amount_log", default: "" + t.integer "total_amount", default: 0 + t.text "total_amount_log", default: "" + t.index ["booth_assignment_id"], name: "index_poll_recounts_on_booth_assignment_id" + t.index ["officer_assignment_id"], name: "index_poll_recounts_on_officer_assignment_id" end - create_table "poll_shifts", force: :cascade do |t| - t.integer "booth_id" - t.integer "officer_id" - t.date "date" + create_table "poll_shifts", id: :serial, force: :cascade do |t| + t.integer "booth_id" + t.integer "officer_id" + t.date "date" t.datetime "created_at" t.datetime "updated_at" - t.string "officer_name" - t.string "officer_email" - t.integer "task", default: 0, null: false - t.index ["booth_id", "officer_id", "date", "task"], name: "index_poll_shifts_on_booth_id_and_officer_id_and_date_and_task", unique: true, using: :btree - t.index ["booth_id"], name: "index_poll_shifts_on_booth_id", using: :btree - t.index ["officer_id"], name: "index_poll_shifts_on_officer_id", using: :btree + t.string "officer_name" + t.string "officer_email" + t.integer "task", default: 0, null: false + t.index ["booth_id", "officer_id", "date", "task"], name: "index_poll_shifts_on_booth_id_and_officer_id_and_date_and_task", unique: true + t.index ["booth_id"], name: "index_poll_shifts_on_booth_id" + t.index ["officer_id"], name: "index_poll_shifts_on_officer_id" end - create_table "poll_translations", force: :cascade do |t| - t.integer "poll_id", null: false - t.string "locale", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "name" - t.text "summary" - t.text "description" + create_table "poll_translations", id: :serial, force: :cascade do |t| + t.integer "poll_id", null: false + t.string "locale", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "name" + t.text "summary" + t.text "description" t.datetime "hidden_at" - t.index ["hidden_at"], name: "index_poll_translations_on_hidden_at", using: :btree - t.index ["locale"], name: "index_poll_translations_on_locale", using: :btree - t.index ["poll_id"], name: "index_poll_translations_on_poll_id", using: :btree + t.index ["hidden_at"], name: "index_poll_translations_on_hidden_at" + t.index ["locale"], name: "index_poll_translations_on_locale" + t.index ["poll_id"], name: "index_poll_translations_on_poll_id" end - create_table "poll_voters", force: :cascade do |t| - t.string "document_number" - t.string "document_type" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.integer "poll_id", null: false - t.integer "booth_assignment_id" - t.integer "age" - t.string "gender" - t.integer "geozone_id" - t.integer "answer_id" - t.integer "officer_assignment_id" - t.integer "user_id" - t.string "origin" - t.integer "officer_id" - t.string "token" - t.index ["booth_assignment_id"], name: "index_poll_voters_on_booth_assignment_id", using: :btree - t.index ["document_number"], name: "index_poll_voters_on_document_number", using: :btree - t.index ["officer_assignment_id"], name: "index_poll_voters_on_officer_assignment_id", using: :btree - t.index ["poll_id", "document_number", "document_type"], name: "doc_by_poll", using: :btree - t.index ["poll_id"], name: "index_poll_voters_on_poll_id", using: :btree - t.index ["user_id"], name: "index_poll_voters_on_user_id", using: :btree + create_table "poll_voters", id: :serial, force: :cascade do |t| + t.string "document_number" + t.string "document_type" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "poll_id", null: false + t.integer "booth_assignment_id" + t.integer "age" + t.string "gender" + t.integer "geozone_id" + t.integer "answer_id" + t.integer "officer_assignment_id" + t.integer "user_id" + t.string "origin" + t.integer "officer_id" + t.string "token" + t.index ["booth_assignment_id"], name: "index_poll_voters_on_booth_assignment_id" + t.index ["document_number"], name: "index_poll_voters_on_document_number" + t.index ["officer_assignment_id"], name: "index_poll_voters_on_officer_assignment_id" + t.index ["poll_id", "document_number", "document_type"], name: "doc_by_poll" + t.index ["poll_id"], name: "index_poll_voters_on_poll_id" + t.index ["user_id"], name: "index_poll_voters_on_user_id" end - create_table "polls", force: :cascade do |t| + create_table "polls", id: :serial, force: :cascade do |t| t.datetime "starts_at" t.datetime "ends_at" - t.boolean "published", default: false - t.boolean "geozone_restricted", default: false - t.integer "comments_count", default: 0 - t.integer "author_id" + t.boolean "published", default: false + t.boolean "geozone_restricted", default: false + t.integer "comments_count", default: 0 + t.integer "author_id" t.datetime "hidden_at" - t.string "slug" + t.string "slug" t.datetime "created_at" t.datetime "updated_at" - t.integer "budget_id" - t.string "related_type" - t.integer "related_id" - t.index ["budget_id"], name: "index_polls_on_budget_id", unique: true, using: :btree - t.index ["related_type", "related_id"], name: "index_polls_on_related_type_and_related_id", using: :btree - t.index ["starts_at", "ends_at"], name: "index_polls_on_starts_at_and_ends_at", using: :btree + t.integer "budget_id" + t.string "related_type" + t.integer "related_id" + t.index ["budget_id"], name: "index_polls_on_budget_id", unique: true + t.index ["related_type", "related_id"], name: "index_polls_on_related_type_and_related_id" + t.index ["starts_at", "ends_at"], name: "index_polls_on_starts_at_and_ends_at" end - create_table "progress_bar_translations", force: :cascade do |t| - t.integer "progress_bar_id", null: false - t.string "locale", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "title" - t.index ["locale"], name: "index_progress_bar_translations_on_locale", using: :btree - t.index ["progress_bar_id"], name: "index_progress_bar_translations_on_progress_bar_id", using: :btree + create_table "progress_bar_translations", id: :serial, force: :cascade do |t| + t.integer "progress_bar_id", null: false + t.string "locale", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "title" + t.index ["locale"], name: "index_progress_bar_translations_on_locale" + t.index ["progress_bar_id"], name: "index_progress_bar_translations_on_progress_bar_id" end - create_table "progress_bars", force: :cascade do |t| - t.integer "kind" - t.integer "percentage" - t.string "progressable_type" - t.integer "progressable_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + create_table "progress_bars", id: :serial, force: :cascade do |t| + t.integer "kind" + t.integer "percentage" + t.string "progressable_type" + t.integer "progressable_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - create_table "proposal_notifications", force: :cascade do |t| - t.string "title" - t.text "body" - t.integer "author_id" - t.integer "proposal_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.boolean "moderated", default: false + create_table "proposal_notifications", id: :serial, force: :cascade do |t| + t.string "title" + t.text "body" + t.integer "author_id" + t.integer "proposal_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.boolean "moderated", default: false t.datetime "hidden_at" t.datetime "ignored_at" t.datetime "confirmed_hide_at" end - create_table "proposal_translations", force: :cascade do |t| - t.integer "proposal_id", null: false - t.string "locale", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "title" - t.text "description" - t.text "summary" - t.text "retired_explanation" + create_table "proposal_translations", id: :serial, force: :cascade do |t| + t.integer "proposal_id", null: false + t.string "locale", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "title" + t.text "description" + t.text "summary" + t.text "retired_explanation" t.datetime "hidden_at" - t.index ["hidden_at"], name: "index_proposal_translations_on_hidden_at", using: :btree - t.index ["locale"], name: "index_proposal_translations_on_locale", using: :btree - t.index ["proposal_id"], name: "index_proposal_translations_on_proposal_id", using: :btree + t.index ["hidden_at"], name: "index_proposal_translations_on_hidden_at" + t.index ["locale"], name: "index_proposal_translations_on_locale" + t.index ["proposal_id"], name: "index_proposal_translations_on_proposal_id" end - create_table "proposals", force: :cascade do |t| - t.string "deprecated_title", limit: 80 - t.text "deprecated_description" - t.integer "author_id" + create_table "proposals", id: :serial, force: :cascade do |t| + t.string "deprecated_title", limit: 80 + t.text "deprecated_description" + t.integer "author_id" t.datetime "hidden_at" - t.integer "flags_count", default: 0 + t.integer "flags_count", default: 0 t.datetime "ignored_flag_at" - t.integer "cached_votes_up", default: 0 - t.integer "comments_count", default: 0 + t.integer "cached_votes_up", default: 0 + t.integer "comments_count", default: 0 t.datetime "confirmed_hide_at" - t.bigint "hot_score", default: 0 - t.integer "confidence_score", default: 0 - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "responsible_name", limit: 60 - t.text "deprecated_summary" - t.string "video_url" + t.bigint "hot_score", default: 0 + t.integer "confidence_score", default: 0 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "responsible_name", limit: 60 + t.text "deprecated_summary" + t.string "video_url" t.tsvector "tsv" - t.integer "geozone_id" + t.integer "geozone_id" t.datetime "retired_at" - t.string "retired_reason" - t.text "deprecated_retired_explanation" - t.integer "community_id" + t.string "retired_reason" + t.text "deprecated_retired_explanation" + t.integer "community_id" t.datetime "published_at" - t.boolean "selected", default: false - t.index ["author_id", "hidden_at"], name: "index_proposals_on_author_id_and_hidden_at", using: :btree - t.index ["author_id"], name: "index_proposals_on_author_id", using: :btree - t.index ["cached_votes_up"], name: "index_proposals_on_cached_votes_up", using: :btree - t.index ["community_id"], name: "index_proposals_on_community_id", using: :btree - t.index ["confidence_score"], name: "index_proposals_on_confidence_score", using: :btree - t.index ["geozone_id"], name: "index_proposals_on_geozone_id", using: :btree - t.index ["hidden_at"], name: "index_proposals_on_hidden_at", using: :btree - t.index ["hot_score"], name: "index_proposals_on_hot_score", using: :btree + t.boolean "selected", default: false + t.index ["author_id", "hidden_at"], name: "index_proposals_on_author_id_and_hidden_at" + t.index ["author_id"], name: "index_proposals_on_author_id" + t.index ["cached_votes_up"], name: "index_proposals_on_cached_votes_up" + t.index ["community_id"], name: "index_proposals_on_community_id" + t.index ["confidence_score"], name: "index_proposals_on_confidence_score" + t.index ["geozone_id"], name: "index_proposals_on_geozone_id" + t.index ["hidden_at"], name: "index_proposals_on_hidden_at" + t.index ["hot_score"], name: "index_proposals_on_hot_score" t.index ["tsv"], name: "index_proposals_on_tsv", using: :gin end - create_table "related_content_scores", force: :cascade do |t| + create_table "related_content_scores", id: :serial, force: :cascade do |t| t.integer "user_id" t.integer "related_content_id" t.integer "value" - t.index ["related_content_id"], name: "index_related_content_scores_on_related_content_id", using: :btree - t.index ["user_id", "related_content_id"], name: "unique_user_related_content_scoring", unique: true, using: :btree - t.index ["user_id"], name: "index_related_content_scores_on_user_id", using: :btree + t.index ["related_content_id"], name: "index_related_content_scores_on_related_content_id" + t.index ["user_id", "related_content_id"], name: "unique_user_related_content_scoring", unique: true + t.index ["user_id"], name: "index_related_content_scores_on_user_id" end - create_table "related_contents", force: :cascade do |t| - t.string "parent_relationable_type" - t.integer "parent_relationable_id" - t.string "child_relationable_type" - t.integer "child_relationable_id" - t.integer "related_content_id" + create_table "related_contents", id: :serial, force: :cascade do |t| + t.string "parent_relationable_type" + t.integer "parent_relationable_id" + t.string "child_relationable_type" + t.integer "child_relationable_id" + t.integer "related_content_id" t.datetime "created_at" t.datetime "updated_at" t.datetime "hidden_at" - t.integer "related_content_scores_count", default: 0 - t.integer "author_id" - t.index ["child_relationable_type", "child_relationable_id"], name: "index_related_contents_on_child_relationable", using: :btree - t.index ["hidden_at"], name: "index_related_contents_on_hidden_at", using: :btree - t.index ["parent_relationable_id", "parent_relationable_type", "child_relationable_id", "child_relationable_type"], name: "unique_parent_child_related_content", unique: true, using: :btree - t.index ["parent_relationable_type", "parent_relationable_id"], name: "index_related_contents_on_parent_relationable", using: :btree - t.index ["related_content_id"], name: "opposite_related_content", using: :btree + t.integer "related_content_scores_count", default: 0 + t.integer "author_id" + t.index ["child_relationable_type", "child_relationable_id"], name: "index_related_contents_on_child_relationable" + t.index ["hidden_at"], name: "index_related_contents_on_hidden_at" + t.index ["parent_relationable_id", "parent_relationable_type", "child_relationable_id", "child_relationable_type"], name: "unique_parent_child_related_content", unique: true + t.index ["parent_relationable_type", "parent_relationable_id"], name: "index_related_contents_on_parent_relationable" + t.index ["related_content_id"], name: "opposite_related_content" end - create_table "remote_translations", force: :cascade do |t| - t.string "locale" - t.integer "remote_translatable_id" - t.string "remote_translatable_type" - t.text "error_message" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - end - - create_table "reports", force: :cascade do |t| - t.boolean "stats" - t.boolean "results" - t.string "process_type" - t.integer "process_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.boolean "advanced_stats" - t.index ["process_type", "process_id"], name: "index_reports_on_process_type_and_process_id", using: :btree - end - - create_table "settings", force: :cascade do |t| - t.string "key" - t.string "value" - t.index ["key"], name: "index_settings_on_key", using: :btree - end - - create_table "signature_sheets", force: :cascade do |t| - t.string "signable_type" - t.integer "signable_id" - t.text "required_fields_to_verify" - t.boolean "processed", default: false - t.integer "author_id" - t.datetime "created_at" - t.datetime "updated_at" - t.string "title" - end - - create_table "signatures", force: :cascade do |t| - t.integer "signature_sheet_id" - t.integer "user_id" - t.string "document_number" - t.boolean "verified", default: false - t.datetime "created_at" - t.datetime "updated_at" - t.date "date_of_birth" - t.string "postal_code" - end - - create_table "site_customization_content_blocks", force: :cascade do |t| - t.string "name" - t.string "locale" - t.text "body" + create_table "remote_translations", id: :serial, force: :cascade do |t| + t.string "locale" + t.integer "remote_translatable_id" + t.string "remote_translatable_type" + t.text "error_message" t.datetime "created_at", null: false t.datetime "updated_at", null: false - t.index ["name", "locale"], name: "index_site_customization_content_blocks_on_name_and_locale", unique: true, using: :btree end - create_table "site_customization_images", force: :cascade do |t| - t.string "name", null: false - t.string "image_file_name" - t.string "image_content_type" - t.integer "image_file_size" - t.datetime "image_updated_at" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["name"], name: "index_site_customization_images_on_name", unique: true, using: :btree + create_table "reports", id: :serial, force: :cascade do |t| + t.boolean "stats" + t.boolean "results" + t.string "process_type" + t.integer "process_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.boolean "advanced_stats" + t.index ["process_type", "process_id"], name: "index_reports_on_process_type_and_process_id" end - create_table "site_customization_page_translations", force: :cascade do |t| - t.integer "site_customization_page_id", null: false - t.string "locale", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "title" - t.string "subtitle" - t.text "content" - t.index ["locale"], name: "index_site_customization_page_translations_on_locale", using: :btree - t.index ["site_customization_page_id"], name: "index_7fa0f9505738cb31a31f11fb2f4c4531fed7178b", using: :btree + create_table "settings", id: :serial, force: :cascade do |t| + t.string "key" + t.string "value" + t.index ["key"], name: "index_settings_on_key" end - create_table "site_customization_pages", force: :cascade do |t| - t.string "slug", null: false - t.boolean "more_info_flag" - t.boolean "print_content_flag" - t.string "status", default: "draft" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "locale" - end - - create_table "stats_versions", force: :cascade do |t| - t.string "process_type" - t.integer "process_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["process_type", "process_id"], name: "index_stats_versions_on_process_type_and_process_id", using: :btree - end - - create_table "taggings", force: :cascade do |t| - t.integer "tag_id" - t.string "taggable_type" - t.integer "taggable_id" - t.string "tagger_type" - t.integer "tagger_id" - t.string "context", limit: 128 + create_table "signature_sheets", id: :serial, force: :cascade do |t| + t.string "signable_type" + t.integer "signable_id" + t.text "required_fields_to_verify" + t.boolean "processed", default: false + t.integer "author_id" t.datetime "created_at" - t.index ["tag_id"], name: "index_taggings_on_tag_id", using: :btree - t.index ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context", using: :btree + t.datetime "updated_at" + t.string "title" end - create_table "tags", force: :cascade do |t| - t.string "name", limit: 160 - t.integer "taggings_count", default: 0 - t.integer "debates_count", default: 0 - t.integer "proposals_count", default: 0 - t.string "kind" - t.integer "budget/investments_count", default: 0 - t.integer "legislation/proposals_count", default: 0 - t.integer "legislation/processes_count", default: 0 - t.index ["debates_count"], name: "index_tags_on_debates_count", using: :btree - t.index ["legislation/processes_count"], name: "index_tags_on_legislation/processes_count", using: :btree - t.index ["legislation/proposals_count"], name: "index_tags_on_legislation/proposals_count", using: :btree - t.index ["name"], name: "index_tags_on_name", unique: true, using: :btree - t.index ["proposals_count"], name: "index_tags_on_proposals_count", using: :btree + create_table "signatures", id: :serial, force: :cascade do |t| + t.integer "signature_sheet_id" + t.integer "user_id" + t.string "document_number" + t.boolean "verified", default: false + t.datetime "created_at" + t.datetime "updated_at" + t.date "date_of_birth" + t.string "postal_code" end - create_table "topics", force: :cascade do |t| - t.string "title", null: false - t.text "description" - t.integer "author_id" - t.integer "comments_count", default: 0 - t.integer "community_id" + create_table "site_customization_content_blocks", id: :serial, force: :cascade do |t| + t.string "name" + t.string "locale" + t.text "body" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["name", "locale"], name: "index_site_customization_content_blocks_on_name_and_locale", unique: true + end + + create_table "site_customization_images", id: :serial, force: :cascade do |t| + t.string "name", null: false + t.string "image_file_name" + t.string "image_content_type" + t.integer "image_file_size" + t.datetime "image_updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["name"], name: "index_site_customization_images_on_name", unique: true + end + + create_table "site_customization_page_translations", id: :serial, force: :cascade do |t| + t.integer "site_customization_page_id", null: false + t.string "locale", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "title" + t.string "subtitle" + t.text "content" + t.index ["locale"], name: "index_site_customization_page_translations_on_locale" + t.index ["site_customization_page_id"], name: "index_7fa0f9505738cb31a31f11fb2f4c4531fed7178b" + end + + create_table "site_customization_pages", id: :serial, force: :cascade do |t| + t.string "slug", null: false + t.boolean "more_info_flag" + t.boolean "print_content_flag" + t.string "status", default: "draft" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "locale" + end + + create_table "stats_versions", id: :serial, force: :cascade do |t| + t.string "process_type" + t.integer "process_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["process_type", "process_id"], name: "index_stats_versions_on_process_type_and_process_id" + end + + create_table "taggings", id: :serial, force: :cascade do |t| + t.integer "tag_id" + t.string "taggable_type" + t.integer "taggable_id" + t.string "tagger_type" + t.integer "tagger_id" + t.string "context", limit: 128 + t.datetime "created_at" + t.index ["tag_id"], name: "index_taggings_on_tag_id" + t.index ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context" + end + + create_table "tags", id: :serial, force: :cascade do |t| + t.string "name", limit: 160 + t.integer "taggings_count", default: 0 + t.integer "debates_count", default: 0 + t.integer "proposals_count", default: 0 + t.string "kind" + t.integer "budget/investments_count", default: 0 + t.integer "legislation/proposals_count", default: 0 + t.integer "legislation/processes_count", default: 0 + t.index ["debates_count"], name: "index_tags_on_debates_count" + t.index ["legislation/processes_count"], name: "index_tags_on_legislation/processes_count" + t.index ["legislation/proposals_count"], name: "index_tags_on_legislation/proposals_count" + t.index ["name"], name: "index_tags_on_name", unique: true + t.index ["proposals_count"], name: "index_tags_on_proposals_count" + end + + create_table "topics", id: :serial, force: :cascade do |t| + t.string "title", null: false + t.text "description" + t.integer "author_id" + t.integer "comments_count", default: 0 + t.integer "community_id" t.datetime "hidden_at" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["community_id"], name: "index_topics_on_community_id", using: :btree - t.index ["hidden_at"], name: "index_topics_on_hidden_at", using: :btree + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["community_id"], name: "index_topics_on_community_id" + t.index ["hidden_at"], name: "index_topics_on_hidden_at" end - create_table "users", force: :cascade do |t| - t.string "email", default: "" - t.string "encrypted_password", default: "", null: false - t.string "reset_password_token" + create_table "users", id: :serial, force: :cascade do |t| + t.string "email", default: "" + t.string "encrypted_password", default: "", null: false + t.string "reset_password_token" t.datetime "reset_password_sent_at" t.datetime "remember_created_at" - t.integer "sign_in_count", default: 0, null: false + t.integer "sign_in_count", default: 0, null: false t.datetime "current_sign_in_at" t.datetime "last_sign_in_at" - t.string "current_sign_in_ip" - t.string "last_sign_in_ip" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "confirmation_token" + t.string "current_sign_in_ip" + t.string "last_sign_in_ip" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "confirmation_token" t.datetime "confirmed_at" t.datetime "confirmation_sent_at" - t.string "unconfirmed_email" - t.boolean "email_on_comment", default: false - t.boolean "email_on_comment_reply", default: false - t.string "phone_number", limit: 30 - t.string "official_position" - t.integer "official_level", default: 0 + t.string "unconfirmed_email" + t.boolean "email_on_comment", default: false + t.boolean "email_on_comment_reply", default: false + t.string "phone_number", limit: 30 + t.string "official_position" + t.integer "official_level", default: 0 t.datetime "hidden_at" - t.string "sms_confirmation_code" - t.string "username", limit: 60 - t.string "document_number" - t.string "document_type" + t.string "sms_confirmation_code" + t.string "username", limit: 60 + t.string "document_number" + t.string "document_type" t.datetime "residence_verified_at" - t.string "email_verification_token" + t.string "email_verification_token" t.datetime "verified_at" - t.string "unconfirmed_phone" - t.string "confirmed_phone" + t.string "unconfirmed_phone" + t.string "confirmed_phone" t.datetime "letter_requested_at" t.datetime "confirmed_hide_at" - t.string "letter_verification_code" - t.integer "failed_census_calls_count", default: 0 + t.string "letter_verification_code" + t.integer "failed_census_calls_count", default: 0 t.datetime "level_two_verified_at" - t.string "erase_reason" + t.string "erase_reason" t.datetime "erased_at" - t.boolean "public_activity", default: true - t.boolean "newsletter", default: true - t.integer "notifications_count", default: 0 - t.boolean "registering_with_oauth", default: false - t.string "locale" - t.string "oauth_email" - t.integer "geozone_id" - t.string "redeemable_code" - t.string "gender", limit: 10 + t.boolean "public_activity", default: true + t.boolean "newsletter", default: true + t.integer "notifications_count", default: 0 + t.boolean "registering_with_oauth", default: false + t.string "locale" + t.string "oauth_email" + t.integer "geozone_id" + t.string "redeemable_code" + t.string "gender", limit: 10 t.datetime "date_of_birth" - t.boolean "email_on_proposal_notification", default: true - t.boolean "email_digest", default: true - t.boolean "email_on_direct_message", default: true - t.boolean "official_position_badge", default: false - t.datetime "password_changed_at", default: '2015-01-01 01:01:01', null: false - t.boolean "created_from_signature", default: false - t.integer "failed_email_digests_count", default: 0 - t.text "former_users_data_log", default: "" - t.integer "balloted_heading_id" - t.boolean "public_interests", default: false - t.boolean "recommended_debates", default: true - t.boolean "recommended_proposals", default: true - t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true, using: :btree - t.index ["email"], name: "index_users_on_email", unique: true, using: :btree - t.index ["geozone_id"], name: "index_users_on_geozone_id", using: :btree - t.index ["hidden_at"], name: "index_users_on_hidden_at", using: :btree - t.index ["password_changed_at"], name: "index_users_on_password_changed_at", using: :btree - t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree - t.index ["username"], name: "index_users_on_username", using: :btree + t.boolean "email_on_proposal_notification", default: true + t.boolean "email_digest", default: true + t.boolean "email_on_direct_message", default: true + t.boolean "official_position_badge", default: false + t.datetime "password_changed_at", default: "2015-01-01 01:01:01", null: false + t.boolean "created_from_signature", default: false + t.integer "failed_email_digests_count", default: 0 + t.text "former_users_data_log", default: "" + t.integer "balloted_heading_id" + t.boolean "public_interests", default: false + t.boolean "recommended_debates", default: true + t.boolean "recommended_proposals", default: true + t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true + t.index ["email"], name: "index_users_on_email", unique: true + t.index ["geozone_id"], name: "index_users_on_geozone_id" + t.index ["hidden_at"], name: "index_users_on_hidden_at" + t.index ["password_changed_at"], name: "index_users_on_password_changed_at" + t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true + t.index ["username"], name: "index_users_on_username" end - create_table "valuator_groups", force: :cascade do |t| - t.string "name" + create_table "valuator_groups", id: :serial, force: :cascade do |t| + t.string "name" t.integer "budget_investments_count", default: 0 end - create_table "valuators", force: :cascade do |t| + create_table "valuators", id: :serial, force: :cascade do |t| t.integer "user_id" - t.string "description" + t.string "description" t.integer "budget_investments_count", default: 0 t.integer "valuator_group_id" - t.boolean "can_comment", default: true - t.boolean "can_edit_dossier", default: true - t.index ["user_id"], name: "index_valuators_on_user_id", using: :btree + t.boolean "can_comment", default: true + t.boolean "can_edit_dossier", default: true + t.index ["user_id"], name: "index_valuators_on_user_id" end - create_table "verified_users", force: :cascade do |t| - t.string "document_number" - t.string "document_type" - t.string "phone" - t.string "email" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["document_number"], name: "index_verified_users_on_document_number", using: :btree - t.index ["email"], name: "index_verified_users_on_email", using: :btree - t.index ["phone"], name: "index_verified_users_on_phone", using: :btree + create_table "verified_users", id: :serial, force: :cascade do |t| + t.string "document_number" + t.string "document_type" + t.string "phone" + t.string "email" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["document_number"], name: "index_verified_users_on_document_number" + t.index ["email"], name: "index_verified_users_on_email" + t.index ["phone"], name: "index_verified_users_on_phone" end create_table "visits", id: :uuid, default: nil, force: :cascade do |t| - t.uuid "visitor_id" - t.string "ip" - t.text "user_agent" - t.text "referrer" - t.text "landing_page" - t.integer "user_id" - t.string "referring_domain" - t.string "search_keyword" - t.string "browser" - t.string "os" - t.string "device_type" - t.integer "screen_height" - t.integer "screen_width" - t.string "country" - t.string "region" - t.string "city" - t.string "postal_code" - t.decimal "latitude" - t.decimal "longitude" - t.string "utm_source" - t.string "utm_medium" - t.string "utm_term" - t.string "utm_content" - t.string "utm_campaign" + t.uuid "visitor_id" + t.string "ip" + t.text "user_agent" + t.text "referrer" + t.text "landing_page" + t.integer "user_id" + t.string "referring_domain" + t.string "search_keyword" + t.string "browser" + t.string "os" + t.string "device_type" + t.integer "screen_height" + t.integer "screen_width" + t.string "country" + t.string "region" + t.string "city" + t.string "postal_code" + t.decimal "latitude" + t.decimal "longitude" + t.string "utm_source" + t.string "utm_medium" + t.string "utm_term" + t.string "utm_content" + t.string "utm_campaign" t.datetime "started_at" - t.index ["started_at"], name: "index_visits_on_started_at", using: :btree - t.index ["user_id"], name: "index_visits_on_user_id", using: :btree + t.index ["started_at"], name: "index_visits_on_started_at" + t.index ["user_id"], name: "index_visits_on_user_id" end - create_table "votes", force: :cascade do |t| - t.string "votable_type" - t.integer "votable_id" - t.string "voter_type" - t.integer "voter_id" - t.boolean "vote_flag" - t.string "vote_scope" - t.integer "vote_weight" + create_table "votes", id: :serial, force: :cascade do |t| + t.string "votable_type" + t.integer "votable_id" + t.string "voter_type" + t.integer "voter_id" + t.boolean "vote_flag" + t.string "vote_scope" + t.integer "vote_weight" t.datetime "created_at" t.datetime "updated_at" - t.integer "signature_id" - t.index ["signature_id"], name: "index_votes_on_signature_id", using: :btree - t.index ["votable_id", "votable_type", "vote_scope"], name: "index_votes_on_votable_id_and_votable_type_and_vote_scope", using: :btree - t.index ["voter_id", "voter_type", "vote_scope"], name: "index_votes_on_voter_id_and_voter_type_and_vote_scope", using: :btree + t.integer "signature_id" + t.index ["signature_id"], name: "index_votes_on_signature_id" + t.index ["votable_id", "votable_type", "vote_scope"], name: "index_votes_on_votable_id_and_votable_type_and_vote_scope" + t.index ["voter_id", "voter_type", "vote_scope"], name: "index_votes_on_voter_id_and_voter_type_and_vote_scope" end - create_table "web_sections", force: :cascade do |t| - t.text "name" + create_table "web_sections", id: :serial, force: :cascade do |t| + t.text "name" t.datetime "created_at", null: false t.datetime "updated_at", null: false end - create_table "widget_card_translations", force: :cascade do |t| - t.integer "widget_card_id", null: false - t.string "locale", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "label" - t.string "title" - t.text "description" - t.string "link_text" - t.index ["locale"], name: "index_widget_card_translations_on_locale", using: :btree - t.index ["widget_card_id"], name: "index_widget_card_translations_on_widget_card_id", using: :btree + create_table "widget_card_translations", id: :serial, force: :cascade do |t| + t.integer "widget_card_id", null: false + t.string "locale", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "label" + t.string "title" + t.text "description" + t.string "link_text" + t.index ["locale"], name: "index_widget_card_translations_on_locale" + t.index ["widget_card_id"], name: "index_widget_card_translations_on_widget_card_id" end - create_table "widget_cards", force: :cascade do |t| - t.string "link_url" - t.boolean "header", default: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.integer "site_customization_page_id" - t.integer "columns", default: 4 - t.index ["site_customization_page_id"], name: "index_widget_cards_on_site_customization_page_id", using: :btree + create_table "widget_cards", id: :serial, force: :cascade do |t| + t.string "link_url" + t.boolean "header", default: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "site_customization_page_id" + t.integer "columns", default: 4 + t.index ["site_customization_page_id"], name: "index_widget_cards_on_site_customization_page_id" end - create_table "widget_feeds", force: :cascade do |t| - t.string "kind" - t.integer "limit", default: 3 - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + create_table "widget_feeds", id: :serial, force: :cascade do |t| + t.string "kind" + t.integer "limit", default: 3 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end add_foreign_key "administrators", "users"