chore: gen migrations

This commit is contained in:
Zach Daniel 2024-07-02 12:46:03 -04:00
parent 185e9bea83
commit 7d41e69a11
2 changed files with 106 additions and 0 deletions

View file

@ -0,0 +1,83 @@
{
"attributes": [
{
"allow_nil?": false,
"default": "fragment(\"gen_random_uuid()\")",
"generated?": false,
"primary_key?": true,
"references": null,
"size": null,
"source": "id",
"type": "uuid"
},
{
"allow_nil?": true,
"default": "nil",
"generated?": false,
"primary_key?": false,
"references": null,
"size": null,
"source": "name",
"type": "text"
},
{
"allow_nil?": true,
"default": "nil",
"generated?": false,
"primary_key?": false,
"references": {
"deferrable": false,
"destination_attribute": "id",
"destination_attribute_default": null,
"destination_attribute_generated": null,
"index?": false,
"match_type": null,
"match_with": null,
"multitenancy": {
"attribute": "org_id",
"global": true,
"strategy": "attribute"
},
"name": "multitenant_orgs_owner_id_fkey",
"on_delete": null,
"on_update": null,
"primary_key?": true,
"schema": "public",
"table": "users"
},
"size": null,
"source": "owner_id",
"type": "text"
}
],
"base_filter": null,
"check_constraints": [],
"custom_indexes": [],
"custom_statements": [],
"has_create_action": true,
"hash": "8A0A6960023A27597EB918B7EDCA957E5AA9C78D3BE83FE7924A1F5BFA531F6C",
"identities": [
{
"all_tenants?": false,
"base_filter": null,
"index_name": "multitenant_orgs_unique_by_name_index",
"keys": [
{
"type": "atom",
"value": "name"
}
],
"name": "unique_by_name",
"nils_distinct?": true,
"where": null
}
],
"multitenancy": {
"attribute": "id",
"global": true,
"strategy": "attribute"
},
"repo": "Elixir.AshPostgres.TestRepo",
"schema": null,
"table": "multitenant_orgs"
}

View file

@ -0,0 +1,23 @@
defmodule AshPostgres.TestRepo.Migrations.MigrateResources32 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
alter table(:multitenant_orgs) do
remove(:owner_id)
add(:owner_id, :text)
end
end
def down do
alter table(:multitenant_orgs) do
remove(:owner_id)
add(:owner_id, :uuid)
end
end
end