18 lines
420 B
Elixir
18 lines
420 B
Elixir
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
|
|
add :"bg-color", :string
|
|
add :"text-color", :string
|
|
add :user_id, references(:users, on_delete: :nothing, type: :binary_id)
|
|
|
|
timestamps()
|
|
end
|
|
|
|
create index(:tags, [:user_id])
|
|
end
|
|
end
|