From 07923bb34f22adfd8fcaf75a6aea86df91ec3d4d Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Mon, 21 Mar 2022 23:55:59 -0400 Subject: [PATCH] twitch event logs schema wip --- .../down.sql | 6 +++++- .../up.sql | 21 ++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/_migrations/2022-03-14-035745_twitch_event_match_logs/down.sql b/_migrations/2022-03-14-035745_twitch_event_match_logs/down.sql index 291a97c5ce..ff2b203e89 100644 --- a/_migrations/2022-03-14-035745_twitch_event_match_logs/down.sql +++ b/_migrations/2022-03-14-035745_twitch_event_match_logs/down.sql @@ -1 +1,5 @@ --- This file should undo anything in `up.sql` \ No newline at end of file +-- noinspection SqlDialectInspectionForFile +-- noinspection SqlNoDataSourceInspectionForFile +-- noinspection SqlResolveForFile + +DROP TABLE twitch_event_match_logs; diff --git a/_migrations/2022-03-14-035745_twitch_event_match_logs/up.sql b/_migrations/2022-03-14-035745_twitch_event_match_logs/up.sql index 33cf74b578..a6df161c47 100644 --- a/_migrations/2022-03-14-035745_twitch_event_match_logs/up.sql +++ b/_migrations/2022-03-14-035745_twitch_event_match_logs/up.sql @@ -1 +1,20 @@ --- Your SQL goes here \ No newline at end of file +-- noinspection SqlDialectInspectionForFile +-- noinspection SqlNoDataSourceInspectionForFile +-- noinspection SqlResolveForFile + +-- Log any event matching (bits, channel points, etc.) +CREATE TABLE twitch_event_match_logs( + -- Not used for anything except replication. + id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, + + -- Type of event, eg. + event_type VARCHAR(32) NOT NULL, + + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + deleted_at TIMESTAMP DEFAULT NULL, + + -- INDICES -- + PRIMARY KEY (id) + +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;