diff --git a/.rubocop.yml b/.rubocop.yml index 7c151d364..8fb963919 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -198,15 +198,6 @@ Performance/EndWith: Performance/StartWith: Enabled: true -Rails/ActionFilter: - Enabled: true - -Rails/ApplicationJob: - Enabled: true - -Rails/ApplicationRecord: - Enabled: true - Rails/CreateTableWithTimestamps: Enabled: true Exclude: @@ -241,9 +232,6 @@ Rails/HasManyOrHasOneDependent: Enabled: true Severity: refactor -Rails/HttpPositionalArguments: - Enabled: true - Rails/InverseOf: Enabled: true Exclude: diff --git a/Gemfile b/Gemfile index 9fcadcea9..2c2c3e208 100644 --- a/Gemfile +++ b/Gemfile @@ -1,8 +1,8 @@ source "https://rubygems.org" -gem "rails", "5.0.7.2" +gem "rails", "5.1.7" -gem "acts-as-taggable-on", "~> 5.0.0" +gem "acts-as-taggable-on", "~> 6.0.0" gem "acts_as_votable", "~> 0.11.1" gem "ahoy_matey", "~> 1.6.0" gem "ancestry", "~> 3.0.7" @@ -66,8 +66,8 @@ source "https://rails-assets.org" do end group :development, :test do - gem "bullet", "~> 5.7.0" - gem "byebug", "~> 10.0.0" + gem "bullet", "~> 5.9.0" + gem "byebug", "~> 11.1.1" gem "factory_bot_rails", "~> 4.8.2" gem "faker", "~> 1.8.7" gem "i18n-tasks", "~> 0.9.29" @@ -82,7 +82,6 @@ group :test do gem "capybara", "~> 3.29.0" gem "capybara-webmock", "~> 0.5.3" gem "coveralls", "~> 0.8.22", require: false - gem "database_cleaner", "~> 1.7.0" gem "email_spec", "~> 2.2.0" gem "rspec-rails", "~> 3.8" gem "selenium-webdriver", "~> 3.141" @@ -94,6 +93,7 @@ group :development do gem "capistrano-rails", "~> 1.4.0", require: false gem "capistrano3-delayed-job", "~> 1.7.3" gem "capistrano3-puma", "~> 4.0.0" + gem "database_cleaner", "~> 1.7.0" gem "erb_lint", require: false gem "github_changelog_generator", "~> 1.15.0" gem "mdl", "~> 0.5.0", require: false diff --git a/Gemfile.lock b/Gemfile.lock index 22b2fc556..1d64d39ba 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -10,45 +10,45 @@ GEM remote: https://rubygems.org/ remote: https://rails-assets.org/ specs: - actioncable (5.0.7.2) - actionpack (= 5.0.7.2) - nio4r (>= 1.2, < 3.0) + actioncable (5.1.7) + actionpack (= 5.1.7) + nio4r (~> 2.0) websocket-driver (~> 0.6.1) - actionmailer (5.0.7.2) - actionpack (= 5.0.7.2) - actionview (= 5.0.7.2) - activejob (= 5.0.7.2) + actionmailer (5.1.7) + actionpack (= 5.1.7) + actionview (= 5.1.7) + activejob (= 5.1.7) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.0.7.2) - actionview (= 5.0.7.2) - activesupport (= 5.0.7.2) + actionpack (5.1.7) + actionview (= 5.1.7) + activesupport (= 5.1.7) rack (~> 2.0) - rack-test (~> 0.6.3) + rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.0.7.2) - activesupport (= 5.0.7.2) + actionview (5.1.7) + activesupport (= 5.1.7) builder (~> 3.1) - erubis (~> 2.7.0) + erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.0.7.2) - activesupport (= 5.0.7.2) + activejob (5.1.7) + activesupport (= 5.1.7) globalid (>= 0.3.6) - activemodel (5.0.7.2) - activesupport (= 5.0.7.2) - activerecord (5.0.7.2) - activemodel (= 5.0.7.2) - activesupport (= 5.0.7.2) - arel (~> 7.0) - activesupport (5.0.7.2) + activemodel (5.1.7) + activesupport (= 5.1.7) + activerecord (5.1.7) + activemodel (= 5.1.7) + activesupport (= 5.1.7) + arel (~> 8.0) + activesupport (5.1.7) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) - acts-as-taggable-on (5.0.0) - activerecord (>= 4.2.8) + acts-as-taggable-on (6.0.0) + activerecord (~> 5.0) acts_as_votable (0.11.1) addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) @@ -70,7 +70,7 @@ GEM nokogiri ancestry (3.0.7) activerecord (>= 3.2.0) - arel (7.1.4) + arel (8.0.0) ast (2.4.0) audited (4.9.0) activerecord (>= 4.2, < 6.1) @@ -91,10 +91,10 @@ GEM smart_properties browser (2.5.3) builder (3.2.4) - bullet (5.7.1) + bullet (5.9.0) activesupport (>= 3.0.0) - uniform_notifier (~> 1.11.0) - byebug (10.0.0) + uniform_notifier (~> 1.11) + byebug (11.1.1) cancancan (2.3.0) capistrano (3.10.1) airbrussh (>= 1.0.0) @@ -144,7 +144,7 @@ GEM coffee-script-source execjs coffee-script-source (1.12.2) - concurrent-ruby (1.1.5) + concurrent-ruby (1.1.6) coveralls (0.8.22) json (>= 1.8, < 3) simplecov (~> 0.16.1) @@ -210,7 +210,6 @@ GEM smart_properties errbase (0.0.3) erubi (1.8.0) - erubis (2.7.0) execjs (2.7.0) factory_bot (4.8.2) activesupport (>= 3.0.0) @@ -332,7 +331,7 @@ GEM kramdown (~> 1.12, >= 1.12.0) mixlib-cli (~> 1.7, >= 1.7.0) mixlib-config (~> 2.2, >= 2.2.1) - method_source (0.9.2) + method_source (1.0.0) mime-types (3.1) mime-types-data (~> 3.2015) mime-types-data (3.2016.0521) @@ -351,7 +350,7 @@ GEM net-ssh (5.0.2) newrelic_rpm (4.1.0.333) nio4r (2.5.2) - nokogiri (1.10.8) + nokogiri (1.10.9) mini_portile2 (~> 2.4.0) nori (2.6.0) oauth (0.5.4) @@ -405,26 +404,26 @@ GEM public_suffix (4.0.1) puma (4.3.3) nio4r (~> 2.0) - rack (2.1.1) + rack (2.2.2) rack-accept (0.4.5) rack (>= 0.4) rack-attack (5.0.1) rack rack-proxy (0.6.5) rack - rack-test (0.6.3) - rack (>= 1.0) - rails (5.0.7.2) - actioncable (= 5.0.7.2) - actionmailer (= 5.0.7.2) - actionpack (= 5.0.7.2) - actionview (= 5.0.7.2) - activejob (= 5.0.7.2) - activemodel (= 5.0.7.2) - activerecord (= 5.0.7.2) - activesupport (= 5.0.7.2) + rack-test (1.1.0) + rack (>= 1.0, < 3) + rails (5.1.7) + actioncable (= 5.1.7) + actionmailer (= 5.1.7) + actionpack (= 5.1.7) + actionview (= 5.1.7) + activejob (= 5.1.7) + activemodel (= 5.1.7) + activerecord (= 5.1.7) + activesupport (= 5.1.7) bundler (>= 1.3.0) - railties (= 5.0.7.2) + railties (= 5.1.7) sprockets-rails (>= 2.0.0) rails-assets-leaflet (1.2.0) rails-assets-markdown-it (8.2.2) @@ -436,9 +435,9 @@ GEM rails-i18n (5.1.3) i18n (>= 0.7, < 2) railties (>= 5.0, < 6) - railties (5.0.7.2) - actionpack (= 5.0.7.2) - activesupport (= 5.0.7.2) + railties (5.1.7) + actionpack (= 5.1.7) + activesupport (= 5.1.7) method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) @@ -577,7 +576,7 @@ GEM uglifier (4.1.19) execjs (>= 0.3.0, < 3) unicode-display_width (1.6.0) - uniform_notifier (1.11.0) + uniform_notifier (1.13.0) user_agent_parser (2.6.0) uuidtools (2.1.5) warden (1.2.8) @@ -591,7 +590,7 @@ GEM railties (>= 4.2) websocket-driver (0.6.5) websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.3) + websocket-extensions (0.1.4) whenever (0.10.0) chronic (>= 0.6.3) wicked_pdf (1.1.0) @@ -603,14 +602,14 @@ PLATFORMS ruby DEPENDENCIES - acts-as-taggable-on (~> 5.0.0) + acts-as-taggable-on (~> 6.0.0) acts_as_votable (~> 0.11.1) ahoy_matey (~> 1.6.0) ancestry (~> 3.0.7) audited (~> 4.9.0) autoprefixer-rails (~> 8.2.0) - bullet (~> 5.7.0) - byebug (~> 10.0.0) + bullet (~> 5.9.0) + byebug (~> 11.1.1) cancancan (~> 2.3.0) capistrano (~> 3.10.1) capistrano-bundler (~> 1.2) @@ -664,7 +663,7 @@ DEPENDENCIES pg (~> 0.21.0) pg_search (~> 2.0.1) puma (~> 4.3.3) - rails (= 5.0.7.2) + rails (= 5.1.7) rails-assets-leaflet! rails-assets-markdown-it (~> 8.2.1)! recipient_interceptor (~> 0.2.0) diff --git a/app/controllers/admin/poll/questions/answers_controller.rb b/app/controllers/admin/poll/questions/answers_controller.rb index 7b56de3c1..c75524a60 100644 --- a/app/controllers/admin/poll/questions/answers_controller.rb +++ b/app/controllers/admin/poll/questions/answers_controller.rb @@ -44,7 +44,7 @@ class Admin::Poll::Questions::AnswersController < Admin::Poll::BaseController def order_answers ::Poll::Question::Answer.order_answers(params[:ordered_list]) - render nothing: true + head :ok end private diff --git a/app/models/budget/investment.rb b/app/models/budget/investment.rb index d685b8507..f12bcee70 100644 --- a/app/models/budget/investment.rb +++ b/app/models/budget/investment.rb @@ -319,7 +319,7 @@ class Budget end def recalculate_heading_winners - Budget::Result.new(budget, heading).calculate_winners if incompatible_changed? + Budget::Result.new(budget, heading).calculate_winners if saved_change_to_incompatible? end def set_responsible_name @@ -396,7 +396,7 @@ class Budget private def set_denormalized_ids - self.group_id = heading&.group_id if heading_id_changed? + self.group_id = heading&.group_id if will_save_change_to_heading_id? self.budget_id ||= heading&.group&.budget_id end diff --git a/app/models/budget/phase.rb b/app/models/budget/phase.rb index de3b8c0f1..8294b7c17 100644 --- a/app/models/budget/phase.rb +++ b/app/models/budget/phase.rb @@ -68,7 +68,7 @@ class Budget if enabled? next_enabled_phase&.update_column(:starts_at, ends_at) prev_enabled_phase&.update_column(:ends_at, starts_at) - elsif enabled_changed? + elsif saved_change_to_enabled? next_enabled_phase&.update_column(:starts_at, starts_at) end end diff --git a/app/models/budget/reclassification.rb b/app/models/budget/reclassification.rb index 9c8c5cf1c..798fb7ad4 100644 --- a/app/models/budget/reclassification.rb +++ b/app/models/budget/reclassification.rb @@ -7,7 +7,7 @@ class Budget end def check_for_reclassification - if heading_changed? + if saved_change_to_heading? log_heading_change store_reclassified_votes("heading_changed") remove_reclassified_votes @@ -17,16 +17,16 @@ class Budget end end - def heading_changed? - budget.balloting? && heading_id_changed? + def saved_change_to_heading? + budget.balloting? && saved_change_to_heading_id? end def marked_as_unfeasible? - budget.balloting? && feasibility_changed? && unfeasible? + budget.balloting? && saved_change_to_feasibility? && unfeasible? end def log_heading_change - update_column(:previous_heading_id, heading_id_was) + update_column(:previous_heading_id, heading_id_before_last_save) end def store_reclassified_votes(reason) diff --git a/app/models/poll/partial_result.rb b/app/models/poll/partial_result.rb index 134cf377d..d8e9cc18b 100644 --- a/app/models/poll/partial_result.rb +++ b/app/models/poll/partial_result.rb @@ -19,10 +19,10 @@ class Poll::PartialResult < ApplicationRecord before_save :update_logs def update_logs - if amount_changed? && amount_was.present? - self.amount_log += ":#{amount_was}" - self.officer_assignment_id_log += ":#{officer_assignment_id_was}" - self.author_id_log += ":#{author_id_was}" + if will_save_change_to_amount? && amount_in_database.present? + self.amount_log += ":#{amount_in_database}" + self.officer_assignment_id_log += ":#{officer_assignment_id_in_database}" + self.author_id_log += ":#{author_id_in_database}" end end end diff --git a/app/models/poll/recount.rb b/app/models/poll/recount.rb index 9895d99e8..b5fb52bbf 100644 --- a/app/models/poll/recount.rb +++ b/app/models/poll/recount.rb @@ -20,9 +20,9 @@ class Poll::Recount < ApplicationRecord amounts_changed = false [:white, :null, :total].each do |amount| - next unless send("#{amount}_amount_changed?") && send("#{amount}_amount_was").present? + next unless send("will_save_change_to_#{amount}_amount?") && send("#{amount}_amount_in_database").present? - self["#{amount}_amount_log"] += ":#{send("#{amount}_amount_was")}" + self["#{amount}_amount_log"] += ":#{send("#{amount}_amount_in_database")}" amounts_changed = true end @@ -30,7 +30,7 @@ class Poll::Recount < ApplicationRecord end def update_officer_author - self.officer_assignment_id_log += ":#{officer_assignment_id_was}" - self.author_id_log += ":#{author_id_was}" + self.officer_assignment_id_log += ":#{officer_assignment_id_in_database}" + self.author_id_log += ":#{author_id_in_database}" end end diff --git a/config/initializers/callback_terminator.rb b/config/initializers/callback_terminator.rb deleted file mode 100644 index de64962d2..000000000 --- a/config/initializers/callback_terminator.rb +++ /dev/null @@ -1 +0,0 @@ -ActiveSupport.halt_callback_chains_on_return_false = false diff --git a/db/dev_seeds.rb b/db/dev_seeds.rb index f3c154b64..a63ccd86d 100644 --- a/db/dev_seeds.rb +++ b/db/dev_seeds.rb @@ -1,5 +1,7 @@ -require "database_cleaner" -DatabaseCleaner.clean_with :truncation +unless Rails.env.test? + require "database_cleaner" + DatabaseCleaner.clean_with :truncation +end @logger = Logger.new(STDOUT) @logger.formatter = proc do |_severity, _datetime, _progname, msg| msg unless @avoid_log diff --git a/db/migrate/20180713124501_make_investment_milestones_polymorphic.rb b/db/migrate/20180713124501_make_investment_milestones_polymorphic.rb index 3b9b8d54d..423b76e9f 100644 --- a/db/migrate/20180713124501_make_investment_milestones_polymorphic.rb +++ b/db/migrate/20180713124501_make_investment_milestones_polymorphic.rb @@ -1,27 +1,27 @@ class MakeInvestmentMilestonesPolymorphic < ActiveRecord::Migration[4.2] def change - create_table :milestones do |t| - t.references :milestoneable, polymorphic: true + create_table :milestones, id: :serial do |t| + t.string :milestoneable_type + t.integer :milestoneable_id t.string "title", limit: 80 t.text "description" t.datetime "publication_date" - t.references :status, index: true + t.integer :status_id, index: true t.timestamps null: false end - reversible do |change| - change.up do - Milestone.create_translation_table!({ - title: :string, - description: :text - }) - end + create_table :milestone_translations do |t| + t.integer :milestone_id, null: false + t.string :locale, null: false + t.timestamps null: false - change.down do - Milestone.drop_translation_table! - end + t.string :title + t.text :description + + t.index :locale + t.index :milestone_id end end end diff --git a/db/migrate/20180718115545_create_i18n_content_translations.rb b/db/migrate/20180718115545_create_i18n_content_translations.rb index 478ef6d8e..479b53942 100644 --- a/db/migrate/20180718115545_create_i18n_content_translations.rb +++ b/db/migrate/20180718115545_create_i18n_content_translations.rb @@ -1,20 +1,18 @@ class CreateI18nContentTranslations < ActiveRecord::Migration[4.2] def change - create_table :i18n_contents do |t| + create_table :i18n_contents, id: :serial do |t| t.string :key end - reversible do |dir| - dir.up do - I18nContent.create_translation_table!( - { value: :text }, - { migrate_data: true } - ) - end + create_table :i18n_content_translations do |t| + t.integer :i18n_content_id, null: false + t.string :locale, null: false + t.timestamps null: false - dir.down do - I18nContent.drop_translation_table! - end + t.text :value + + t.index :i18n_content_id + t.index :locale end end end diff --git a/db/migrate/20180727140800_add_banner_translations.rb b/db/migrate/20180727140800_add_banner_translations.rb index 710dc8237..36bbb541d 100644 --- a/db/migrate/20180727140800_add_banner_translations.rb +++ b/db/migrate/20180727140800_add_banner_translations.rb @@ -1,15 +1,15 @@ class AddBannerTranslations < ActiveRecord::Migration[4.2] - def self.up - Banner.create_translation_table!( - { - title: :string, - description: :text - }, - { migrate_data: true } - ) - end + def change + create_table :banner_translations do |t| + t.integer :banner_id, null: false + t.string :locale, null: false + t.timestamps null: false - def self.down - Banner.drop_translation_table! + t.string :title + t.text :description + + t.index :banner_id + t.index :locale + end end end diff --git a/db/migrate/20180730120800_add_homepage_content_translations.rb b/db/migrate/20180730120800_add_homepage_content_translations.rb index b8c8a8e74..0d0c95c65 100644 --- a/db/migrate/20180730120800_add_homepage_content_translations.rb +++ b/db/migrate/20180730120800_add_homepage_content_translations.rb @@ -1,17 +1,17 @@ class AddHomepageContentTranslations < ActiveRecord::Migration[4.2] - def self.up - Widget::Card.create_translation_table!( - { - label: :string, - title: :string, - description: :text, - link_text: :string - }, - { migrate_data: true } - ) - end + def change + create_table :widget_card_translations do |t| + t.integer :widget_card_id, null: false + t.string :locale, null: false + t.timestamps null: false - def self.down - Widget::Card.drop_translation_table! + t.string :label + t.string :title + t.text :description + t.string :link_text + + t.index :locale + t.index :widget_card_id + end end end diff --git a/db/migrate/20180730213824_add_poll_translations.rb b/db/migrate/20180730213824_add_poll_translations.rb index c4c9b4bbc..9acd6d2f6 100644 --- a/db/migrate/20180730213824_add_poll_translations.rb +++ b/db/migrate/20180730213824_add_poll_translations.rb @@ -1,16 +1,16 @@ class AddPollTranslations < ActiveRecord::Migration[4.2] - def self.up - Poll.create_translation_table!( - { - name: :string, - summary: :text, - description: :text - }, - { migrate_data: true } - ) - end + def change + create_table :poll_translations do |t| + t.integer :poll_id, null: false + t.string :locale, null: false + t.timestamps null: false - def self.down - Poll.drop_translation_table! + t.string :name + t.text :summary + t.text :description + + t.index :locale + t.index :poll_id + end end end diff --git a/db/migrate/20180731150800_add_admin_notification_translations.rb b/db/migrate/20180731150800_add_admin_notification_translations.rb index daff4bc5d..5d5713d2a 100644 --- a/db/migrate/20180731150800_add_admin_notification_translations.rb +++ b/db/migrate/20180731150800_add_admin_notification_translations.rb @@ -1,15 +1,15 @@ class AddAdminNotificationTranslations < ActiveRecord::Migration[4.2] - def self.up - AdminNotification.create_translation_table!( - { - title: :string, - body: :text - }, - { migrate_data: true } - ) - end + def change + create_table :admin_notification_translations do |t| + t.integer :admin_notification_id, null: false + t.string :locale, null: false + t.timestamps null: false - def self.down - AdminNotification.drop_translation_table! + t.string :title + t.text :body + + t.index :admin_notification_id + t.index :locale + end end end diff --git a/db/migrate/20180731173147_add_poll_question_translations.rb b/db/migrate/20180731173147_add_poll_question_translations.rb index 6d5676c40..55955ae43 100644 --- a/db/migrate/20180731173147_add_poll_question_translations.rb +++ b/db/migrate/20180731173147_add_poll_question_translations.rb @@ -1,12 +1,14 @@ class AddPollQuestionTranslations < ActiveRecord::Migration[4.2] - def self.up - Poll::Question.create_translation_table!( - { title: :string }, - { migrate_data: true } - ) - end + def change + create_table :poll_question_translations do |t| + t.integer :poll_question_id, null: false + t.string :locale, null: false + t.timestamps null: false - def self.down - Poll::Question.drop_translation_table! + t.string :title + + t.index :locale + t.index :poll_question_id + end end end diff --git a/db/migrate/20180801114529_add_poll_question_answer_translations.rb b/db/migrate/20180801114529_add_poll_question_answer_translations.rb index f9ef730d5..33cff66f3 100644 --- a/db/migrate/20180801114529_add_poll_question_answer_translations.rb +++ b/db/migrate/20180801114529_add_poll_question_answer_translations.rb @@ -1,15 +1,15 @@ class AddPollQuestionAnswerTranslations < ActiveRecord::Migration[4.2] - def self.up - Poll::Question::Answer.create_translation_table!( - { - title: :string, - description: :text - }, - { migrate_data: true } - ) - end + def change + create_table :poll_question_answer_translations do |t| + t.integer :poll_question_answer_id, null: false + t.string :locale, null: false + t.timestamps null: false - def self.down - Poll::Question::Answer.drop_translation_table! + t.string :title + t.text :description + + t.index :locale + t.index :poll_question_answer_id, name: "index_85270fa85f62081a3a227186b4c95fe4f7fa94b9" + end end end diff --git a/db/migrate/20180801140800_add_collaborative_legislation_translations.rb b/db/migrate/20180801140800_add_collaborative_legislation_translations.rb index 7dc385f77..9a30618f1 100644 --- a/db/migrate/20180801140800_add_collaborative_legislation_translations.rb +++ b/db/migrate/20180801140800_add_collaborative_legislation_translations.rb @@ -1,42 +1,54 @@ class AddCollaborativeLegislationTranslations < ActiveRecord::Migration[4.2] - def self.up - Legislation::Process.create_translation_table!( - { - title: :string, - summary: :text, - description: :text, - additional_info: :text - }, - { migrate_data: true } - ) + def change + create_table :legislation_process_translations do |t| + t.integer :legislation_process_id, null: false + t.string :locale, null: false + t.timestamps null: false - Legislation::Question.create_translation_table!( - { title: :text }, - { migrate_data: true } - ) + t.string :title + t.text :summary + t.text :description + t.text :additional_info - Legislation::DraftVersion.create_translation_table!( - { - title: :string, - changelog: :text, - body: :text - }, - { migrate_data: true } - ) + t.index :legislation_process_id, name: "index_199e5fed0aca73302243f6a1fca885ce10cdbb55" + t.index :locale + end - add_column :legislation_draft_version_translations, :body_html, :text - add_column :legislation_draft_version_translations, :toc_html, :text + create_table :legislation_question_translations do |t| + t.integer :legislation_question_id, null: false + t.string :locale, null: false + t.timestamps null: false - Legislation::QuestionOption.create_translation_table!( - { value: :string }, - { migrate_data: true } - ) - end + t.text :title - def self.down - Legislation::Process.drop_translation_table! - Legislation::DraftVersion.drop_translation_table! - Legislation::Question.drop_translation_table! - Legislation::QuestionOption.drop_translation_table! + t.index :legislation_question_id, name: "index_d34cc1e1fe6d5162210c41ce56533c5afabcdbd3" + t.index :locale + end + + create_table :legislation_draft_version_translations do |t| + t.integer :legislation_draft_version_id, null: false + t.string :locale, null: false + t.timestamps null: false + + t.string :title + t.text :changelog + t.text :body + t.text :body_html + t.text :toc_html + + t.index :legislation_draft_version_id, name: "index_900e5ba94457606e69e89193db426e8ddff809bc" + t.index :locale + end + + create_table :legislation_question_option_translations do |t| + t.integer :legislation_question_option_id, null: false + t.string :locale, null: false + t.timestamps null: false + + t.string :value + + t.index :legislation_question_option_id, name: "index_61bcec8729110b7f8e1e9e5ce08780878597a209" + t.index :locale + end end end diff --git a/db/migrate/20180924071722_add_translate_pages.rb b/db/migrate/20180924071722_add_translate_pages.rb index 987da6eb8..a5f5cfdce 100644 --- a/db/migrate/20180924071722_add_translate_pages.rb +++ b/db/migrate/20180924071722_add_translate_pages.rb @@ -1,19 +1,18 @@ class AddTranslatePages < ActiveRecord::Migration[4.2] - def self.up - SiteCustomization::Page.create_translation_table!( - { - title: :string, - subtitle: :string, - content: :text - }, - { migrate_data: true } - ) + def change + create_table :site_customization_page_translations do |t| + t.integer :site_customization_page_id, null: false + t.string :locale, null: false + t.timestamps null: false - change_column :site_customization_pages, :title, :string, null: true - end + t.string :title + t.string :subtitle + t.text :content - def self.down - SiteCustomization::Page.drop_translation_table! - change_column :site_customization_pages, :title, :string, null: false + t.index :locale + t.index :site_customization_page_id, name: "index_7fa0f9505738cb31a31f11fb2f4c4531fed7178b" + end + + change_column_null :site_customization_pages, :title, from: false, to: true end end diff --git a/db/migrate/20181129115006_add_proposals_translations.rb b/db/migrate/20181129115006_add_proposals_translations.rb index 8f05fbffd..4348cdbc8 100644 --- a/db/migrate/20181129115006_add_proposals_translations.rb +++ b/db/migrate/20181129115006_add_proposals_translations.rb @@ -1,17 +1,17 @@ class AddProposalsTranslations < ActiveRecord::Migration[4.2] - def self.up - Proposal.create_translation_table!( - { - title: :string, - description: :text, - summary: :text, - retired_explanation: :text - }, - { migrate_data: true } - ) - end + def change + create_table :proposal_translations do |t| + t.integer :proposal_id, null: false + t.string :locale, null: false + t.timestamps null: false - def self.down - Proposal.drop_translation_table! + t.string :title + t.text :description + t.text :summary + t.text :retired_explanation + + t.index :locale + t.index :proposal_id + end end end diff --git a/db/migrate/20181130141019_add_debates_translations.rb b/db/migrate/20181130141019_add_debates_translations.rb index 2cd1ad432..607abe3d3 100644 --- a/db/migrate/20181130141019_add_debates_translations.rb +++ b/db/migrate/20181130141019_add_debates_translations.rb @@ -1,15 +1,15 @@ class AddDebatesTranslations < ActiveRecord::Migration[4.2] - def self.up - Debate.create_translation_table!( - { - title: :string, - description: :text - }, - { migrate_data: true } - ) - end + def change + create_table :debate_translations do |t| + t.integer :debate_id, null: false + t.string :locale, null: false + t.timestamps null: false - def self.down - Debate.drop_translation_table! + t.string :title + t.text :description + + t.index :debate_id + t.index :locale + end end end diff --git a/db/migrate/20181205102153_add_comments_translations.rb b/db/migrate/20181205102153_add_comments_translations.rb index a7ea1b64c..c834a4bff 100644 --- a/db/migrate/20181205102153_add_comments_translations.rb +++ b/db/migrate/20181205102153_add_comments_translations.rb @@ -1,14 +1,14 @@ class AddCommentsTranslations < ActiveRecord::Migration[4.2] - def self.up - Comment.create_translation_table!( - { - body: :text - }, - { migrate_data: true } - ) - end + def change + create_table :comment_translations do |t| + t.integer :comment_id, null: false + t.string :locale, null: false + t.timestamps null: false - def self.down - Comment.drop_translation_table! + t.text :body + + t.index :comment_id + t.index :locale + end end end diff --git a/db/migrate/20181206153510_add_home_page_to_legislation_processes.rb b/db/migrate/20181206153510_add_home_page_to_legislation_processes.rb index 101aedbfe..741f8b424 100644 --- a/db/migrate/20181206153510_add_home_page_to_legislation_processes.rb +++ b/db/migrate/20181206153510_add_home_page_to_legislation_processes.rb @@ -1,15 +1,6 @@ class AddHomePageToLegislationProcesses < ActiveRecord::Migration[4.2] def change add_column :legislation_processes, :homepage_enabled, :boolean, default: false - - reversible do |dir| - dir.up do - Legislation::Process.add_translation_fields! homepage: :text - end - - dir.down do - remove_column :legislation_process_translations, :homepage - end - end + add_column :legislation_process_translations, :homepage, :text end end diff --git a/db/migrate/20181214094002_add_budget_investment_translations.rb b/db/migrate/20181214094002_add_budget_investment_translations.rb index 51b9fd048..53d7f9831 100644 --- a/db/migrate/20181214094002_add_budget_investment_translations.rb +++ b/db/migrate/20181214094002_add_budget_investment_translations.rb @@ -1,17 +1,15 @@ class AddBudgetInvestmentTranslations < ActiveRecord::Migration[4.2] - def self.up - Budget::Investment::Translation.without_auditing do - Budget::Investment.create_translation_table!( - { - title: :string, - description: :text - }, - { migrate_data: true } - ) + def change + create_table :budget_investment_translations do |t| + t.integer :budget_investment_id, null: false + t.string :locale, null: false + t.timestamps null: false + + t.string :title + t.text :description + + t.index :budget_investment_id + t.index :locale end end - - def self.down - Budget::Investment.drop_translation_table! - end end diff --git a/db/migrate/20190103132925_create_progress_bars.rb b/db/migrate/20190103132925_create_progress_bars.rb index 3ada28004..d7e026e35 100644 --- a/db/migrate/20190103132925_create_progress_bars.rb +++ b/db/migrate/20190103132925_create_progress_bars.rb @@ -1,23 +1,23 @@ class CreateProgressBars < ActiveRecord::Migration[4.2] def change - create_table :progress_bars do |t| + create_table :progress_bars, id: :serial do |t| t.integer :kind t.integer :percentage - t.references :progressable, polymorphic: true + t.string :progressable_type + t.integer :progressable_id t.timestamps null: false end - reversible do |change| - change.up do - ProgressBar.create_translation_table!({ - title: :string - }) - end + create_table :progress_bar_translations do |t| + t.integer :progress_bar_id, null: false + t.string :locale, null: false + t.timestamps null: false - change.down do - ProgressBar.drop_translation_table! - end + t.string :title + + t.index :locale + t.index :progress_bar_id end end end diff --git a/db/migrate/20190104170114_add_active_polls_translations.rb b/db/migrate/20190104170114_add_active_polls_translations.rb index 51f99a0e8..ef3ff02b2 100644 --- a/db/migrate/20190104170114_add_active_polls_translations.rb +++ b/db/migrate/20190104170114_add_active_polls_translations.rb @@ -1,14 +1,14 @@ class AddActivePollsTranslations < ActiveRecord::Migration[4.2] - def self.up - ActivePoll.create_translation_table!( - { - description: :text - }, - { migrate_data: true } - ) - end + def change + create_table :active_poll_translations do |t| + t.integer :active_poll_id, null: false + t.string :locale, null: false + t.timestamps null: false - def self.down - ActivePollPoll.drop_translation_table! + t.text "description" + + t.index :active_poll_id + t.index :locale + end end end diff --git a/db/migrate/20190118135741_add_budget_translations.rb b/db/migrate/20190118135741_add_budget_translations.rb index a561ebb47..41d04db86 100644 --- a/db/migrate/20190118135741_add_budget_translations.rb +++ b/db/migrate/20190118135741_add_budget_translations.rb @@ -1,14 +1,14 @@ class AddBudgetTranslations < ActiveRecord::Migration[4.2] - def self.up - Budget.create_translation_table!( - { - name: :string - }, - { migrate_data: true } - ) - end + def change + create_table :budget_translations do |t| + t.integer :budget_id, null: false + t.string :locale, null: false + t.timestamps null: false - def self.down - Budget.drop_translation_table! + t.string :name + + t.index :budget_id + t.index :locale + end end end diff --git a/db/migrate/20190119160418_add_budget_phase_translations.rb b/db/migrate/20190119160418_add_budget_phase_translations.rb index 07bbf3c84..e3f10a8a9 100644 --- a/db/migrate/20190119160418_add_budget_phase_translations.rb +++ b/db/migrate/20190119160418_add_budget_phase_translations.rb @@ -1,15 +1,15 @@ class AddBudgetPhaseTranslations < ActiveRecord::Migration[4.2] - def self.up - Budget::Phase.create_translation_table!( - { - description: :text, - summary: :text - }, - { migrate_data: true } - ) - end + def change + create_table :budget_phase_translations do |t| + t.integer :budget_phase_id, null: false + t.string :locale, null: false + t.timestamps null: false - def self.down - Budget::Phase.drop_translation_table! + t.text :description + t.text :summary + + t.index :budget_phase_id + t.index :locale + end end end diff --git a/db/migrate/20190120155819_add_budget_group_translations.rb b/db/migrate/20190120155819_add_budget_group_translations.rb index b7c2e841f..d45795192 100644 --- a/db/migrate/20190120155819_add_budget_group_translations.rb +++ b/db/migrate/20190120155819_add_budget_group_translations.rb @@ -1,14 +1,14 @@ class AddBudgetGroupTranslations < ActiveRecord::Migration[4.2] - def self.up - Budget::Group.create_translation_table!( - { - name: :string - }, - { migrate_data: true } - ) - end + def change + create_table :budget_group_translations do |t| + t.integer :budget_group_id, null: false + t.string :locale, null: false + t.timestamps null: false - def self.down - Budget::Group.drop_translation_table! + t.string :name + + t.index :budget_group_id + t.index :locale + end end end diff --git a/db/migrate/20190121171237_add_budget_heading_translations.rb b/db/migrate/20190121171237_add_budget_heading_translations.rb index f6889422e..c8cf50e09 100644 --- a/db/migrate/20190121171237_add_budget_heading_translations.rb +++ b/db/migrate/20190121171237_add_budget_heading_translations.rb @@ -1,14 +1,14 @@ class AddBudgetHeadingTranslations < ActiveRecord::Migration[4.2] - def self.up - Budget::Heading.create_translation_table!( - { - name: :string - }, - { migrate_data: true } - ) - end + def change + create_table :budget_heading_translations do |t| + t.integer :budget_heading_id, null: false + t.string :locale, null: false + t.timestamps null: false - def self.down - Budget::Heading.drop_translation_table! + t.string :name + + t.index :budget_heading_id + t.index :locale + end end end diff --git a/db/migrate/20190619133544_add_missing_unique_indices.acts_as_taggable_on_engine.rb b/db/migrate/20190619133544_add_missing_unique_indices.acts_as_taggable_on_engine.rb new file mode 100644 index 000000000..b766e234f --- /dev/null +++ b/db/migrate/20190619133544_add_missing_unique_indices.acts_as_taggable_on_engine.rb @@ -0,0 +1,17 @@ +# This migration comes from acts_as_taggable_on_engine (originally 2) +if ActiveRecord.gem_version >= Gem::Version.new("5.0") + class AddMissingUniqueIndices < ActiveRecord::Migration[4.2]; end +else + class AddMissingUniqueIndices < ActiveRecord::Migration; end +end +AddMissingUniqueIndices.class_eval do + def self.up + add_index :taggings, + [:tag_id, :taggable_id, :taggable_type, :context, :tagger_id, :tagger_type], + unique: true, name: "taggings_idx" + end + + def self.down + remove_index :taggings, name: "taggings_idx" + end +end diff --git a/db/migrate/20190619133547_add_missing_indexes_on_taggings.acts_as_taggable_on_engine.rb b/db/migrate/20190619133547_add_missing_indexes_on_taggings.acts_as_taggable_on_engine.rb new file mode 100644 index 000000000..185a6a3bf --- /dev/null +++ b/db/migrate/20190619133547_add_missing_indexes_on_taggings.acts_as_taggable_on_engine.rb @@ -0,0 +1,22 @@ +# This migration comes from acts_as_taggable_on_engine (originally 6) +if ActiveRecord.gem_version >= Gem::Version.new("5.0") + class AddMissingIndexesOnTaggings < ActiveRecord::Migration[4.2]; end +else + class AddMissingIndexesOnTaggings < ActiveRecord::Migration; end +end +AddMissingIndexesOnTaggings.class_eval do + def change + add_index :taggings, :taggable_id unless index_exists? :taggings, :taggable_id + add_index :taggings, :taggable_type unless index_exists? :taggings, :taggable_type + add_index :taggings, :tagger_id unless index_exists? :taggings, :tagger_id + add_index :taggings, :context unless index_exists? :taggings, :context + + unless index_exists? :taggings, [:tagger_id, :tagger_type] + add_index :taggings, [:tagger_id, :tagger_type] + end + + unless index_exists? :taggings, [:taggable_id, :taggable_type, :tagger_id, :context], name: "taggings_idy" + add_index :taggings, [:taggable_id, :taggable_type, :tagger_id, :context], name: "taggings_idy" + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 1eccac194..57012aa3c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -17,1589 +17,1596 @@ 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 ["context"], name: "index_taggings_on_context" + t.index ["tag_id", "taggable_id", "taggable_type", "context", "tagger_id", "tagger_type"], name: "taggings_idx", unique: true + 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" + t.index ["taggable_id", "taggable_type", "tagger_id", "context"], name: "taggings_idy" + t.index ["taggable_id"], name: "index_taggings_on_taggable_id" + t.index ["taggable_type"], name: "index_taggings_on_taggable_type" + t.index ["tagger_id", "tagger_type"], name: "index_taggings_on_tagger_id_and_tagger_type" + t.index ["tagger_id"], name: "index_taggings_on_tagger_id" + 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" diff --git a/spec/lib/tasks/sitemap_spec.rb b/spec/lib/tasks/sitemap_spec.rb index a3f1ad59f..d72bb9061 100644 --- a/spec/lib/tasks/sitemap_spec.rb +++ b/spec/lib/tasks/sitemap_spec.rb @@ -1,6 +1,6 @@ require "rails_helper" -describe "rake sitemap:create", type: :feature do +describe "rake sitemap:create", type: :system do let(:file) { Rails.root.join("public", "sitemap.xml") } before do diff --git a/spec/models/budget/investment_spec.rb b/spec/models/budget/investment_spec.rb index f358584c3..8a1b2ef29 100644 --- a/spec/models/budget/investment_spec.rb +++ b/spec/models/budget/investment_spec.rb @@ -1096,29 +1096,29 @@ describe Budget::Investment do let(:heading1) { create(:budget_heading, group: group) } let(:heading2) { create(:budget_heading, group: group) } - describe "heading_changed?" do + describe "saved_change_to_heading?" do it "returns true if budget is in balloting phase and heading has changed" do investment = create(:budget_investment, heading: heading1) - investment.heading = heading2 + investment.update!(heading: heading2) - expect(investment.heading_changed?).to eq(true) + expect(investment.saved_change_to_heading?).to eq(true) end it "returns false if heading has not changed" do - investment = create(:budget_investment) - investment.heading = investment.heading + investment = create(:budget_investment, heading: heading1) + investment.update!(heading: heading1) - expect(investment.heading_changed?).to eq(false) + expect(investment.saved_change_to_heading?).to eq(false) end it "returns false if budget is not balloting phase" do Budget::Phase::PHASE_KINDS.reject { |phase| phase == "balloting" }.each do |phase| budget.update!(phase: phase) - investment = create(:budget_investment, budget: budget) + investment = create(:budget_investment, heading: heading1) - investment.heading = heading2 + investment.update!(heading: heading2) - expect(investment.heading_changed?).to eq(false) + expect(investment.saved_change_to_heading?).to eq(false) end end end @@ -1327,7 +1327,7 @@ describe Budget::Investment do let(:investment) { create(:budget_investment, :with_milestone_tags) } it "has milestone_tags" do - expect(investment.milestone_tag_list.count).to eq(1) + expect(investment.reload.milestone_tag_list.count).to eq(1) end end end diff --git a/spec/models/legislation/process_spec.rb b/spec/models/legislation/process_spec.rb index 6c31e175f..8a2c9eee7 100644 --- a/spec/models/legislation/process_spec.rb +++ b/spec/models/legislation/process_spec.rb @@ -218,7 +218,7 @@ describe Legislation::Process do let(:process) { create(:legislation_process, :with_milestone_tags) } it "has milestone_tags" do - expect(process.milestone_tag_list.count).to eq(1) + expect(process.reload.milestone_tag_list.count).to eq(1) end end end diff --git a/spec/models/proposal_spec.rb b/spec/models/proposal_spec.rb index b92d4726c..e15d796ae 100644 --- a/spec/models/proposal_spec.rb +++ b/spec/models/proposal_spec.rb @@ -1045,7 +1045,7 @@ describe Proposal do let(:proposal) { create(:proposal, :with_milestone_tags) } it "has milestone_tags" do - expect(proposal.milestone_tag_list.count).to eq(1) + expect(proposal.reload.milestone_tag_list.count).to eq(1) end end end diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index e8d6b0646..3de8fd85d 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -19,6 +19,18 @@ Warden.test_mode! ActiveRecord::Migration.maintain_test_schema! +# Monkey patch from https://github.com/rails/rails/pull/32293 +# Remove when we upgrade to Rails 5.2 +require "action_dispatch/system_testing/test_helpers/setup_and_teardown" +module ActionDispatch::SystemTesting::TestHelpers::SetupAndTeardown + def after_teardown + take_failed_screenshot + Capybara.reset_sessions! + ensure + super + end +end + RSpec.configure do |config| config.infer_spec_type_from_file_location! config.after do @@ -26,10 +38,6 @@ RSpec.configure do |config| end end -Capybara.register_driver :chrome do |app| - Capybara::Selenium::Driver.new(app, browser: :chrome) -end - Capybara.register_driver :headless_chrome do |app| capabilities = Selenium::WebDriver::Remote::Capabilities.chrome( "goog:chromeOptions" => { @@ -44,8 +52,6 @@ Capybara.register_driver :headless_chrome do |app| ) end -Capybara.javascript_driver = :headless_chrome - Capybara.exact = true OmniAuth.config.test_mode = true diff --git a/spec/shared/features/admin_milestoneable.rb b/spec/shared/system/admin_milestoneable.rb similarity index 100% rename from spec/shared/features/admin_milestoneable.rb rename to spec/shared/system/admin_milestoneable.rb diff --git a/spec/shared/features/admin_progressable.rb b/spec/shared/system/admin_progressable.rb similarity index 100% rename from spec/shared/features/admin_progressable.rb rename to spec/shared/system/admin_progressable.rb diff --git a/spec/shared/features/documentable.rb b/spec/shared/system/documentable.rb similarity index 100% rename from spec/shared/features/documentable.rb rename to spec/shared/system/documentable.rb diff --git a/spec/shared/features/followable.rb b/spec/shared/system/followable.rb similarity index 100% rename from spec/shared/features/followable.rb rename to spec/shared/system/followable.rb diff --git a/spec/shared/features/imageable.rb b/spec/shared/system/imageable.rb similarity index 100% rename from spec/shared/features/imageable.rb rename to spec/shared/system/imageable.rb diff --git a/spec/shared/features/mappable.rb b/spec/shared/system/mappable.rb similarity index 100% rename from spec/shared/features/mappable.rb rename to spec/shared/system/mappable.rb diff --git a/spec/shared/features/milestoneable.rb b/spec/shared/system/milestoneable.rb similarity index 100% rename from spec/shared/features/milestoneable.rb rename to spec/shared/system/milestoneable.rb diff --git a/spec/shared/features/nested_documentable.rb b/spec/shared/system/nested_documentable.rb similarity index 100% rename from spec/shared/features/nested_documentable.rb rename to spec/shared/system/nested_documentable.rb diff --git a/spec/shared/features/nested_imageable.rb b/spec/shared/system/nested_imageable.rb similarity index 100% rename from spec/shared/features/nested_imageable.rb rename to spec/shared/system/nested_imageable.rb diff --git a/spec/shared/features/notifiable_in_app.rb b/spec/shared/system/notifiable_in_app.rb similarity index 100% rename from spec/shared/features/notifiable_in_app.rb rename to spec/shared/system/notifiable_in_app.rb diff --git a/spec/shared/features/progressable.rb b/spec/shared/system/progressable.rb similarity index 100% rename from spec/shared/features/progressable.rb rename to spec/shared/system/progressable.rb diff --git a/spec/shared/features/relationable.rb b/spec/shared/system/relationable.rb similarity index 100% rename from spec/shared/features/relationable.rb rename to spec/shared/system/relationable.rb diff --git a/spec/shared/features/remotely_translatable.rb b/spec/shared/system/remotely_translatable.rb similarity index 100% rename from spec/shared/features/remotely_translatable.rb rename to spec/shared/system/remotely_translatable.rb diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ccacaa333..ff616c6e9 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,4 @@ require "factory_bot_rails" -require "database_cleaner" require "email_spec" require "devise" require "knapsack_pro" @@ -9,7 +8,7 @@ Dir["./spec/support/**/*.rb"].sort.each { |f| require f } Dir["./spec/shared/**/*.rb"].sort.each { |f| require f } RSpec.configure do |config| - config.use_transactional_fixtures = false + config.use_transactional_fixtures = true config.filter_run :focus config.run_all_when_everything_filtered = true @@ -22,49 +21,17 @@ RSpec.configure do |config| config.include(ActiveSupport::Testing::TimeHelpers) config.before(:suite) do - DatabaseCleaner.clean_with :truncation - end - - config.before(:suite) do - if config.use_transactional_fixtures? - raise(<<-MSG) - Delete line `config.use_transactional_fixtures = true` from rails_helper.rb - (or set it to false) to prevent uncommitted transactions being used in - JavaScript-dependent specs. - - During testing, the app-under-test that the browser driver connects to - uses a different database connection to the database connection used by - the spec. The app's database connection would not be able to access - uncommitted transaction data setup over the spec's database connection. - MSG - end - - DatabaseCleaner.clean_with(:truncation) + Rails.application.load_seed end config.before do |example| - DatabaseCleaner.strategy = :transaction I18n.locale = :en Globalize.locale = nil Globalize.set_fallbacks_to_all_available_locales - load Rails.root.join("db", "seeds.rb").to_s Setting["feature.user.skip_verification"] = nil end - config.before(:each, type: :feature) do - # :rack_test driver's Rack app under test shares database connection - # with the specs, so continue to use transaction strategy for speed. - driver_shares_db_connection_with_specs = Capybara.current_driver == :rack_test - - unless driver_shares_db_connection_with_specs - # Driver is probably for an external browser with an app - # under test that does *not* share a database connection with the - # specs, so use truncation strategy. - DatabaseCleaner.strategy = :truncation - end - end - - config.before(:each, type: :feature) do + config.before(:each, type: :system) do Capybara::Webmock.start end @@ -76,20 +43,20 @@ RSpec.configure do |config| page.driver.reset! end - config.before do - DatabaseCleaner.start + config.before(:each, type: :system) do |example| + driven_by :rack_test end - config.append_after do - DatabaseCleaner.clean + config.before(:each, type: :system, js: true) do + driven_by :headless_chrome end - config.before(:each, type: :feature) do + config.before(:each, type: :system) do Bullet.start_request allow(InvisibleCaptcha).to receive(:timestamp_threshold).and_return(0) end - config.after(:each, type: :feature) do + config.after(:each, type: :system) do Bullet.perform_out_of_channel_notifications if Bullet.notification? Bullet.end_request end diff --git a/spec/support/common_actions/verifications.rb b/spec/support/common_actions/verifications.rb index 1023a69b4..92ef462e0 100644 --- a/spec/support/common_actions/verifications.rb +++ b/spec/support/common_actions/verifications.rb @@ -44,17 +44,21 @@ module Verifications end end - def fill_in_ckeditor(text, params = {}) - locator = find("label", text: text)[:for] + def fill_in_ckeditor(label, with:) + locator = find("label", text: label)[:for] + + until page.execute_script("return CKEDITOR.instances.#{locator}.status === 'ready';") do + sleep 0.01 + end # Fill the editor content page.execute_script <<-SCRIPT var ckeditor = CKEDITOR.instances.#{locator} - ckeditor.setData("#{params[:with]}") + ckeditor.setData("#{with}") ckeditor.focus() ckeditor.updateElement() SCRIPT - expect(page).to have_ckeditor text, with: params[:with] + expect(page).to have_ckeditor label, with: with end end diff --git a/spec/features/account_spec.rb b/spec/system/account_spec.rb similarity index 100% rename from spec/features/account_spec.rb rename to spec/system/account_spec.rb diff --git a/spec/features/admin/activity_spec.rb b/spec/system/admin/activity_spec.rb similarity index 100% rename from spec/features/admin/activity_spec.rb rename to spec/system/admin/activity_spec.rb diff --git a/spec/features/admin/admin_notifications_spec.rb b/spec/system/admin/admin_notifications_spec.rb similarity index 100% rename from spec/features/admin/admin_notifications_spec.rb rename to spec/system/admin/admin_notifications_spec.rb diff --git a/spec/features/admin/administrators_spec.rb b/spec/system/admin/administrators_spec.rb similarity index 100% rename from spec/features/admin/administrators_spec.rb rename to spec/system/admin/administrators_spec.rb diff --git a/spec/features/admin/audits_spec.rb b/spec/system/admin/audits_spec.rb similarity index 100% rename from spec/features/admin/audits_spec.rb rename to spec/system/admin/audits_spec.rb diff --git a/spec/features/admin/banners_spec.rb b/spec/system/admin/banners_spec.rb similarity index 100% rename from spec/features/admin/banners_spec.rb rename to spec/system/admin/banners_spec.rb diff --git a/spec/features/admin/budget_groups_spec.rb b/spec/system/admin/budget_groups_spec.rb similarity index 100% rename from spec/features/admin/budget_groups_spec.rb rename to spec/system/admin/budget_groups_spec.rb diff --git a/spec/features/admin/budget_headings_spec.rb b/spec/system/admin/budget_headings_spec.rb similarity index 100% rename from spec/features/admin/budget_headings_spec.rb rename to spec/system/admin/budget_headings_spec.rb diff --git a/spec/features/admin/budget_investments_spec.rb b/spec/system/admin/budget_investments_spec.rb similarity index 100% rename from spec/features/admin/budget_investments_spec.rb rename to spec/system/admin/budget_investments_spec.rb diff --git a/spec/features/admin/budget_phases_spec.rb b/spec/system/admin/budget_phases_spec.rb similarity index 100% rename from spec/features/admin/budget_phases_spec.rb rename to spec/system/admin/budget_phases_spec.rb diff --git a/spec/features/admin/budgets_spec.rb b/spec/system/admin/budgets_spec.rb similarity index 100% rename from spec/features/admin/budgets_spec.rb rename to spec/system/admin/budgets_spec.rb diff --git a/spec/features/admin/comments_spec.rb b/spec/system/admin/comments_spec.rb similarity index 100% rename from spec/features/admin/comments_spec.rb rename to spec/system/admin/comments_spec.rb diff --git a/spec/features/admin/dashboard/actions_spec.rb b/spec/system/admin/dashboard/actions_spec.rb similarity index 100% rename from spec/features/admin/dashboard/actions_spec.rb rename to spec/system/admin/dashboard/actions_spec.rb diff --git a/spec/features/admin/dashboard/administrator_tasks_spec.rb b/spec/system/admin/dashboard/administrator_tasks_spec.rb similarity index 100% rename from spec/features/admin/dashboard/administrator_tasks_spec.rb rename to spec/system/admin/dashboard/administrator_tasks_spec.rb diff --git a/spec/features/admin/debates_spec.rb b/spec/system/admin/debates_spec.rb similarity index 100% rename from spec/features/admin/debates_spec.rb rename to spec/system/admin/debates_spec.rb diff --git a/spec/features/admin/emails/emails_download_spec.rb b/spec/system/admin/emails/emails_download_spec.rb similarity index 100% rename from spec/features/admin/emails/emails_download_spec.rb rename to spec/system/admin/emails/emails_download_spec.rb diff --git a/spec/features/admin/emails/newsletters_spec.rb b/spec/system/admin/emails/newsletters_spec.rb similarity index 100% rename from spec/features/admin/emails/newsletters_spec.rb rename to spec/system/admin/emails/newsletters_spec.rb diff --git a/spec/features/admin/feature_flags_spec.rb b/spec/system/admin/feature_flags_spec.rb similarity index 100% rename from spec/features/admin/feature_flags_spec.rb rename to spec/system/admin/feature_flags_spec.rb diff --git a/spec/features/admin/geozones_spec.rb b/spec/system/admin/geozones_spec.rb similarity index 100% rename from spec/features/admin/geozones_spec.rb rename to spec/system/admin/geozones_spec.rb diff --git a/spec/features/admin/hidden_budget_investments_spec.rb b/spec/system/admin/hidden_budget_investments_spec.rb similarity index 100% rename from spec/features/admin/hidden_budget_investments_spec.rb rename to spec/system/admin/hidden_budget_investments_spec.rb diff --git a/spec/features/admin/hidden_comments_spec.rb b/spec/system/admin/hidden_comments_spec.rb similarity index 100% rename from spec/features/admin/hidden_comments_spec.rb rename to spec/system/admin/hidden_comments_spec.rb diff --git a/spec/features/admin/hidden_debates_spec.rb b/spec/system/admin/hidden_debates_spec.rb similarity index 100% rename from spec/features/admin/hidden_debates_spec.rb rename to spec/system/admin/hidden_debates_spec.rb diff --git a/spec/features/admin/hidden_proposals_spec.rb b/spec/system/admin/hidden_proposals_spec.rb similarity index 100% rename from spec/features/admin/hidden_proposals_spec.rb rename to spec/system/admin/hidden_proposals_spec.rb diff --git a/spec/features/admin/hidden_users_spec.rb b/spec/system/admin/hidden_users_spec.rb similarity index 100% rename from spec/features/admin/hidden_users_spec.rb rename to spec/system/admin/hidden_users_spec.rb diff --git a/spec/features/admin/homepage/homepage_spec.rb b/spec/system/admin/homepage/homepage_spec.rb similarity index 100% rename from spec/features/admin/homepage/homepage_spec.rb rename to spec/system/admin/homepage/homepage_spec.rb diff --git a/spec/features/admin/legislation/draft_versions_spec.rb b/spec/system/admin/legislation/draft_versions_spec.rb similarity index 100% rename from spec/features/admin/legislation/draft_versions_spec.rb rename to spec/system/admin/legislation/draft_versions_spec.rb diff --git a/spec/features/admin/legislation/processes_spec.rb b/spec/system/admin/legislation/processes_spec.rb similarity index 100% rename from spec/features/admin/legislation/processes_spec.rb rename to spec/system/admin/legislation/processes_spec.rb diff --git a/spec/features/admin/legislation/proposals_spec.rb b/spec/system/admin/legislation/proposals_spec.rb similarity index 100% rename from spec/features/admin/legislation/proposals_spec.rb rename to spec/system/admin/legislation/proposals_spec.rb diff --git a/spec/features/admin/legislation/questions_spec.rb b/spec/system/admin/legislation/questions_spec.rb similarity index 100% rename from spec/features/admin/legislation/questions_spec.rb rename to spec/system/admin/legislation/questions_spec.rb diff --git a/spec/features/admin/local_census_records/imports_spec.rb b/spec/system/admin/local_census_records/imports_spec.rb similarity index 100% rename from spec/features/admin/local_census_records/imports_spec.rb rename to spec/system/admin/local_census_records/imports_spec.rb diff --git a/spec/features/admin/local_census_records_spec.rb b/spec/system/admin/local_census_records_spec.rb similarity index 100% rename from spec/features/admin/local_census_records_spec.rb rename to spec/system/admin/local_census_records_spec.rb diff --git a/spec/features/admin/managers_spec.rb b/spec/system/admin/managers_spec.rb similarity index 100% rename from spec/features/admin/managers_spec.rb rename to spec/system/admin/managers_spec.rb diff --git a/spec/features/admin/milestone_statuses_spec.rb b/spec/system/admin/milestone_statuses_spec.rb similarity index 100% rename from spec/features/admin/milestone_statuses_spec.rb rename to spec/system/admin/milestone_statuses_spec.rb diff --git a/spec/features/admin/moderators_spec.rb b/spec/system/admin/moderators_spec.rb similarity index 100% rename from spec/features/admin/moderators_spec.rb rename to spec/system/admin/moderators_spec.rb diff --git a/spec/features/admin/officials_spec.rb b/spec/system/admin/officials_spec.rb similarity index 100% rename from spec/features/admin/officials_spec.rb rename to spec/system/admin/officials_spec.rb diff --git a/spec/features/admin/organizations_spec.rb b/spec/system/admin/organizations_spec.rb similarity index 100% rename from spec/features/admin/organizations_spec.rb rename to spec/system/admin/organizations_spec.rb diff --git a/spec/features/admin/poll/active_polls_spec.rb b/spec/system/admin/poll/active_polls_spec.rb similarity index 100% rename from spec/features/admin/poll/active_polls_spec.rb rename to spec/system/admin/poll/active_polls_spec.rb diff --git a/spec/features/admin/poll/booth_assigments_spec.rb b/spec/system/admin/poll/booth_assigments_spec.rb similarity index 100% rename from spec/features/admin/poll/booth_assigments_spec.rb rename to spec/system/admin/poll/booth_assigments_spec.rb diff --git a/spec/features/admin/poll/booths_spec.rb b/spec/system/admin/poll/booths_spec.rb similarity index 100% rename from spec/features/admin/poll/booths_spec.rb rename to spec/system/admin/poll/booths_spec.rb diff --git a/spec/features/admin/poll/officer_assignments_spec.rb b/spec/system/admin/poll/officer_assignments_spec.rb similarity index 100% rename from spec/features/admin/poll/officer_assignments_spec.rb rename to spec/system/admin/poll/officer_assignments_spec.rb diff --git a/spec/features/admin/poll/officers_spec.rb b/spec/system/admin/poll/officers_spec.rb similarity index 100% rename from spec/features/admin/poll/officers_spec.rb rename to spec/system/admin/poll/officers_spec.rb diff --git a/spec/features/admin/poll/polls_spec.rb b/spec/system/admin/poll/polls_spec.rb similarity index 100% rename from spec/features/admin/poll/polls_spec.rb rename to spec/system/admin/poll/polls_spec.rb diff --git a/spec/features/admin/poll/questions/answers/answers_spec.rb b/spec/system/admin/poll/questions/answers/answers_spec.rb similarity index 76% rename from spec/features/admin/poll/questions/answers/answers_spec.rb rename to spec/system/admin/poll/questions/answers/answers_spec.rb index fdd1a4863..395a1bed3 100644 --- a/spec/features/admin/poll/questions/answers/answers_spec.rb +++ b/spec/system/admin/poll/questions/answers/answers_spec.rb @@ -58,4 +58,20 @@ describe "Answers" do expect("Another title").to appear_before("New title") end + + scenario "Reorder", :js do + question = create(:poll_question) + create(:poll_question_answer, question: question, title: "First", given_order: 1) + create(:poll_question_answer, question: question, title: "Last", given_order: 2) + + visit admin_question_path(question) + + within("tbody.sortable") do + expect("First").to appear_before("Last") + + find("tr", text: "Last").drag_to(find("tr", text: "First")) + + expect("Last").to appear_before("First") + end + end end diff --git a/spec/features/admin/poll/questions/answers/documents/documents_spec.rb b/spec/system/admin/poll/questions/answers/documents/documents_spec.rb similarity index 100% rename from spec/features/admin/poll/questions/answers/documents/documents_spec.rb rename to spec/system/admin/poll/questions/answers/documents/documents_spec.rb diff --git a/spec/features/admin/poll/questions/answers/images/images_spec.rb b/spec/system/admin/poll/questions/answers/images/images_spec.rb similarity index 100% rename from spec/features/admin/poll/questions/answers/images/images_spec.rb rename to spec/system/admin/poll/questions/answers/images/images_spec.rb diff --git a/spec/features/admin/poll/questions/answers/videos/videos_spec.rb b/spec/system/admin/poll/questions/answers/videos/videos_spec.rb similarity index 100% rename from spec/features/admin/poll/questions/answers/videos/videos_spec.rb rename to spec/system/admin/poll/questions/answers/videos/videos_spec.rb diff --git a/spec/features/admin/poll/questions_spec.rb b/spec/system/admin/poll/questions_spec.rb similarity index 100% rename from spec/features/admin/poll/questions_spec.rb rename to spec/system/admin/poll/questions_spec.rb diff --git a/spec/features/admin/poll/shifts_spec.rb b/spec/system/admin/poll/shifts_spec.rb similarity index 100% rename from spec/features/admin/poll/shifts_spec.rb rename to spec/system/admin/poll/shifts_spec.rb diff --git a/spec/features/admin/proposal_notifications_spec.rb b/spec/system/admin/proposal_notifications_spec.rb similarity index 100% rename from spec/features/admin/proposal_notifications_spec.rb rename to spec/system/admin/proposal_notifications_spec.rb diff --git a/spec/features/admin/proposals_spec.rb b/spec/system/admin/proposals_spec.rb similarity index 100% rename from spec/features/admin/proposals_spec.rb rename to spec/system/admin/proposals_spec.rb diff --git a/spec/features/admin/settings_spec.rb b/spec/system/admin/settings_spec.rb similarity index 100% rename from spec/features/admin/settings_spec.rb rename to spec/system/admin/settings_spec.rb diff --git a/spec/features/admin/signature_sheets_spec.rb b/spec/system/admin/signature_sheets_spec.rb similarity index 100% rename from spec/features/admin/signature_sheets_spec.rb rename to spec/system/admin/signature_sheets_spec.rb diff --git a/spec/features/admin/site_customization/content_blocks_spec.rb b/spec/system/admin/site_customization/content_blocks_spec.rb similarity index 100% rename from spec/features/admin/site_customization/content_blocks_spec.rb rename to spec/system/admin/site_customization/content_blocks_spec.rb diff --git a/spec/features/admin/site_customization/documents_spec.rb b/spec/system/admin/site_customization/documents_spec.rb similarity index 100% rename from spec/features/admin/site_customization/documents_spec.rb rename to spec/system/admin/site_customization/documents_spec.rb diff --git a/spec/features/admin/site_customization/images_spec.rb b/spec/system/admin/site_customization/images_spec.rb similarity index 100% rename from spec/features/admin/site_customization/images_spec.rb rename to spec/system/admin/site_customization/images_spec.rb diff --git a/spec/features/admin/site_customization/information_texts_spec.rb b/spec/system/admin/site_customization/information_texts_spec.rb similarity index 100% rename from spec/features/admin/site_customization/information_texts_spec.rb rename to spec/system/admin/site_customization/information_texts_spec.rb diff --git a/spec/features/admin/site_customization/pages_spec.rb b/spec/system/admin/site_customization/pages_spec.rb similarity index 100% rename from spec/features/admin/site_customization/pages_spec.rb rename to spec/system/admin/site_customization/pages_spec.rb diff --git a/spec/features/admin/stats_spec.rb b/spec/system/admin/stats_spec.rb similarity index 100% rename from spec/features/admin/stats_spec.rb rename to spec/system/admin/stats_spec.rb diff --git a/spec/features/admin/system_emails_spec.rb b/spec/system/admin/system_emails_spec.rb similarity index 100% rename from spec/features/admin/system_emails_spec.rb rename to spec/system/admin/system_emails_spec.rb diff --git a/spec/features/admin/tags_spec.rb b/spec/system/admin/tags_spec.rb similarity index 100% rename from spec/features/admin/tags_spec.rb rename to spec/system/admin/tags_spec.rb diff --git a/spec/features/admin/translatable_spec.rb b/spec/system/admin/translatable_spec.rb similarity index 100% rename from spec/features/admin/translatable_spec.rb rename to spec/system/admin/translatable_spec.rb diff --git a/spec/features/admin/users_spec.rb b/spec/system/admin/users_spec.rb similarity index 100% rename from spec/features/admin/users_spec.rb rename to spec/system/admin/users_spec.rb diff --git a/spec/features/admin/valuator_groups_spec.rb b/spec/system/admin/valuator_groups_spec.rb similarity index 100% rename from spec/features/admin/valuator_groups_spec.rb rename to spec/system/admin/valuator_groups_spec.rb diff --git a/spec/features/admin/valuators_spec.rb b/spec/system/admin/valuators_spec.rb similarity index 100% rename from spec/features/admin/valuators_spec.rb rename to spec/system/admin/valuators_spec.rb diff --git a/spec/features/admin/verifications_spec.rb b/spec/system/admin/verifications_spec.rb similarity index 100% rename from spec/features/admin/verifications_spec.rb rename to spec/system/admin/verifications_spec.rb diff --git a/spec/features/admin/widgets/cards_spec.rb b/spec/system/admin/widgets/cards_spec.rb similarity index 100% rename from spec/features/admin/widgets/cards_spec.rb rename to spec/system/admin/widgets/cards_spec.rb diff --git a/spec/features/admin_spec.rb b/spec/system/admin_spec.rb similarity index 100% rename from spec/features/admin_spec.rb rename to spec/system/admin_spec.rb diff --git a/spec/features/banners_spec.rb b/spec/system/banners_spec.rb similarity index 100% rename from spec/features/banners_spec.rb rename to spec/system/banners_spec.rb diff --git a/spec/features/budget_polls/ballot_sheets_spec.rb b/spec/system/budget_polls/ballot_sheets_spec.rb similarity index 100% rename from spec/features/budget_polls/ballot_sheets_spec.rb rename to spec/system/budget_polls/ballot_sheets_spec.rb diff --git a/spec/features/budget_polls/budgets_spec.rb b/spec/system/budget_polls/budgets_spec.rb similarity index 100% rename from spec/features/budget_polls/budgets_spec.rb rename to spec/system/budget_polls/budgets_spec.rb diff --git a/spec/features/budget_polls/officing_spec.rb b/spec/system/budget_polls/officing_spec.rb similarity index 100% rename from spec/features/budget_polls/officing_spec.rb rename to spec/system/budget_polls/officing_spec.rb diff --git a/spec/features/budget_polls/polls_spec.rb b/spec/system/budget_polls/polls_spec.rb similarity index 100% rename from spec/features/budget_polls/polls_spec.rb rename to spec/system/budget_polls/polls_spec.rb diff --git a/spec/features/budget_polls/questions_spec.rb b/spec/system/budget_polls/questions_spec.rb similarity index 100% rename from spec/features/budget_polls/questions_spec.rb rename to spec/system/budget_polls/questions_spec.rb diff --git a/spec/features/budget_polls/voter_spec.rb b/spec/system/budget_polls/voter_spec.rb similarity index 100% rename from spec/features/budget_polls/voter_spec.rb rename to spec/system/budget_polls/voter_spec.rb diff --git a/spec/features/budgets/ballots_spec.rb b/spec/system/budgets/ballots_spec.rb similarity index 100% rename from spec/features/budgets/ballots_spec.rb rename to spec/system/budgets/ballots_spec.rb diff --git a/spec/features/budgets/budgets_spec.rb b/spec/system/budgets/budgets_spec.rb similarity index 100% rename from spec/features/budgets/budgets_spec.rb rename to spec/system/budgets/budgets_spec.rb diff --git a/spec/features/budgets/executions_spec.rb b/spec/system/budgets/executions_spec.rb similarity index 100% rename from spec/features/budgets/executions_spec.rb rename to spec/system/budgets/executions_spec.rb diff --git a/spec/features/budgets/groups_spec.rb b/spec/system/budgets/groups_spec.rb similarity index 100% rename from spec/features/budgets/groups_spec.rb rename to spec/system/budgets/groups_spec.rb diff --git a/spec/features/budgets/investments_spec.rb b/spec/system/budgets/investments_spec.rb similarity index 100% rename from spec/features/budgets/investments_spec.rb rename to spec/system/budgets/investments_spec.rb diff --git a/spec/features/budgets/results_spec.rb b/spec/system/budgets/results_spec.rb similarity index 100% rename from spec/features/budgets/results_spec.rb rename to spec/system/budgets/results_spec.rb diff --git a/spec/features/budgets/stats_spec.rb b/spec/system/budgets/stats_spec.rb similarity index 100% rename from spec/features/budgets/stats_spec.rb rename to spec/system/budgets/stats_spec.rb diff --git a/spec/features/budgets/votes_spec.rb b/spec/system/budgets/votes_spec.rb similarity index 100% rename from spec/features/budgets/votes_spec.rb rename to spec/system/budgets/votes_spec.rb diff --git a/spec/features/campaigns_spec.rb b/spec/system/campaigns_spec.rb similarity index 100% rename from spec/features/campaigns_spec.rb rename to spec/system/campaigns_spec.rb diff --git a/spec/features/ckeditor_spec.rb b/spec/system/ckeditor_spec.rb similarity index 72% rename from spec/features/ckeditor_spec.rb rename to spec/system/ckeditor_spec.rb index 35e9d360a..ea72ca4ca 100644 --- a/spec/features/ckeditor_spec.rb +++ b/spec/system/ckeditor_spec.rb @@ -19,7 +19,16 @@ describe "CKEditor" do login_as(create(:administrator).user) visit new_admin_site_customization_page_path + fill_in_ckeditor "Content", with: "Filling in to make sure CKEditor is loaded" find(".cke_button__image").click + + expect(page).to have_css(".cke_dialog") + + execute_script "document.getElementsByClassName('cke_dialog')[0].style.left = '0px'" + execute_script "document.getElementsByClassName('cke_dialog')[0].style.top = '0px'" + + expect(find(".cke_dialog")).to match_style(left: "0px", top: "0px") + click_link "Upload" within_frame(1) do @@ -33,8 +42,9 @@ describe "CKEditor" do scenario "cannot upload attachments through link tab", :js do login_as(create(:administrator).user) - visit new_admin_site_customization_page_path + visit new_admin_site_customization_page_path + fill_in_ckeditor "Content", with: "Filling in to make sure CKEditor is loaded" find(".cke_button__link").click expect(page).to have_css(".cke_dialog") diff --git a/spec/features/comments/budget_investments_spec.rb b/spec/system/comments/budget_investments_spec.rb similarity index 100% rename from spec/features/comments/budget_investments_spec.rb rename to spec/system/comments/budget_investments_spec.rb diff --git a/spec/features/comments/budget_investments_valuation_spec.rb b/spec/system/comments/budget_investments_valuation_spec.rb similarity index 100% rename from spec/features/comments/budget_investments_valuation_spec.rb rename to spec/system/comments/budget_investments_valuation_spec.rb diff --git a/spec/features/comments/debates_spec.rb b/spec/system/comments/debates_spec.rb similarity index 100% rename from spec/features/comments/debates_spec.rb rename to spec/system/comments/debates_spec.rb diff --git a/spec/features/comments/legislation_annotations_spec.rb b/spec/system/comments/legislation_annotations_spec.rb similarity index 100% rename from spec/features/comments/legislation_annotations_spec.rb rename to spec/system/comments/legislation_annotations_spec.rb diff --git a/spec/features/comments/legislation_questions_spec.rb b/spec/system/comments/legislation_questions_spec.rb similarity index 100% rename from spec/features/comments/legislation_questions_spec.rb rename to spec/system/comments/legislation_questions_spec.rb diff --git a/spec/features/comments/poll_questions_spec.rb b/spec/system/comments/poll_questions_spec.rb similarity index 100% rename from spec/features/comments/poll_questions_spec.rb rename to spec/system/comments/poll_questions_spec.rb diff --git a/spec/features/comments/polls_spec.rb b/spec/system/comments/polls_spec.rb similarity index 100% rename from spec/features/comments/polls_spec.rb rename to spec/system/comments/polls_spec.rb diff --git a/spec/features/comments/proposals_spec.rb b/spec/system/comments/proposals_spec.rb similarity index 100% rename from spec/features/comments/proposals_spec.rb rename to spec/system/comments/proposals_spec.rb diff --git a/spec/features/comments/topics_spec.rb b/spec/system/comments/topics_spec.rb similarity index 100% rename from spec/features/comments/topics_spec.rb rename to spec/system/comments/topics_spec.rb diff --git a/spec/features/communities_spec.rb b/spec/system/communities_spec.rb similarity index 100% rename from spec/features/communities_spec.rb rename to spec/system/communities_spec.rb diff --git a/spec/features/dashboard/dashboard_spec.rb b/spec/system/dashboard/dashboard_spec.rb similarity index 100% rename from spec/features/dashboard/dashboard_spec.rb rename to spec/system/dashboard/dashboard_spec.rb diff --git a/spec/features/dashboard/mailing_spec.rb b/spec/system/dashboard/mailing_spec.rb similarity index 100% rename from spec/features/dashboard/mailing_spec.rb rename to spec/system/dashboard/mailing_spec.rb diff --git a/spec/features/dashboard/polls_spec.rb b/spec/system/dashboard/polls_spec.rb similarity index 100% rename from spec/features/dashboard/polls_spec.rb rename to spec/system/dashboard/polls_spec.rb diff --git a/spec/features/dashboard/poster_spec.rb b/spec/system/dashboard/poster_spec.rb similarity index 100% rename from spec/features/dashboard/poster_spec.rb rename to spec/system/dashboard/poster_spec.rb diff --git a/spec/features/debates_spec.rb b/spec/system/debates_spec.rb similarity index 100% rename from spec/features/debates_spec.rb rename to spec/system/debates_spec.rb diff --git a/spec/features/direct_messages_spec.rb b/spec/system/direct_messages_spec.rb similarity index 100% rename from spec/features/direct_messages_spec.rb rename to spec/system/direct_messages_spec.rb diff --git a/spec/features/emails_spec.rb b/spec/system/emails_spec.rb similarity index 100% rename from spec/features/emails_spec.rb rename to spec/system/emails_spec.rb diff --git a/spec/features/help_page_spec.rb b/spec/system/help_page_spec.rb similarity index 100% rename from spec/features/help_page_spec.rb rename to spec/system/help_page_spec.rb diff --git a/spec/features/home_spec.rb b/spec/system/home_spec.rb similarity index 100% rename from spec/features/home_spec.rb rename to spec/system/home_spec.rb diff --git a/spec/features/legislation/draft_versions_spec.rb b/spec/system/legislation/draft_versions_spec.rb similarity index 100% rename from spec/features/legislation/draft_versions_spec.rb rename to spec/system/legislation/draft_versions_spec.rb diff --git a/spec/features/legislation/processes_spec.rb b/spec/system/legislation/processes_spec.rb similarity index 100% rename from spec/features/legislation/processes_spec.rb rename to spec/system/legislation/processes_spec.rb diff --git a/spec/features/legislation/proposals_spec.rb b/spec/system/legislation/proposals_spec.rb similarity index 100% rename from spec/features/legislation/proposals_spec.rb rename to spec/system/legislation/proposals_spec.rb diff --git a/spec/features/legislation/questions_spec.rb b/spec/system/legislation/questions_spec.rb similarity index 100% rename from spec/features/legislation/questions_spec.rb rename to spec/system/legislation/questions_spec.rb diff --git a/spec/features/localization_spec.rb b/spec/system/localization_spec.rb similarity index 100% rename from spec/features/localization_spec.rb rename to spec/system/localization_spec.rb diff --git a/spec/features/management/account_spec.rb b/spec/system/management/account_spec.rb similarity index 100% rename from spec/features/management/account_spec.rb rename to spec/system/management/account_spec.rb diff --git a/spec/features/management/budget_investments_spec.rb b/spec/system/management/budget_investments_spec.rb similarity index 100% rename from spec/features/management/budget_investments_spec.rb rename to spec/system/management/budget_investments_spec.rb diff --git a/spec/features/management/document_verifications_spec.rb b/spec/system/management/document_verifications_spec.rb similarity index 100% rename from spec/features/management/document_verifications_spec.rb rename to spec/system/management/document_verifications_spec.rb diff --git a/spec/features/management/email_verifications_spec.rb b/spec/system/management/email_verifications_spec.rb similarity index 100% rename from spec/features/management/email_verifications_spec.rb rename to spec/system/management/email_verifications_spec.rb diff --git a/spec/features/management/localization_spec.rb b/spec/system/management/localization_spec.rb similarity index 100% rename from spec/features/management/localization_spec.rb rename to spec/system/management/localization_spec.rb diff --git a/spec/features/management/managed_users_spec.rb b/spec/system/management/managed_users_spec.rb similarity index 100% rename from spec/features/management/managed_users_spec.rb rename to spec/system/management/managed_users_spec.rb diff --git a/spec/features/management/proposals_spec.rb b/spec/system/management/proposals_spec.rb similarity index 100% rename from spec/features/management/proposals_spec.rb rename to spec/system/management/proposals_spec.rb diff --git a/spec/features/management/users_spec.rb b/spec/system/management/users_spec.rb similarity index 100% rename from spec/features/management/users_spec.rb rename to spec/system/management/users_spec.rb diff --git a/spec/features/management_spec.rb b/spec/system/management_spec.rb similarity index 100% rename from spec/features/management_spec.rb rename to spec/system/management_spec.rb diff --git a/spec/features/moderation/budget_investments_spec.rb b/spec/system/moderation/budget_investments_spec.rb similarity index 100% rename from spec/features/moderation/budget_investments_spec.rb rename to spec/system/moderation/budget_investments_spec.rb diff --git a/spec/features/moderation/comments_spec.rb b/spec/system/moderation/comments_spec.rb similarity index 100% rename from spec/features/moderation/comments_spec.rb rename to spec/system/moderation/comments_spec.rb diff --git a/spec/features/moderation/debates_spec.rb b/spec/system/moderation/debates_spec.rb similarity index 100% rename from spec/features/moderation/debates_spec.rb rename to spec/system/moderation/debates_spec.rb diff --git a/spec/features/moderation/legislation_proposals_spec.rb b/spec/system/moderation/legislation_proposals_spec.rb similarity index 100% rename from spec/features/moderation/legislation_proposals_spec.rb rename to spec/system/moderation/legislation_proposals_spec.rb diff --git a/spec/features/moderation/proposal_notifications_spec.rb b/spec/system/moderation/proposal_notifications_spec.rb similarity index 100% rename from spec/features/moderation/proposal_notifications_spec.rb rename to spec/system/moderation/proposal_notifications_spec.rb diff --git a/spec/features/moderation/proposals_spec.rb b/spec/system/moderation/proposals_spec.rb similarity index 100% rename from spec/features/moderation/proposals_spec.rb rename to spec/system/moderation/proposals_spec.rb diff --git a/spec/features/moderation/users_spec.rb b/spec/system/moderation/users_spec.rb similarity index 100% rename from spec/features/moderation/users_spec.rb rename to spec/system/moderation/users_spec.rb diff --git a/spec/features/moderation_spec.rb b/spec/system/moderation_spec.rb similarity index 100% rename from spec/features/moderation_spec.rb rename to spec/system/moderation_spec.rb diff --git a/spec/features/notifications_spec.rb b/spec/system/notifications_spec.rb similarity index 100% rename from spec/features/notifications_spec.rb rename to spec/system/notifications_spec.rb diff --git a/spec/features/official_positions_spec.rb b/spec/system/official_positions_spec.rb similarity index 100% rename from spec/features/official_positions_spec.rb rename to spec/system/official_positions_spec.rb diff --git a/spec/features/officing/booth_spec.rb b/spec/system/officing/booth_spec.rb similarity index 100% rename from spec/features/officing/booth_spec.rb rename to spec/system/officing/booth_spec.rb diff --git a/spec/features/officing/residence_spec.rb b/spec/system/officing/residence_spec.rb similarity index 100% rename from spec/features/officing/residence_spec.rb rename to spec/system/officing/residence_spec.rb diff --git a/spec/features/officing/results_spec.rb b/spec/system/officing/results_spec.rb similarity index 100% rename from spec/features/officing/results_spec.rb rename to spec/system/officing/results_spec.rb diff --git a/spec/features/officing/voters_spec.rb b/spec/system/officing/voters_spec.rb similarity index 100% rename from spec/features/officing/voters_spec.rb rename to spec/system/officing/voters_spec.rb diff --git a/spec/features/officing_spec.rb b/spec/system/officing_spec.rb similarity index 100% rename from spec/features/officing_spec.rb rename to spec/system/officing_spec.rb diff --git a/spec/features/organizations_spec.rb b/spec/system/organizations_spec.rb similarity index 100% rename from spec/features/organizations_spec.rb rename to spec/system/organizations_spec.rb diff --git a/spec/features/polls/polls_spec.rb b/spec/system/polls/polls_spec.rb similarity index 100% rename from spec/features/polls/polls_spec.rb rename to spec/system/polls/polls_spec.rb diff --git a/spec/features/polls/questions_spec.rb b/spec/system/polls/questions_spec.rb similarity index 100% rename from spec/features/polls/questions_spec.rb rename to spec/system/polls/questions_spec.rb diff --git a/spec/features/polls/results_spec.rb b/spec/system/polls/results_spec.rb similarity index 100% rename from spec/features/polls/results_spec.rb rename to spec/system/polls/results_spec.rb diff --git a/spec/features/polls/voter_spec.rb b/spec/system/polls/voter_spec.rb similarity index 100% rename from spec/features/polls/voter_spec.rb rename to spec/system/polls/voter_spec.rb diff --git a/spec/features/proposal_ballots_spec.rb b/spec/system/proposal_ballots_spec.rb similarity index 100% rename from spec/features/proposal_ballots_spec.rb rename to spec/system/proposal_ballots_spec.rb diff --git a/spec/features/proposal_notifications_spec.rb b/spec/system/proposal_notifications_spec.rb similarity index 100% rename from spec/features/proposal_notifications_spec.rb rename to spec/system/proposal_notifications_spec.rb diff --git a/spec/features/proposals_spec.rb b/spec/system/proposals_spec.rb similarity index 100% rename from spec/features/proposals_spec.rb rename to spec/system/proposals_spec.rb diff --git a/spec/features/registration_form_spec.rb b/spec/system/registration_form_spec.rb similarity index 100% rename from spec/features/registration_form_spec.rb rename to spec/system/registration_form_spec.rb diff --git a/spec/features/remote_translations_spec.rb b/spec/system/remote_translations_spec.rb similarity index 100% rename from spec/features/remote_translations_spec.rb rename to spec/system/remote_translations_spec.rb diff --git a/spec/features/sessions_spec.rb b/spec/system/sessions_spec.rb similarity index 100% rename from spec/features/sessions_spec.rb rename to spec/system/sessions_spec.rb diff --git a/spec/features/site_customization/content_blocks_spec.rb b/spec/system/site_customization/content_blocks_spec.rb similarity index 100% rename from spec/features/site_customization/content_blocks_spec.rb rename to spec/system/site_customization/content_blocks_spec.rb diff --git a/spec/features/site_customization/custom_pages_spec.rb b/spec/system/site_customization/custom_pages_spec.rb similarity index 100% rename from spec/features/site_customization/custom_pages_spec.rb rename to spec/system/site_customization/custom_pages_spec.rb diff --git a/spec/features/site_customization/information_texts_spec.rb b/spec/system/site_customization/information_texts_spec.rb similarity index 100% rename from spec/features/site_customization/information_texts_spec.rb rename to spec/system/site_customization/information_texts_spec.rb diff --git a/spec/features/social_media_meta_tags_spec.rb b/spec/system/social_media_meta_tags_spec.rb similarity index 86% rename from spec/features/social_media_meta_tags_spec.rb rename to spec/system/social_media_meta_tags_spec.rb index 08470ee7e..f114c204f 100644 --- a/spec/features/social_media_meta_tags_spec.rb +++ b/spec/system/social_media_meta_tags_spec.rb @@ -29,14 +29,14 @@ describe "Social media meta tags" do expect(page).to have_meta "twitter:title", with: meta_title expect(page).to have_meta "twitter:description", with: meta_description expect(page).to have_meta "twitter:image", - with: "http://www.example.com/social_media_icon_twitter.png" + with: "#{Capybara.app_host}/social_media_icon_twitter.png" expect(page).to have_property "og:title", with: meta_title expect(page).to have_property "article:publisher", with: url expect(page).to have_property "article:author", with: "https://www.facebook.com/" + facebook_handle - expect(page).to have_property "og:url", with: "http://www.example.com/" - expect(page).to have_property "og:image", with: "http://www.example.com/social_media_icon.png" + expect(page).to have_property "og:url", with: "#{Capybara.app_host}/" + expect(page).to have_property "og:image", with: "#{Capybara.app_host}/social_media_icon.png" expect(page).to have_property "og:site_name", with: org_name expect(page).to have_property "og:description", with: meta_description end diff --git a/spec/features/stats_spec.rb b/spec/system/stats_spec.rb similarity index 100% rename from spec/features/stats_spec.rb rename to spec/system/stats_spec.rb diff --git a/spec/features/tags/budget_investments_spec.rb b/spec/system/tags/budget_investments_spec.rb similarity index 100% rename from spec/features/tags/budget_investments_spec.rb rename to spec/system/tags/budget_investments_spec.rb diff --git a/spec/features/tags/debates_spec.rb b/spec/system/tags/debates_spec.rb similarity index 100% rename from spec/features/tags/debates_spec.rb rename to spec/system/tags/debates_spec.rb diff --git a/spec/features/tags/proposals_spec.rb b/spec/system/tags/proposals_spec.rb similarity index 100% rename from spec/features/tags/proposals_spec.rb rename to spec/system/tags/proposals_spec.rb diff --git a/spec/features/tags_spec.rb b/spec/system/tags_spec.rb similarity index 100% rename from spec/features/tags_spec.rb rename to spec/system/tags_spec.rb diff --git a/spec/features/topics_spec.rb b/spec/system/topics_spec.rb similarity index 100% rename from spec/features/topics_spec.rb rename to spec/system/topics_spec.rb diff --git a/spec/features/tracks_spec.rb b/spec/system/tracks_spec.rb similarity index 100% rename from spec/features/tracks_spec.rb rename to spec/system/tracks_spec.rb diff --git a/spec/features/translatable_spec.rb b/spec/system/translatable_spec.rb similarity index 100% rename from spec/features/translatable_spec.rb rename to spec/system/translatable_spec.rb diff --git a/spec/features/user_invites_spec.rb b/spec/system/user_invites_spec.rb similarity index 100% rename from spec/features/user_invites_spec.rb rename to spec/system/user_invites_spec.rb diff --git a/spec/features/users_auth_spec.rb b/spec/system/users_auth_spec.rb similarity index 100% rename from spec/features/users_auth_spec.rb rename to spec/system/users_auth_spec.rb diff --git a/spec/features/users_spec.rb b/spec/system/users_spec.rb similarity index 100% rename from spec/features/users_spec.rb rename to spec/system/users_spec.rb diff --git a/spec/features/valuation/budget_investments_spec.rb b/spec/system/valuation/budget_investments_spec.rb similarity index 100% rename from spec/features/valuation/budget_investments_spec.rb rename to spec/system/valuation/budget_investments_spec.rb diff --git a/spec/features/valuation/budgets_spec.rb b/spec/system/valuation/budgets_spec.rb similarity index 100% rename from spec/features/valuation/budgets_spec.rb rename to spec/system/valuation/budgets_spec.rb diff --git a/spec/features/valuation_spec.rb b/spec/system/valuation_spec.rb similarity index 100% rename from spec/features/valuation_spec.rb rename to spec/system/valuation_spec.rb diff --git a/spec/features/verification/email_spec.rb b/spec/system/verification/email_spec.rb similarity index 100% rename from spec/features/verification/email_spec.rb rename to spec/system/verification/email_spec.rb diff --git a/spec/features/verification/letter_spec.rb b/spec/system/verification/letter_spec.rb similarity index 100% rename from spec/features/verification/letter_spec.rb rename to spec/system/verification/letter_spec.rb diff --git a/spec/features/verification/level_three_verification_spec.rb b/spec/system/verification/level_three_verification_spec.rb similarity index 100% rename from spec/features/verification/level_three_verification_spec.rb rename to spec/system/verification/level_three_verification_spec.rb diff --git a/spec/features/verification/level_two_verification_spec.rb b/spec/system/verification/level_two_verification_spec.rb similarity index 100% rename from spec/features/verification/level_two_verification_spec.rb rename to spec/system/verification/level_two_verification_spec.rb diff --git a/spec/features/verification/residence_spec.rb b/spec/system/verification/residence_spec.rb similarity index 100% rename from spec/features/verification/residence_spec.rb rename to spec/system/verification/residence_spec.rb diff --git a/spec/features/verification/sms_spec.rb b/spec/system/verification/sms_spec.rb similarity index 100% rename from spec/features/verification/sms_spec.rb rename to spec/system/verification/sms_spec.rb diff --git a/spec/features/verification/verification_path_spec.rb b/spec/system/verification/verification_path_spec.rb similarity index 100% rename from spec/features/verification/verification_path_spec.rb rename to spec/system/verification/verification_path_spec.rb diff --git a/spec/features/verification/verified_user_spec.rb b/spec/system/verification/verified_user_spec.rb similarity index 100% rename from spec/features/verification/verified_user_spec.rb rename to spec/system/verification/verified_user_spec.rb diff --git a/spec/features/votes_spec.rb b/spec/system/votes_spec.rb similarity index 100% rename from spec/features/votes_spec.rb rename to spec/system/votes_spec.rb diff --git a/spec/features/welcome_spec.rb b/spec/system/welcome_spec.rb similarity index 100% rename from spec/features/welcome_spec.rb rename to spec/system/welcome_spec.rb diff --git a/spec/features/xss_spec.rb b/spec/system/xss_spec.rb similarity index 100% rename from spec/features/xss_spec.rb rename to spec/system/xss_spec.rb