berrypod/priv/repo/migrations/20260128235845_create_provider_connections.exs
Jamey Greenwood c5c06d9979 feat: add Products context with provider integration (Phase 1)
Implement the schema foundation for syncing products from POD providers
like Printify. This includes encrypted credential storage, product/variant
schemas, and an Oban worker for background sync.

New modules:
- Vault: AES-256-GCM encryption for API keys
- Products context: CRUD and sync operations for products
- Provider behaviour: abstraction for POD provider implementations
- ProductSyncWorker: Oban job for async product sync

Schemas: ProviderConnection, Product, ProductImage, ProductVariant

Also reorganizes Printify client to lib/simpleshop_theme/clients/ and
mockup generator to lib/simpleshop_theme/mockups/ for better structure.

134 tests added covering all new functionality.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 20:32:20 +00:00

21 lines
651 B
Elixir

defmodule SimpleshopTheme.Repo.Migrations.CreateProviderConnections do
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