add models, context and liveviews
This commit is contained in:
18
priv/repo/migrations/20210903015553_create_containers.exs
Normal file
18
priv/repo/migrations/20210903015553_create_containers.exs
Normal file
@ -0,0 +1,18 @@
|
||||
defmodule Cannery.Repo.Migrations.CreateContainers do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create table(:containers, primary_key: false) do
|
||||
add :id, :binary_id, primary_key: true
|
||||
add :name, :string
|
||||
add :desc, :string
|
||||
add :type, :string
|
||||
add :location, :string
|
||||
add :user_id, references(:users, on_delete: :nothing, type: :binary_id)
|
||||
|
||||
timestamps()
|
||||
end
|
||||
|
||||
create index(:containers, [:user_id])
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user