parent
0415938248
commit
2d78c2bd1b
@ -0,0 +1,32 @@
|
|||||||
|
defmodule DecentralisedBookIndex.Repo.Migrations.UpdateDbiServerToAddRelationshipToItselfAndSyncOnAttribute 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(:dbi_servers) do
|
||||||
|
add :sync_on?, :boolean, default: false
|
||||||
|
|
||||||
|
add :dbi_server_id,
|
||||||
|
references(:dbi_servers,
|
||||||
|
column: :id,
|
||||||
|
name: "dbi_servers_dbi_server_id_fkey",
|
||||||
|
type: :uuid,
|
||||||
|
prefix: "public"
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down do
|
||||||
|
drop constraint(:dbi_servers, "dbi_servers_dbi_server_id_fkey")
|
||||||
|
|
||||||
|
alter table(:dbi_servers) do
|
||||||
|
remove :dbi_server_id
|
||||||
|
remove :sync_on?
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,129 @@
|
|||||||
|
{
|
||||||
|
"attributes": [
|
||||||
|
{
|
||||||
|
"allow_nil?": false,
|
||||||
|
"default": "fragment(\"gen_random_uuid()\")",
|
||||||
|
"generated?": false,
|
||||||
|
"primary_key?": true,
|
||||||
|
"references": null,
|
||||||
|
"size": null,
|
||||||
|
"source": "id",
|
||||||
|
"type": "uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_nil?": false,
|
||||||
|
"default": "nil",
|
||||||
|
"generated?": false,
|
||||||
|
"primary_key?": false,
|
||||||
|
"references": null,
|
||||||
|
"size": null,
|
||||||
|
"source": "name",
|
||||||
|
"type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_nil?": false,
|
||||||
|
"default": "nil",
|
||||||
|
"generated?": false,
|
||||||
|
"primary_key?": false,
|
||||||
|
"references": null,
|
||||||
|
"size": null,
|
||||||
|
"source": "url",
|
||||||
|
"type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_nil?": true,
|
||||||
|
"default": "false",
|
||||||
|
"generated?": false,
|
||||||
|
"primary_key?": false,
|
||||||
|
"references": null,
|
||||||
|
"size": null,
|
||||||
|
"source": "sync_on?",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_nil?": false,
|
||||||
|
"default": "fragment(\"(now() AT TIME ZONE 'utc')\")",
|
||||||
|
"generated?": false,
|
||||||
|
"primary_key?": false,
|
||||||
|
"references": null,
|
||||||
|
"size": null,
|
||||||
|
"source": "inserted_at",
|
||||||
|
"type": "utc_datetime_usec"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_nil?": false,
|
||||||
|
"default": "fragment(\"(now() AT TIME ZONE 'utc')\")",
|
||||||
|
"generated?": false,
|
||||||
|
"primary_key?": false,
|
||||||
|
"references": null,
|
||||||
|
"size": null,
|
||||||
|
"source": "updated_at",
|
||||||
|
"type": "utc_datetime_usec"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"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": null,
|
||||||
|
"global": null,
|
||||||
|
"strategy": null
|
||||||
|
},
|
||||||
|
"name": "dbi_servers_dbi_server_id_fkey",
|
||||||
|
"on_delete": null,
|
||||||
|
"on_update": null,
|
||||||
|
"primary_key?": true,
|
||||||
|
"schema": "public",
|
||||||
|
"table": "dbi_servers"
|
||||||
|
},
|
||||||
|
"size": null,
|
||||||
|
"source": "dbi_server_id",
|
||||||
|
"type": "uuid"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"base_filter": null,
|
||||||
|
"check_constraints": [],
|
||||||
|
"custom_indexes": [
|
||||||
|
{
|
||||||
|
"all_tenants?": false,
|
||||||
|
"concurrently": false,
|
||||||
|
"error_fields": [],
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"value": "name gin_trgm_ops"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"include": null,
|
||||||
|
"message": null,
|
||||||
|
"name": "server_name_gin_index",
|
||||||
|
"nulls_distinct": true,
|
||||||
|
"prefix": null,
|
||||||
|
"table": null,
|
||||||
|
"unique": false,
|
||||||
|
"using": "GIN",
|
||||||
|
"where": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"custom_statements": [],
|
||||||
|
"has_create_action": true,
|
||||||
|
"hash": "9EDA6BBD6005F48CE5FAFDEE80AEF0C1B3A98440F9287B4294CF64D5BB02F199",
|
||||||
|
"identities": [],
|
||||||
|
"multitenancy": {
|
||||||
|
"attribute": null,
|
||||||
|
"global": null,
|
||||||
|
"strategy": null
|
||||||
|
},
|
||||||
|
"repo": "Elixir.DecentralisedBookIndex.Repo",
|
||||||
|
"schema": null,
|
||||||
|
"table": "dbi_servers"
|
||||||
|
}
|
Loading…
Reference in new issue