From 744b6c2af23a2b6515d4e4751ef71ae8cdd982ae Mon Sep 17 00:00:00 2001 From: Thibault Charbonnier Date: Wed, 4 Oct 2017 18:39:12 -0700 Subject: [PATCH] fix(postgres) migration for APIs created_at default precision Follow-up commit to 5cb196cd497823142cc804dbae6690d6c8930917 This migration is targeted for landing in 0.12.0, and will ensure that newly created APIs will have a `created_at` field with ms precision. From #2925 --- kong/dao/migrations/postgres.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/kong/dao/migrations/postgres.lua b/kong/dao/migrations/postgres.lua index fe6cc8d2901..2d721b970bf 100644 --- a/kong/dao/migrations/postgres.lua +++ b/kong/dao/migrations/postgres.lua @@ -533,4 +533,13 @@ return { ]], down = function(_, _, dao) end -- not implemented }, + { + name = "2017-10-02-173400_apis_created_at_ms_precision", + up = [[ + ALTER TABLE apis ALTER COLUMN created_at SET DEFAULT CURRENT_TIMESTAMP(3); + ]], + down = [[ + ALTER TABLE apis ALTER COLUMN created_at SET DEFAULT CURRENT_TIMESTAMP(0); + ]] + }, }