Last active
February 3, 2023 05:28
-
-
Save eastside/2c96878f91d6f4288112a09f4bfef745 to your computer and use it in GitHub Desktop.
MySQL Online Schema Change Example using Percona
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
#!/bin/bash | |
pt-online-schema-change \ | |
--execute \ | |
--progress time,1 \ | |
--print \ | |
--recursion-method=none \ | |
-h my_host \ | |
-u root \ | |
--ask-pass \ | |
--alter-foreign-keys-method drop_swap \ | |
--alter "ADD COLUMN aaa bigint NULL, ADD CONSTRAINT bbb FOREIGN KEY (ccc) REFERENCES ddd(eee)" \ | |
D=my_db,t=my_table |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment