internal/db: storage bucket pagination migrations (#4213)

This commit is contained in:
Johan Brandhorst-Satzkorn committed 2024-01-05 07:43:21 -08:00
1 parent 52b1c1b4c7
commit d4b60241db
2 files changed
+34

No files matched your search

@@ -0,0 +1,14 @@
-- Copyright (c) HashiCorp, Inc.
-- SPDX-License-Identifier: BUSL-1.1
begin;
-- Add new indexes for the create time and update time queries.
create index storage_plugin_storage_bucket_create_time_public_id_idx
on storage_plugin_storage_bucket (create_time desc, public_id desc);
create index storage_plugin_storage_bucket_update_time_public_id_idx
on storage_plugin_storage_bucket (update_time desc, public_id desc);
analyze storage_plugin_storage_bucket;
commit;
@@ -0,0 +1,20 @@
-- Copyright (c) HashiCorp, Inc.
-- SPDX-License-Identifier: BUSL-1.1
begin;
select plan(2);
select has_index(
'storage_plugin_storage_bucket',
'storage_plugin_storage_bucket_create_time_public_id_idx',
array['create_time', 'public_id']
);
select has_index(
'storage_plugin_storage_bucket',
'storage_plugin_storage_bucket_update_time_public_id_idx',
array['update_time', 'public_id']
);
select * from finish();
rollback;