1
0
Fork 0

Add: migration to create notes table

This commit is contained in:
Aroy-Art 2024-09-24 22:13:39 +02:00
parent b881d0957c
commit 163acc22f4
Signed by: Aroy
GPG key ID: DB9689E9391DD156

View file

@ -0,0 +1,15 @@
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