This repository has been archived on 2023-11-26. You can view files and clone it, but cannot push or open issues or pull requests.
bdfr-browser/priv/repo/migrations/20230814110852_create_chats.exs

22 lines
547 B
Elixir

defmodule BdfrBrowser.Repo.Migrations.CreateChats do
use Ecto.Migration
def change do
create table(:chats, primary_key: false) do
add :id, :string, primary_key: true, size: 1024
add :accounts, {:array, :string}
end
create table(:messages, primary_key: false) do
add :id, :string, primary_key: true, size: 256
add :author, :string
add :message, :text
add :posted_at, :utc_datetime
add :chat_id, references(:chats, type: :string)
end
create index("messages", :chat_id)
end
end