2021-09-02 23:31:14 -04:00
|
|
|
defmodule Cannery.Repo.Migrations.CreateTags do
|
|
|
|
use Ecto.Migration
|
|
|
|
|
|
|
|
def change do
|
|
|
|
create table(:tags, primary_key: false) do
|
|
|
|
add :id, :binary_id, primary_key: true
|
|
|
|
add :name, :string
|
2021-09-10 00:41:06 -04:00
|
|
|
add :bg_color, :string
|
|
|
|
add :text_color, :string
|
2021-09-12 18:54:53 -04:00
|
|
|
|
2021-09-02 23:31:14 -04:00
|
|
|
add :user_id, references(:users, on_delete: :nothing, type: :binary_id)
|
|
|
|
|
|
|
|
timestamps()
|
|
|
|
end
|
|
|
|
|
|
|
|
create index(:tags, [:user_id])
|
|
|
|
end
|
|
|
|
end
|