built basic ui structure in /hierarchy
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
defmodule RiverConnect.Repo.Migrations.CreateHierarchy do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create table(:springs) do
|
||||
add :name, :string, null: false
|
||||
# :dm, :job, :custom
|
||||
add :type, :string, null: false
|
||||
add :description, :text
|
||||
|
||||
timestamps()
|
||||
end
|
||||
|
||||
create table(:rivers) do
|
||||
add :name, :string, null: false
|
||||
add :description, :text
|
||||
add :spring_id, references(:springs, on_delete: :delete_all), null: false
|
||||
|
||||
timestamps()
|
||||
end
|
||||
|
||||
create index(:rivers, [:spring_id])
|
||||
|
||||
create table(:streams) do
|
||||
add :name, :string, null: false
|
||||
add :topic, :string
|
||||
add :river_id, references(:rivers, on_delete: :delete_all), null: false
|
||||
|
||||
timestamps()
|
||||
end
|
||||
|
||||
create index(:streams, [:river_id])
|
||||
|
||||
create table(:trenches) do
|
||||
add :name, :string
|
||||
add :stream_id, references(:streams, on_delete: :delete_all), null: false
|
||||
|
||||
timestamps()
|
||||
end
|
||||
|
||||
create index(:trenches, [:stream_id])
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user