Tests: adapt migration to sqlite
Add sqlite Remove scenic from tests
This commit is contained in:
parent
67daaa033c
commit
8bccf375e1
14 changed files with 42 additions and 39 deletions
|
@ -16,8 +16,8 @@ class DeviseCreateUsers < ActiveRecord::Migration
|
|||
t.integer :sign_in_count, default: 0, null: false
|
||||
t.datetime :current_sign_in_at
|
||||
t.datetime :last_sign_in_at
|
||||
t.inet :current_sign_in_ip
|
||||
t.inet :last_sign_in_ip
|
||||
t.string :current_sign_in_ip
|
||||
t.string :last_sign_in_ip
|
||||
|
||||
## Confirmable
|
||||
# t.string :confirmation_token
|
||||
|
|
|
@ -16,8 +16,8 @@ class DeviseCreatePros < ActiveRecord::Migration
|
|||
t.integer :sign_in_count, default: 0, null: false
|
||||
t.datetime :current_sign_in_at
|
||||
t.datetime :last_sign_in_at
|
||||
t.inet :current_sign_in_ip
|
||||
t.inet :last_sign_in_ip
|
||||
t.string :current_sign_in_ip
|
||||
t.string :last_sign_in_ip
|
||||
|
||||
## Confirmable
|
||||
# t.string :confirmation_token
|
||||
|
|
|
@ -16,8 +16,8 @@ class DeviseCreateGestionnaires < ActiveRecord::Migration
|
|||
t.integer :sign_in_count, default: 0, null: false
|
||||
t.datetime :current_sign_in_at
|
||||
t.datetime :last_sign_in_at
|
||||
t.inet :current_sign_in_ip
|
||||
t.inet :last_sign_in_ip
|
||||
t.string :current_sign_in_ip
|
||||
t.string :last_sign_in_ip
|
||||
|
||||
## Confirmable
|
||||
# t.string :confirmation_token
|
||||
|
|
|
@ -16,8 +16,8 @@ class CreateUsers < ActiveRecord::Migration
|
|||
t.integer :sign_in_count, default: 0, null: false
|
||||
t.datetime :current_sign_in_at
|
||||
t.datetime :last_sign_in_at
|
||||
t.inet :current_sign_in_ip
|
||||
t.inet :last_sign_in_ip
|
||||
t.string :current_sign_in_ip
|
||||
t.string :last_sign_in_ip
|
||||
|
||||
## Confirmable
|
||||
# t.string :confirmation_token
|
||||
|
|
|
@ -16,8 +16,8 @@ class DeviseCreateAdministrateurs < ActiveRecord::Migration
|
|||
t.integer :sign_in_count, default: 0, null: false
|
||||
t.datetime :current_sign_in_at
|
||||
t.datetime :last_sign_in_at
|
||||
t.inet :current_sign_in_ip
|
||||
t.inet :last_sign_in_ip
|
||||
t.string :current_sign_in_ip
|
||||
t.string :last_sign_in_ip
|
||||
|
||||
## Confirmable
|
||||
# t.string :confirmation_token
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
class ChangeDateCreationTypeToEntreprise < ActiveRecord::Migration
|
||||
def up
|
||||
change_column :entreprises, :date_creation, "timestamp USING to_timestamp(date_creation) at time zone 'UTC-2'"
|
||||
if Rails.env.test?
|
||||
change_column :entreprises, :date_creation, "timestamp"
|
||||
else
|
||||
change_column :entreprises, :date_creation, "timestamp USING to_timestamp(date_creation) at time zone 'UTC-2'"
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
|
|
|
@ -16,8 +16,8 @@ class DeviseCreateAdministrations < ActiveRecord::Migration
|
|||
t.integer :sign_in_count, default: 0, null: false
|
||||
t.datetime :current_sign_in_at
|
||||
t.datetime :last_sign_in_at
|
||||
t.inet :current_sign_in_ip
|
||||
t.inet :last_sign_in_ip
|
||||
t.string :current_sign_in_ip
|
||||
t.string :last_sign_in_ip
|
||||
|
||||
## Confirmable
|
||||
# t.string :confirmation_token
|
||||
|
|
|
@ -4,14 +4,14 @@ class FixDefaultTypeOnTypeDeChampTable < ActiveRecord::Migration
|
|||
end
|
||||
|
||||
def up
|
||||
TypeDeChamp.where("private = false").update_all("type = 'TypeDeChampPublic'")
|
||||
TypeDeChamp.where("private = true").update_all("type = 'TypeDeChampPrivate'")
|
||||
TypeDeChamp.where(private: false).update_all("type = 'TypeDeChampPublic'")
|
||||
TypeDeChamp.where(private: true).update_all("type = 'TypeDeChampPrivate'")
|
||||
remove_column :types_de_champ, :private
|
||||
end
|
||||
|
||||
def down
|
||||
add_column :types_de_champ, :private, :boolean, default: true
|
||||
TypeDeChamp.where("type = 'TypeDeChampPublic'").update_all("private = false")
|
||||
TypeDeChamp.where("type = 'TypeDeChampPrivate'").update_all("private = true")
|
||||
TypeDeChamp.where("type = 'TypeDeChampPublic'").update_all(private: false)
|
||||
TypeDeChamp.where("type = 'TypeDeChampPrivate'").update_all(private: true)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -9,7 +9,7 @@ class CreateSearches < ActiveRecord::Migration
|
|||
add_index :individuals, :dossier_id
|
||||
add_index :pieces_justificatives, :dossier_id
|
||||
add_index :rna_informations, :entreprise_id
|
||||
create_view :searches #, materialized: true
|
||||
create_view :searches unless Rails.env.test? #, materialized: true
|
||||
end
|
||||
|
||||
def down
|
||||
|
@ -22,6 +22,6 @@ class CreateSearches < ActiveRecord::Migration
|
|||
remove_index :individuals, :dossier_id
|
||||
remove_index :pieces_justificatives, :dossier_id
|
||||
remove_index :rna_informations, :entreprise_id
|
||||
drop_view :searches #, materialized: true
|
||||
drop_view :searches unless Rails.env.test? #, materialized: true
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
class UpdateSearchesToVersion2 < ActiveRecord::Migration
|
||||
def up
|
||||
replace_view :searches, version: 2
|
||||
replace_view :searches, version: 2 unless Rails.env.test?
|
||||
end
|
||||
|
||||
def down
|
||||
replace_view :searches, version: 1
|
||||
replace_view :searches, version: 1 unless Rails.env.test?
|
||||
end
|
||||
end
|
||||
|
|
16
db/schema.rb
16
db/schema.rb
|
@ -24,8 +24,8 @@ ActiveRecord::Schema.define(version: 20170223170808) do
|
|||
t.integer "sign_in_count", default: 0, null: false
|
||||
t.datetime "current_sign_in_at"
|
||||
t.datetime "last_sign_in_at"
|
||||
t.inet "current_sign_in_ip"
|
||||
t.inet "last_sign_in_ip"
|
||||
t.string "current_sign_in_ip"
|
||||
t.string "last_sign_in_ip"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "api_token"
|
||||
|
@ -50,8 +50,8 @@ ActiveRecord::Schema.define(version: 20170223170808) do
|
|||
t.integer "sign_in_count", default: 0, null: false
|
||||
t.datetime "current_sign_in_at"
|
||||
t.datetime "last_sign_in_at"
|
||||
t.inet "current_sign_in_ip"
|
||||
t.inet "last_sign_in_ip"
|
||||
t.string "current_sign_in_ip"
|
||||
t.string "last_sign_in_ip"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.index ["email"], name: "index_administrations_on_email", unique: true, using: :btree
|
||||
|
@ -207,8 +207,8 @@ ActiveRecord::Schema.define(version: 20170223170808) do
|
|||
t.integer "sign_in_count", default: 0, null: false
|
||||
t.datetime "current_sign_in_at"
|
||||
t.datetime "last_sign_in_at"
|
||||
t.inet "current_sign_in_ip"
|
||||
t.inet "last_sign_in_ip"
|
||||
t.string "current_sign_in_ip"
|
||||
t.string "last_sign_in_ip"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.integer "procedure_filter"
|
||||
|
@ -375,8 +375,8 @@ ActiveRecord::Schema.define(version: 20170223170808) do
|
|||
t.integer "sign_in_count", default: 0, null: false
|
||||
t.datetime "current_sign_in_at"
|
||||
t.datetime "last_sign_in_at"
|
||||
t.inet "current_sign_in_ip"
|
||||
t.inet "last_sign_in_ip"
|
||||
t.string "current_sign_in_ip"
|
||||
t.string "last_sign_in_ip"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "siret"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue