ac895944a8
* Updated model with new attribute * Update app logic to use new cookie logic * lots of tests * Updated UI and renamed attribute * Updated tests
19 lines
523 B
Elixir
19 lines
523 B
Elixir
defmodule Pinchflat.Repo.Migrations.AddCookieBehaviourToSources do
|
|
use Ecto.Migration
|
|
|
|
def change do
|
|
alter table(:sources) do
|
|
add :cookie_behaviour, :string, null: false, default: "disabled"
|
|
end
|
|
|
|
execute(
|
|
"UPDATE sources SET cookie_behaviour = 'all_operations' WHERE use_cookies = TRUE",
|
|
"UPDATE sources SET use_cookies = TRUE WHERE cookie_behaviour = 'all_operations'"
|
|
)
|
|
|
|
alter table(:sources) do
|
|
remove :use_cookies, :boolean, null: false, default: false
|
|
end
|
|
end
|
|
end
|