Merge pull request #3598 from consul/update_migrations_and_schema

Update migrations and schema file
This commit is contained in:
Javier Martín
2019-06-07 19:45:00 +02:00
committed by GitHub
9 changed files with 12 additions and 13 deletions

View File

@@ -21,7 +21,6 @@ class Legislation::PeopleProposal < ApplicationRecord
belongs_to :process, class_name: "Legislation::Process", foreign_key: "legislation_process_id"
belongs_to :author, -> { with_hidden }, class_name: "User", foreign_key: "author_id"
belongs_to :geozone
has_many :comments, as: :commentable
validates :title, presence: true

View File

@@ -2,7 +2,6 @@ section "Creating legislation people proposals" do
10.times do
Legislation::PeopleProposal.create!(title: Faker::Lorem.sentence(3).truncate(60),
description: Faker::Lorem.paragraphs.join("\n\n"),
question: Faker::Lorem.sentence(3),
summary: Faker::Lorem.paragraph,
author: User.all.sample,
process: Legislation::Process.all.sample,

View File

@@ -1,4 +1,4 @@
class AddDescriptionToAdministrator < ActiveRecord::Migration
class AddDescriptionToAdministrator < ActiveRecord::Migration[4.2]
def change
add_column :administrators, :description, :string
end

View File

@@ -1,4 +1,4 @@
class AddSelectedToProposal < ActiveRecord::Migration
class AddSelectedToProposal < ActiveRecord::Migration[4.2]
def change
add_column :proposals, :selected, :bool, default: false, index: true
end

View File

@@ -1,4 +1,4 @@
class AddPeopleProposalsPhaseToLegislationProcesses < ActiveRecord::Migration
class AddPeopleProposalsPhaseToLegislationProcesses < ActiveRecord::Migration[4.2]
def change
add_column :legislation_processes, :people_proposals_phase_start_date, :date
add_column :legislation_processes, :people_proposals_phase_end_date, :date

View File

@@ -1,4 +1,4 @@
class CreateLegislationPeopleProposalsTable < ActiveRecord::Migration
class CreateLegislationPeopleProposalsTable < ActiveRecord::Migration[4.2]
def change
create_table :legislation_people_proposals, force: :cascade do |t|
t.integer "legislation_process_id"

View File

@@ -1,4 +1,4 @@
class AddContactFieldsToLegislationPeopleProposals < ActiveRecord::Migration
class AddContactFieldsToLegislationPeopleProposals < ActiveRecord::Migration[4.2]
def change
add_column :legislation_people_proposals, :email, :string
add_column :legislation_people_proposals, :phone, :string

View File

@@ -0,0 +1,5 @@
class RemoveQuestionFromLegislationPeopleProposal < ActiveRecord::Migration[5.0]
def change
remove_column :legislation_people_proposals, :question, :string
end
end

View File

@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20190429125842) do
ActiveRecord::Schema.define(version: 20190607160900) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -671,7 +671,6 @@ ActiveRecord::Schema.define(version: 20190429125842) do
t.integer "legislation_process_id"
t.string "title", limit: 80
t.text "description"
t.string "question"
t.integer "author_id"
t.datetime "hidden_at"
t.integer "flags_count", default: 0
@@ -703,10 +702,7 @@ ActiveRecord::Schema.define(version: 20190429125842) do
t.string "instagram"
t.string "youtube"
t.string "website"
t.string "external_url"
t.integer "geozone_id"
t.index ["cached_votes_score"], name: "index_legislation_people_proposals_on_cached_votes_score", using: :btree
t.index ["geozone_id"], name: "index_legislation_people_proposals_on_geozone_id", using: :btree
end
create_table "legislation_process_translations", force: :cascade do |t|
@@ -1468,10 +1464,10 @@ ActiveRecord::Schema.define(version: 20190429125842) do
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.integer "balloted_heading_id"
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