diff --git a/db/migrate/20150824134012_change_date_previsionnel_data_type.rb b/db/migrate/20150824134012_change_date_previsionnel_data_type.rb new file mode 100644 index 000000000..6f568787f --- /dev/null +++ b/db/migrate/20150824134012_change_date_previsionnel_data_type.rb @@ -0,0 +1,6 @@ +class ChangeDatePrevisionnelDataType < ActiveRecord::Migration + def change + remove_column :dossiers, :date_previsionnelle + add_column :dossiers, :date_previsionnelle, :date + end +end diff --git a/db/schema.rb b/db/schema.rb index 08eabf779..b7399fd90 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20150818113123) do +ActiveRecord::Schema.define(version: 20150824134012) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -42,11 +42,11 @@ ActiveRecord::Schema.define(version: 20150818113123) do t.string "nom_projet" t.string "montant_projet" t.string "montant_aide_demande" - t.string "date_previsionnelle" t.string "lien_plus_infos" t.string "mail_contact" t.boolean "dossier_termine" t.integer "formulaire_id" + t.date "date_previsionnelle" end add_index "dossiers", ["formulaire_id"], name: "index_dossiers_on_formulaire_id", using: :btree diff --git a/spec/models/dossier_spec.rb b/spec/models/dossier_spec.rb index ec7d3dce8..1cd5d8898 100644 --- a/spec/models/dossier_spec.rb +++ b/spec/models/dossier_spec.rb @@ -10,7 +10,7 @@ describe Dossier do it { is_expected.to have_db_column(:nom_projet) } it { is_expected.to have_db_column(:montant_projet) } it { is_expected.to have_db_column(:montant_aide_demande) } - it { is_expected.to have_db_column(:date_previsionnelle) } + it { is_expected.to have_db_column(:date_previsionnelle).of_type(:date) } it { is_expected.to have_db_column(:lien_plus_infos) } it { is_expected.to have_db_column(:mail_contact) } it { is_expected.to have_db_column(:dossier_termine) }