architex/priv/repo/migrations/20210730122017_create_aliases_table.exs

13 lines
356 B
Elixir
Raw Normal View History

2021-07-30 13:56:24 +00:00
defmodule MatrixServer.Repo.Migrations.CreateAliasesTable do
use Ecto.Migration
def change do
create table(:aliases, primary_key: false) do
add :alias, :string, primary_key: true, null: false
add :room_id, references(:rooms, type: :string, on_delete: :delete_all), null: false
end
create index(:aliases, [:room_id])
end
end