chore: add migrations to git
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
defmodule Localiser.Repo.Migrations.CreateSensors do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create table(:sensors) do
|
||||
add :sensor_id, :string, null: false
|
||||
add :room_id, references(:rooms, on_delete: :nilify_all)
|
||||
add :x, :float
|
||||
add :y, :float
|
||||
|
||||
timestamps(type: :utc_datetime)
|
||||
end
|
||||
|
||||
create unique_index(:sensors, [:sensor_id])
|
||||
create index(:sensors, [:room_id])
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user