mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
drop position trigger on labels table and sort labels by name returned by labels api
This commit is contained in:
parent
135999fa83
commit
b0f0dba53d
3 changed files with 28 additions and 1 deletions
|
|
@ -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;
|
||||
Loading…
Reference in a new issue