mirror of
https://github.com/ash-project/ash_postgres.git
synced 2024-09-20 13:33:50 +12:00
fbc42ce87a
feat: add `mix ash_postgres.create` feat: add `mix ash_postgres.migrate` feat: add `mix ash_postgres.migrate --tenants` feat: add `mix ash_postgres.drop`
29 lines
No EOL
772 B
Elixir
29 lines
No EOL
772 B
Elixir
defmodule AshPostgres.TestRepo.TenantMigrations.MigrateResources1 do
|
|
@moduledoc """
|
|
Updates resources based on their most recent snapshots.
|
|
|
|
This file was autogenerated with `mix ash_postgres.generate_migrations`
|
|
"""
|
|
|
|
use Ecto.Migration
|
|
|
|
def up do
|
|
create table(:multitenant_posts, primary_key: false, prefix: prefix()) do
|
|
add :id, :binary_id, null: false, default: fragment("uuid_generate_v4()"), primary_key: true
|
|
|
|
add :org_id,
|
|
references("multitenant_orgs",
|
|
type: :binary_id,
|
|
column: :id,
|
|
name: "#{prefix()}_multitenant_orgs_org_id_fkey",
|
|
prefix: "public"
|
|
)
|
|
|
|
add :name, :text
|
|
end
|
|
end
|
|
|
|
def down do
|
|
drop table("multitenant_posts", prefix: prefix())
|
|
end
|
|
end |