Created
January 18, 2014 00:06
-
-
Save bmvakili/8484057 to your computer and use it in GitHub Desktop.
update iff tables already created with service builder, update id_ to id
This file contains hidden or 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
SET FOREIGN_KEY_CHECKS = 0; | |
SET GROUP_CONCAT_MAX_LEN=32768; | |
SET @tables = NULL; | |
SELECT GROUP_CONCAT(table_name) INTO @tables | |
FROM information_schema.columns | |
WHERE table_schema = (SELECT DATABASE()) AND (LOWER(table_name) like 'x%' OR LOWER(table_name) like 'sm%' OR LOWER(table_name) like 'invites%' OR LOWER(table_name) like 'blockvendor%' ) AND column_name = 'id_'; | |
select REPLACE(@tables, ',', ' change id_ id int(11) ; alter table ') into @tables; | |
select CONCAT('alter table ', @tables) into @tables; | |
select CONCAT(@tables, ' change id_ id int(11) ;') into @tables; | |
select @tables; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment