defmodule DaProductApp.Repo.Migrations.CreateTmsTerminalStatusItems do use Ecto.Migration def change do # tms_terminal_status_items table create table(:tms_terminal_status_items) do add :status_log_id, references(:tms_terminal_status_logs, on_delete: :delete_all), null: false add :itemkey, :string, null: false add :value, :text add :timestamp, :string add :message, :text timestamps() end create index(:tms_terminal_status_items, [:status_log_id]) end end