16 lines
323 B
Elixir
16 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
|