Begin add message

This commit is contained in:
Florian RICHER 2024-02-15 21:46:14 +01:00
parent e0f052b653
commit 8bbc8b5ebf
2 changed files with 47 additions and 0 deletions

View file

@ -0,0 +1,14 @@
defmodule TestPhoenixLiveView.Repo.Migrations.CreateMessages do
use Ecto.Migration
def change do
create table(:messages) do
add :message, :text
add :user_id, references(:users, on_delete: :delete_all), null: false
timestamps(type: :utc_datetime)
end
create index(:messages, [:user_id])
end
end