index.community/backend/priv/repo/migrations/20190624090436_create_instances.exs

31 lines
750 B
Elixir
Raw Permalink Normal View History

2019-07-14 11:47:06 +00:00
defmodule Backend.Repo.Migrations.CreateInstances do
use Ecto.Migration
def change do
create table(:instances) do
add :domain, :string, null: false
add :description, :text
add :user_count, :integer
add :status_count, :integer
add :version, :string
add :insularity, :float
add :x, :float
add :y, :float
2019-07-14 11:47:06 +00:00
timestamps()
end
create unique_index(:instances, [:domain])
create table(:instance_peers) do
add :source_domain, references(:instances, column: :domain, type: :string)
add :target_domain, references(:instances, column: :domain, type: :string)
timestamps()
end
create unique_index(:instance_peers, [:source_domain, :target_domain])
end
end