From 09e5d13b96d5f1350251f35ddf3671482aefdb6c Mon Sep 17 00:00:00 2001 From: Keir Nellyer Date: Sat, 29 Oct 2016 14:27:19 +0100 Subject: [PATCH] PC-1016 Rename column `creator` to `creatorId` --- .../src/mineplex/core/chatsnap/SnapshotRepository.java | 2 +- Plugins/Mineplex.ReportSite/sql/6-cleanup-task.sql | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/chatsnap/SnapshotRepository.java b/Plugins/Mineplex.Core/src/mineplex/core/chatsnap/SnapshotRepository.java index 8ab7297a9..f239ff55c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/chatsnap/SnapshotRepository.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/chatsnap/SnapshotRepository.java @@ -65,7 +65,7 @@ public class SnapshotRepository return token; } - private static final String INSERT_SNAPSHOT = "INSERT INTO snapshots (token, creator) VALUES (?, ?);"; + private static final String INSERT_SNAPSHOT = "INSERT INTO snapshots (token, creatorId) VALUES (?, ?);"; private static final String INSERT_MESSAGE = "INSERT INTO snapshotMessages (senderId, `server`, `time`, message, snapshotType) VALUES (?, ?, ?, ?, ?);"; private static final String INSERT_MESSAGE_RECIPIENT = "INSERT INTO snapshotRecipients (messageId, recipientId) VALUES (?, ?);"; private static final String INSERT_MESSAGE_MAPPING = "INSERT INTO snapshotMessageMap (snapshotId, messageId) VALUES (?, ?);"; diff --git a/Plugins/Mineplex.ReportSite/sql/6-cleanup-task.sql b/Plugins/Mineplex.ReportSite/sql/6-cleanup-task.sql index 451877729..b83563c92 100644 --- a/Plugins/Mineplex.ReportSite/sql/6-cleanup-task.sql +++ b/Plugins/Mineplex.ReportSite/sql/6-cleanup-task.sql @@ -1,7 +1,10 @@ +-- RENAME COLUMN `creator` to `creatorId` +ALTER TABLE Account.snapshots CHANGE creator creatorId INT(11); + -- STORE DATETIME SNAPSHOT CREATED (CLEANUP PURPOSES) ALTER TABLE Account.snapshots ADD created DATETIME DEFAULT NOW() NOT NULL; ALTER TABLE Account.snapshots - MODIFY COLUMN creator INT(11) AFTER created; + MODIFY COLUMN creatorId INT(11) AFTER created; -- CASCADE HANDLERS TABLE ALTER TABLE Account.reportHandlers DROP FOREIGN KEY reportHandlers_reports_id_fk;