-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Move email from usr_mails table directly to column email in use…
…r table
- Loading branch information
1 parent
a216bac
commit 917df2f
Showing
5 changed files
with
37 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
-- SQL Migration file | ||
-- Author: Matěj Kmínek <[email protected]> | ||
-- Created: 15.09.2024 17:16:04 | ||
|
||
|
||
/* | ||
Comment for this migration: (not neccessary, but can be handy) | ||
*/ | ||
|
||
|
||
-- UP: | ||
-- commands that updates database shall be written here: | ||
|
||
ALTER TABLE `user` ADD `email` VARCHAR(1023) NULL DEFAULT NULL AFTER `password`; | ||
UPDATE `user` SET `email` = (SELECT `email` FROM `usr_mails` WHERE `user_id` = `user`.`id` LIMIT 1); | ||
DROP TABLE `usr_mails`; | ||
DROP VIEW IF EXISTS `v_users`; | ||
|
||
|
||
-- DOWN: | ||
-- commands that reverts updates from UP section shall be written here: | ||
|
||
CALL 'Migrations DOWN are for security reasons temporarily DISABLED. Impossible to migrate down from 2024-09-15T17-16-04, in file 2024-09-15T17-16-04.sql'; | ||
|
||
-- DOWN migrations are disabled for security reasons. | ||
-- These migrations might often include removal of some existent database columns, which is very dangerous to do on production servers. | ||
-- Whenever we would migrate DOWN, then it would be impossible to migrate UP again, without loss of data. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters