-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Schema update #133
base: master
Are you sure you want to change the base?
Schema update #133
Conversation
…ty with applications referencing the old column name.
|
-- Modify "users" table | ||
ALTER TABLE `users` DROP CHECK `users_chk_1`, ADD CONSTRAINT `users_chk_1` CHECK (regexp_like(`email_address`,_utf8mb4'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}$')), DROP COLUMN `email`, ADD COLUMN `email_address` varchar(255) NOT NULL, DROP INDEX `user_name_email`, ADD UNIQUE INDEX `email_address` (`email_address`), ADD UNIQUE INDEX `user_name_email_address` (`user_name`, `email_address`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caution
destructive changes detected
Dropping non-virtual column "email" DS103
Add a pre-migration check to ensure column "email" is NULL before dropping it
-- Modify "users" table | |
ALTER TABLE `users` DROP CHECK `users_chk_1`, ADD CONSTRAINT `users_chk_1` CHECK (regexp_like(`email_address`,_utf8mb4'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}$')), DROP COLUMN `email`, ADD COLUMN `email_address` varchar(255) NOT NULL, DROP INDEX `user_name_email`, ADD UNIQUE INDEX `email_address` (`email_address`), ADD UNIQUE INDEX `user_name_email_address` (`user_name`, `email_address`); | |
-- atlas:txtar | |
-- checks/destructive.sql -- | |
-- atlas:assert DS103 | |
SELECT NOT EXISTS (SELECT 1 FROM `users` WHERE `email` IS NOT NULL) AS `is_empty`; | |
-- migration.sql -- | |
-- Modify "users" table | |
ALTER TABLE `users` DROP CHECK `users_chk_1`, ADD CONSTRAINT `users_chk_1` CHECK (regexp_like(`email_address`,_utf8mb4'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}$')), DROP COLUMN `email`, ADD COLUMN `email_address` varchar(255) NOT NULL, DROP INDEX `user_name_email`, ADD UNIQUE INDEX `email_address` (`email_address`), ADD UNIQUE INDEX `user_name_email_address` (`user_name`, `email_address`); |
Ensure to run atlas migrate hash --dir "file://dirs/ecommerce/migrations"
after applying the suggested changes.
Renamed column in table to , causing potential backward-incompatibility with applications referencing the old column name.