1
0
Fork 0
LangPlayground/Elixir/notes_app/priv/repo/migrations/20240903075510_create_notes.exs

15 lines
323 B
Elixir

defmodule NotesApp.Repo.Migrations.CreateNotes do
use Ecto.Migration
def change do
create table(:notes) do
add :title, :string
add :content, :text
add :user_id, references(:users, on_delete: :nothing)
timestamps(type: :utc_datetime)
end
create index(:notes, [:user_id])
end
end