2026-02-18 21:23:15 +00:00
|
|
|
defmodule Berrypod.Repo.Migrations.CreateImages do
|
2025-12-30 21:35:52 +00:00
|
|
|
use Ecto.Migration
|
|
|
|
|
|
|
|
|
|
def change do
|
|
|
|
|
create table(:images, primary_key: false) do
|
|
|
|
|
add :id, :binary_id, primary_key: true
|
|
|
|
|
add :image_type, :string, null: false
|
|
|
|
|
add :filename, :string, null: false
|
|
|
|
|
add :content_type, :string, null: false
|
|
|
|
|
add :file_size, :integer, null: false
|
|
|
|
|
add :data, :binary, null: false
|
|
|
|
|
add :is_svg, :boolean, default: false
|
|
|
|
|
add :svg_content, :text
|
|
|
|
|
add :thumbnail_data, :binary
|
|
|
|
|
|
|
|
|
|
timestamps(type: :utc_datetime)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
create index(:images, [:image_type])
|
|
|
|
|
end
|
|
|
|
|
end
|