15 lines
369 B
Elixir
15 lines
369 B
Elixir
defmodule Nulla.Repo.Migrations.CreateBookmarks do
|
|
use Ecto.Migration
|
|
|
|
def change do
|
|
create table(:bookmarks, primary_key: false) do
|
|
add :id, :bigint, primary_key: true
|
|
add :url, :string
|
|
add :user_id, references(:users, on_delete: :delete_all)
|
|
|
|
timestamps(type: :utc_datetime)
|
|
end
|
|
|
|
create index(:bookmarks, [:user_id])
|
|
end
|
|
end
|