Skip to content
Snippets Groups Projects
Commit aab0ba2c authored by Michal Zander's avatar Michal Zander
Browse files

Format index creation command using $$

parent a29a0041
No related branches found
No related tags found
2 merge requests!83Merge develop to master for release,!62Format index creation command using $$
Pipeline #111027 passed
-- noqa: disable=PRS
DO $$
DECLARE
__schema_name VARCHAR;
......@@ -7,25 +9,29 @@ BEGIN
--FIXME indexes must be created concurrently
PERFORM hive.register_index_dependency(
__schema_name,
'CREATE UNIQUE INDEX IF NOT EXISTS delete_comment_op_idx ON hafd.operations USING btree
$idx$
CREATE UNIQUE INDEX IF NOT EXISTS delete_comment_op_idx ON hafd.operations USING btree
(
(body_binary::jsonb -> ''value'' ->> ''author''),
(body_binary::jsonb -> ''value'' ->> ''permlink''),
(body_binary::jsonb -> 'value' ->> 'author'),
(body_binary::jsonb -> 'value' ->> 'permlink'),
id desc
)
WHERE hive.operation_id_to_type_id(id) in (17, 61)'
WHERE hive.operation_id_to_type_id(id) in (17, 61)
$idx$
);
PERFORM hive.register_index_dependency(
__schema_name,
'CREATE UNIQUE INDEX IF NOT EXISTS effective_comment_vote_idx ON hafd.operations USING btree
$idx$
CREATE UNIQUE INDEX IF NOT EXISTS effective_comment_vote_idx ON hafd.operations USING btree
(
(body_binary::jsonb -> ''value'' ->> ''author''),
(body_binary::jsonb -> ''value'' ->> ''voter''),
(body_binary::jsonb -> ''value'' ->> ''permlink''),
(body_binary::jsonb -> 'value' ->> 'author'),
(body_binary::jsonb -> 'value' ->> 'voter'),
(body_binary::jsonb -> 'value' ->> 'permlink'),
id desc
)
WHERE hive.operation_id_to_type_id(id) = 72'
WHERE hive.operation_id_to_type_id(id) = 72
$idx$
);
END
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment