PC-1016 Rename column creator to creatorId

This commit is contained in:
Keir Nellyer 2016-10-29 14:27:19 +01:00
parent eb37c5da2e
commit 09e5d13b96
2 changed files with 5 additions and 2 deletions

View File

@ -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 (?, ?);";

View File

@ -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;