]> git.sesse.net Git - skvidarsync/commitdiff
Remove the legacy (non-logged) reactions table.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 27 Oct 2023 13:11:03 +0000 (15:11 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 27 Oct 2023 13:11:03 +0000 (15:11 +0200)
skvidarlang.sql
www/event.pl

index 78e39e8679e640b0c51bf110a3fe53db5f88f421..ae0fb8d554b888d0a20916e3e96c83eeadccc4d4 100644 (file)
@@ -22,16 +22,7 @@ CREATE VIEW current_reactions AS
            FROM reaction_log ORDER BY channel, ts, userid, reaction, event_ts DESC ) t1
   WHERE event_type = 'reaction_added';
 
-CREATE TABLE reactions (
-    userid VARCHAR NOT NULL,
-    channel VARCHAR NOT NULL,
-    ts VARCHAR NOT NULL,
-    reaction VARCHAR NOT NULL,
-    PRIMARY KEY (userid, channel, ts, reaction)
-);
-
 GRANT SELECT,INSERT,DELETE ON TABLE applied TO skvidarlang;
 GRANT SELECT,INSERT ON TABLE reaction_log TO skvidarlang;
 GRANT SELECT ON TABLE current_reactions TO skvidarlang;
-GRANT SELECT,INSERT,DELETE ON TABLE reactions TO skvidarlang;
 
index cf7a21283949c74872d0341ef8f6514f6a950221..974352034bca4bf5abc78b0df5ebd75d6bed6dd3 100755 (executable)
@@ -52,14 +52,10 @@ if (exists($json->{'event'}) && exists($json->{'event'}{'type'})) {
        }
 
        if ($type eq 'reaction_added') {
-               $dbh->do('INSERT INTO reactions (userid, channel, ts, reaction) VALUES (?,?,?,?)', undef,
-                       $user, $channel, $ts, $reaction);
                $dbh->do('INSERT INTO reaction_log (userid, channel, ts, reaction, event_type, event_ts) VALUES (?,?,?,?,?,?)', undef,
                        $user, $channel, $ts, $reaction, $type, $event_ts);
                mark();
        } elsif ($type eq 'reaction_removed') {
-               $dbh->do('DELETE FROM reactions WHERE userid=? AND channel=? AND ts=? AND reaction=?', undef,
-                       $user, $channel, $ts, $reaction);
                $dbh->do('INSERT INTO reaction_log (userid, channel, ts, reaction, event_type, event_ts) VALUES (?,?,?,?,?,?)', undef,
                        $user, $channel, $ts, $reaction, $type, $event_ts);
                mark();