Skip to content

Commit

Permalink
Integer tags (#96)
Browse files Browse the repository at this point in the history
Integer tags
  • Loading branch information
h31 authored Sep 29, 2020
1 parent c94f551 commit 261a630
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class TagVerticle : AbstractKotoedVerticle() {
suspend fun handleDelete(tag: TagRecord) = dbDeleteAsync(tag)

@JsonableEventBusConsumerFor(Address.Api.Tag.List)
suspend fun handleList(message: Unit) = dbFindAsync(TagRecord()).also {
suspend fun handleList(message: Unit) = dbFindAsync(TagRecord().apply { deprecated = false }).also {
use(message)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
ALTER TABLE TAG ADD deprecated BOOLEAN DEFAULT FALSE NOT NULL;

UPDATE tag
SET deprecated = true
WHERE name ~ E'^(-)?[0-9]+\.[0-9]+$';

UPDATE tag
SET style = '{"color": "#333333", "backgroundColor": "white"}'
WHERE tag.deprecated = true;

INSERT INTO tag (id, name, style)
VALUES (DEFAULT, '-1', '{"color": "#ff0000", "backgroundColor": "white"}');

INSERT INTO tag (id, name, style)
VALUES (DEFAULT, '-2', '{"color": "#ee0000", "backgroundColor": "white"}');

INSERT INTO tag (id, name, style)
VALUES (DEFAULT, '-3', '{"color": "#e30000", "backgroundColor": "white"}');

INSERT INTO tag (id, name, style)
VALUES (DEFAULT, '-4', '{"color": "#e90000", "backgroundColor": "white"}');

INSERT INTO tag (id, name, style)
VALUES (DEFAULT, '-5', '{"color": "#dd0000", "backgroundColor": "white"}');

INSERT INTO tag (id, name, style)
VALUES (DEFAULT, '-6', '{"color": "#cf0000", "backgroundColor": "white"}');

INSERT INTO tag (id, name, style)
VALUES (DEFAULT, '-7', '{"color": "#d30000", "backgroundColor": "white"}');

INSERT INTO tag (id, name, style)
VALUES (DEFAULT, '-8', '{"color": "#d60000", "backgroundColor": "white"}');

INSERT INTO tag (id, name, style)
VALUES (DEFAULT, '-9', '{"color": "#da0000", "backgroundColor": "white"}');

INSERT INTO tag (id, name, style)
VALUES (DEFAULT, '-10', '{"color": "#cc0000", "backgroundColor": "white"}');

INSERT INTO tag (id, name, style)
VALUES (DEFAULT, '-12', '{"color": "#bb0000", "backgroundColor": "white"}');

INSERT INTO tag (id, name, style)
VALUES (DEFAULT, '-14', '{"color": "#aa0000", "backgroundColor": "white"}');

INSERT INTO tag (id, name, style)
VALUES (DEFAULT, '-16', '{"color": "#990000", "backgroundColor": "white"}');

INSERT INTO tag (id, name, style)
VALUES (DEFAULT, '-18', '{"color": "#880000", "backgroundColor": "white"}');

INSERT INTO tag (id, name, style)
VALUES (DEFAULT, '-20', '{"color": "#770000", "backgroundColor": "white"}');

0 comments on commit 261a630

Please sign in to comment.