Packages

MySensors is an open source hardware and software community focusing on do-it-yourself home automation and Internet of Things.

Current section

Files

Jump to
my_sensors priv repo migrations 20180923170352_create_sensors_table.exs
Raw

priv/repo/migrations/20180923170352_create_sensors_table.exs

defmodule MySensors.Repo.Migrations.CreateSensorsTable do
use Ecto.Migration
def change do
create table("sensors") do
add :type, :string
add :child_sensor_id, :integer
add :node_id, references("nodes", on_delete: :delete_all)
timestamps()
end
create unique_index("sensors", [:child_sensor_id, :node_id])
end
end