mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-02-14 17:54:21 +01:00
14 lines
441 B
Elixir
14 lines
441 B
Elixir
defmodule Philomena.Repo.Migrations.CreateImageVectors do
|
|
use Ecto.Migration
|
|
|
|
def change do
|
|
# NB: this is normalized, the float array is not divisible
|
|
create table(:image_vectors) do
|
|
add :image_id, references(:images, on_delete: :delete_all), null: false
|
|
add :type, :string, null: false
|
|
add :features, {:array, :float}, null: false
|
|
end
|
|
|
|
create unique_index(:image_vectors, [:image_id, :type])
|
|
end
|
|
end
|