Skip to content

Instantly share code, notes, and snippets.

@revathskumar
Created August 18, 2011 14:59
Show Gist options
  • Save revathskumar/1154235 to your computer and use it in GitHub Desktop.
Save revathskumar/1154235 to your computer and use it in GitHub Desktop.
Rename table and Column query
ALTER TABLE `table_name` ADD `new_field` VARCHAR( 255 ) NOT NULL AFTER `after_this_field`
ALTER TABLE `table_name` CHANGE `old_field_name` `new_field_name` VARCHAR(100);
RENAME TABLE `old_table_name` TO `new_table_name`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment