forked from ash-project/ash_admin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
17 changed files
with
959 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
defmodule Demo.Repo.Migrations.MigrateResources6 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 | ||
drop_if_exists( | ||
unique_index(:users, [:id, :first_name, :last_name], | ||
name: "users_representative_name_index" | ||
) | ||
) | ||
|
||
create( | ||
unique_index(:users, [:org, :first_name, :last_name], | ||
where: "representative = true", | ||
name: "users_representative_name_index" | ||
) | ||
) | ||
|
||
alter table(:tickets) do | ||
add(:metadata, :map) | ||
end | ||
end | ||
|
||
def down do | ||
alter table(:tickets) do | ||
remove(:metadata) | ||
end | ||
|
||
drop_if_exists( | ||
unique_index(:users, [:org, :first_name, :last_name], | ||
name: "users_representative_name_index" | ||
) | ||
) | ||
|
||
create( | ||
unique_index(:users, [:org, :first_name, :last_name], | ||
where: "representative = true", | ||
name: "users_representative_name_index" | ||
) | ||
) | ||
end | ||
end |
183 changes: 183 additions & 0 deletions
183
dev/resource_snapshots/repo/tickets/20240516215427.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,183 @@ | ||
{ | ||
"attributes": [ | ||
{ | ||
"default": "fragment(\"gen_random_uuid()\")", | ||
"size": null, | ||
"type": "uuid", | ||
"source": "id", | ||
"references": null, | ||
"allow_nil?": false, | ||
"primary_key?": true, | ||
"generated?": false | ||
}, | ||
{ | ||
"default": "nil", | ||
"size": null, | ||
"type": "text", | ||
"source": "subject", | ||
"references": null, | ||
"allow_nil?": false, | ||
"primary_key?": false, | ||
"generated?": false | ||
}, | ||
{ | ||
"default": "nil", | ||
"size": null, | ||
"type": "map", | ||
"source": "metadata", | ||
"references": null, | ||
"allow_nil?": true, | ||
"primary_key?": false, | ||
"generated?": false | ||
}, | ||
{ | ||
"default": "nil", | ||
"size": null, | ||
"type": "text", | ||
"source": "description", | ||
"references": null, | ||
"allow_nil?": true, | ||
"primary_key?": false, | ||
"generated?": false | ||
}, | ||
{ | ||
"default": "nil", | ||
"size": null, | ||
"type": "text", | ||
"source": "response", | ||
"references": null, | ||
"allow_nil?": true, | ||
"primary_key?": false, | ||
"generated?": false | ||
}, | ||
{ | ||
"default": "\"new\"", | ||
"size": null, | ||
"type": "text", | ||
"source": "status", | ||
"references": null, | ||
"allow_nil?": false, | ||
"primary_key?": false, | ||
"generated?": false | ||
}, | ||
{ | ||
"default": "fragment(\"(now() AT TIME ZONE 'utc')\")", | ||
"size": null, | ||
"type": "utc_datetime_usec", | ||
"source": "inserted_at", | ||
"references": null, | ||
"allow_nil?": false, | ||
"primary_key?": false, | ||
"generated?": false | ||
}, | ||
{ | ||
"default": "fragment(\"(now() AT TIME ZONE 'utc')\")", | ||
"size": null, | ||
"type": "utc_datetime_usec", | ||
"source": "updated_at", | ||
"references": null, | ||
"allow_nil?": false, | ||
"primary_key?": false, | ||
"generated?": false | ||
}, | ||
{ | ||
"default": "nil", | ||
"size": null, | ||
"type": "uuid", | ||
"source": "reporter_id", | ||
"references": { | ||
"name": "tickets_reporter_id_fkey", | ||
"table": "users", | ||
"destination_attribute": "id", | ||
"primary_key?": true, | ||
"schema": "public", | ||
"multitenancy": { | ||
"global": null, | ||
"attribute": null, | ||
"strategy": null | ||
}, | ||
"on_delete": null, | ||
"on_update": null, | ||
"deferrable": false, | ||
"match_with": null, | ||
"match_type": null, | ||
"destination_attribute_default": null, | ||
"destination_attribute_generated": null | ||
}, | ||
"allow_nil?": true, | ||
"primary_key?": false, | ||
"generated?": false | ||
}, | ||
{ | ||
"default": "nil", | ||
"size": null, | ||
"type": "uuid", | ||
"source": "representative_id", | ||
"references": { | ||
"name": "tickets_representative_id_fkey", | ||
"table": "users", | ||
"destination_attribute": "id", | ||
"primary_key?": true, | ||
"schema": "public", | ||
"multitenancy": { | ||
"global": null, | ||
"attribute": null, | ||
"strategy": null | ||
}, | ||
"on_delete": null, | ||
"on_update": null, | ||
"deferrable": false, | ||
"match_with": null, | ||
"match_type": null, | ||
"destination_attribute_default": null, | ||
"destination_attribute_generated": null | ||
}, | ||
"allow_nil?": true, | ||
"primary_key?": false, | ||
"generated?": false | ||
}, | ||
{ | ||
"default": "nil", | ||
"size": null, | ||
"type": "uuid", | ||
"source": "organization_id", | ||
"references": { | ||
"name": "tickets_organization_id_fkey", | ||
"table": "organizations", | ||
"destination_attribute": "id", | ||
"primary_key?": true, | ||
"schema": "public", | ||
"multitenancy": { | ||
"global": null, | ||
"attribute": null, | ||
"strategy": null | ||
}, | ||
"on_delete": null, | ||
"on_update": null, | ||
"deferrable": false, | ||
"match_with": null, | ||
"match_type": null, | ||
"destination_attribute_default": null, | ||
"destination_attribute_generated": null | ||
}, | ||
"allow_nil?": false, | ||
"primary_key?": false, | ||
"generated?": false | ||
} | ||
], | ||
"table": "tickets", | ||
"hash": "24D2DA4ADA475CF4B05D30CF592EAB2C5978B4DBFE4A65CCE0F9CCB793526262", | ||
"repo": "Elixir.Demo.Repo", | ||
"schema": null, | ||
"check_constraints": [], | ||
"identities": [], | ||
"custom_indexes": [], | ||
"multitenancy": { | ||
"global": null, | ||
"attribute": null, | ||
"strategy": null | ||
}, | ||
"base_filter": null, | ||
"custom_statements": [], | ||
"has_create_action": true | ||
} |
Oops, something went wrong.