drop position trigger on labels table and sort labels by name returned by labels api
This commit is contained in:
@ -54,7 +54,7 @@ export const labelsResolver = authorized<LabelsSuccess, LabelsError>(
|
||||
user: { id: uid },
|
||||
},
|
||||
order: {
|
||||
position: 'ASC',
|
||||
name: 'ASC',
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
10
packages/db/migrations/0133.do.drop_position_trigger_ob_labels.sql
Executable file
10
packages/db/migrations/0133.do.drop_position_trigger_ob_labels.sql
Executable file
@ -0,0 +1,10 @@
|
||||
-- Type: DO
|
||||
-- Name: drop_position_trigger_ob_labels
|
||||
-- Description: Drop increment_label_position and decrement_label_position trigger on omnivore.labels table
|
||||
|
||||
BEGIN;
|
||||
|
||||
DROP TRIGGER IF EXISTS increment_label_position ON omnivore.labels;
|
||||
DROP TRIGGER IF EXISTS decrement_label_position ON omnivore.labels;
|
||||
|
||||
COMMIT;
|
||||
17
packages/db/migrations/0133.undo.drop_position_trigger_ob_labels.sql
Executable file
17
packages/db/migrations/0133.undo.drop_position_trigger_ob_labels.sql
Executable file
@ -0,0 +1,17 @@
|
||||
-- Type: UNDO
|
||||
-- Name: drop_position_trigger_ob_labels
|
||||
-- Description: Drop increment_label_position and decrement_label_position trigger on omnivore.labels table
|
||||
|
||||
BEGIN;
|
||||
|
||||
CREATE TRIGGER decrement_label_position
|
||||
AFTER DELETE ON omnivore.labels
|
||||
FOR EACH ROW
|
||||
EXECUTE FUNCTION update_label_position();
|
||||
|
||||
CREATE TRIGGER increment_label_position
|
||||
BEFORE INSERT ON omnivore.labels
|
||||
FOR EACH ROW
|
||||
EXECUTE FUNCTION update_label_position();
|
||||
|
||||
COMMIT;
|
||||
Reference in New Issue
Block a user