Fix bug enterprise's date_creation

This commit is contained in:
Xavier J 2016-01-28 11:29:44 +01:00
parent cef48fb03c
commit 68bb4935e7
8 changed files with 30 additions and 20 deletions

View file

@ -0,0 +1,9 @@
class ChangeDateCreationTypeToEntreprise < ActiveRecord::Migration
def up
change_column :entreprises, :date_creation, "timestamp USING to_timestamp(date_creation) at time zone 'UTC-2'"
end
def down
change_column :entreprises, :date_creation, "integer USING extract(epoch from date_creation::timestamp with time zone)::integer"
end
end

View file

@ -11,8 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20160121110603) do
ActiveRecord::Schema.define(version: 20160127170437) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -91,19 +90,19 @@ ActiveRecord::Schema.define(version: 20160121110603) do
add_index "dossiers", ["user_id"], name: "index_dossiers_on_user_id", using: :btree
create_table "entreprises", force: :cascade do |t|
t.string "siren"
t.integer "capital_social"
t.string "numero_tva_intracommunautaire"
t.string "forme_juridique"
t.string "forme_juridique_code"
t.string "nom_commercial"
t.string "raison_sociale"
t.string "siret_siege_social"
t.string "code_effectif_entreprise"
t.integer "date_creation"
t.string "nom"
t.string "prenom"
t.integer "dossier_id"
t.string "siren"
t.integer "capital_social"
t.string "numero_tva_intracommunautaire"
t.string "forme_juridique"
t.string "forme_juridique_code"
t.string "nom_commercial"
t.string "raison_sociale"
t.string "siret_siege_social"
t.string "code_effectif_entreprise"
t.datetime "date_creation"
t.string "nom"
t.string "prenom"
t.integer "dossier_id"
end
create_table "etablissements", force: :cascade do |t|