After 'mix phx.gen.live Items Item items name:string description:string info:string amount:integer factor:float type:string'

This commit is contained in:
2026-04-21 13:29:13 +02:00
parent e930c742b5
commit 851665ef60
10 changed files with 698 additions and 0 deletions

View File

@ -0,0 +1,20 @@
defmodule GenericRestServer.Repo.Migrations.CreateItems do
use Ecto.Migration
def change do
create table(:items, primary_key: false) do
add :id, :binary_id, primary_key: true
add :name, :string
add :description, :string
add :info, :string
add :amount, :integer
add :factor, :float
add :type, :string
add :user_id, references(:users, type: :binary_id, on_delete: :delete_all)
timestamps(type: :utc_datetime)
end
create index(:items, [:user_id])
end
end