localspot/priv/repo/migrations/20251201042635_create_business_photos.exs
Kevin Sivic e8fd635ddb Add Businesses context with A-Frame architecture
Phase 1 - Database foundation:
- Categories, businesses, hours, photos migrations
- Ecto schemas with changesets and validations

Phase 2 - Business logic:
- Logic module with pure functions (Haversine distance, slug generation, etc.)
- Queries module for database operations with filtering
- Businesses context coordinating Logic and Queries layers
- 43 tests covering logic and queries

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 23:55:29 -05:00

18 lines
510 B
Elixir

defmodule Localspot.Repo.Migrations.CreateBusinessPhotos do
use Ecto.Migration
def change do
create table(:business_photos) do
add :url, :string, null: false
add :alt_text, :string
add :position, :integer, default: 0, null: false
add :primary, :boolean, default: false, null: false
add :business_id, references(:businesses, on_delete: :delete_all), null: false
timestamps(type: :utc_datetime)
end
create index(:business_photos, [:business_id])
end
end