Skip to content

Commit

Permalink
Delete invalid entries in uniqueid_exempt before adding constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
micheljung committed Aug 28, 2017
1 parent 92e8800 commit 623e566
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions migrations/V36__uid-constraints.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ ALTER TABLE `uniqueid`
ADD COLUMN `create_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN `update_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;

DELETE FROM `uniqueid_exempt` WHERE user_id not in (SELECT id from login);
ALTER TABLE `uniqueid_exempt`
ADD COLUMN `create_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN `update_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
Expand Down

0 comments on commit 623e566

Please sign in to comment.