Updated model with new attribute
This commit is contained in:
parent
b790e05133
commit
a393b35254
3 changed files with 20 additions and 2 deletions
|
|
@ -28,7 +28,7 @@ defmodule Pinchflat.Sources.Source do
|
|||
series_directory
|
||||
index_frequency_minutes
|
||||
fast_index
|
||||
use_cookies
|
||||
cookie_behaviour
|
||||
download_media
|
||||
last_indexed_at
|
||||
original_url
|
||||
|
|
@ -78,7 +78,7 @@ defmodule Pinchflat.Sources.Source do
|
|||
field :collection_type, Ecto.Enum, values: [:channel, :playlist]
|
||||
field :index_frequency_minutes, :integer, default: 60 * 24
|
||||
field :fast_index, :boolean, default: false
|
||||
field :use_cookies, :boolean, default: false
|
||||
field :cookie_behaviour, Ecto.Enum, values: [:disabled, :indexing_only, :all_operations], default: :disabled
|
||||
field :download_media, :boolean, default: true
|
||||
field :last_indexed_at, :utc_datetime
|
||||
# Only download media items that were published after this date
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 497 KiB After Width: | Height: | Size: 497 KiB |
|
|
@ -0,0 +1,18 @@
|
|||
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
|
||||
Loading…
Reference in a new issue