2026-02-18 21:23:15 +00:00
|
|
|
defmodule Berrypod.Repo.Migrations.CreateProviderConnections do
|
2026-01-29 08:32:24 +00:00
|
|
|
use Ecto.Migration
|
|
|
|
|
|
|
|
|
|
def change do
|
|
|
|
|
create table(:provider_connections, primary_key: false) do
|
|
|
|
|
add :id, :binary_id, primary_key: true
|
|
|
|
|
add :provider_type, :string, null: false
|
|
|
|
|
add :name, :string, null: false
|
|
|
|
|
add :enabled, :boolean, default: true, null: false
|
|
|
|
|
add :api_key_encrypted, :binary
|
|
|
|
|
add :config, :map, default: %{}
|
|
|
|
|
add :last_synced_at, :utc_datetime
|
|
|
|
|
add :sync_status, :string, default: "pending"
|
|
|
|
|
|
|
|
|
|
timestamps(type: :utc_datetime)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
create unique_index(:provider_connections, [:provider_type])
|
|
|
|
|
end
|
|
|
|
|
end
|