Skip to content

Commit

Permalink
add updated_at for workspaces and clustering_data_planes
Browse files Browse the repository at this point in the history
  • Loading branch information
liverpool8056 committed Mar 7, 2023
1 parent ab74ca3 commit 584bf2f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kong/db/migrations/core/019_320_to_330.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ return {
ALTER TABLE IF EXISTS ONLY "targets" ADD "updated_at" TIMESTAMP WITH TIME ZONE DEFAULT timezone('UTC'::text, ('now'::text)::timestamp(0) with time zone);
ALTER TABLE IF EXISTS ONLY "upstreams" ADD "updated_at" TIMESTAMP WITH TIME ZONE DEFAULT timezone('UTC'::text, ('now'::text)::timestamp(0) with time zone);
ALTER TABLE IF EXISTS ONLY "workspaces" ADD "updated_at" TIMESTAMP WITH TIME ZONE DEFAULT timezone('UTC'::text, ('now'::text)::timestamp(0) with time zone);
ALTER TABLE IF EXISTS ONLY "clustering_data_planes" ADD "updated_at" TIMESTAMP WITH TIME ZONE DEFAULT timezone('UTC'::text, ('now'::text)::timestamp(0) with time zone);
EXCEPTION WHEN DUPLICATE_COLUMN THEN
-- Do nothing, accept existing state
END;
Expand All @@ -28,6 +29,7 @@ return {
ALTER TABLE targets ADD updated_at timestamp;
ALTER TABLE upstreams ADD updated_at timestamp;
ALTER TABLE workspaces ADD updated_at timestamp;
ALTER TABLE clustering_data_planes ADD updated_at timestamp;
]]
},
}
1 change: 1 addition & 0 deletions kong/db/schema/entities/clustering_data_planes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ return {
fields = {
{ id = typedefs.uuid { required = true, }, },
{ last_seen = typedefs.auto_timestamp_s },
{ updated_at = typedefs.auto_timestamp_s },
{ ip = typedefs.ip { required = true, } },
{ config_hash = { type = "string", len_eq = 32, } },
{ hostname = typedefs.host { required = true, } },
Expand Down

0 comments on commit 584bf2f

Please sign in to comment.