Thursday, October 30, 2008

Common MySQL stuff

To modify an existing column definition:

ALTER TABLE applications modify id INTEGER NOT NULL AUTO_INCREMENT FIRST;

To rename a column:

ALTER TABLE applications CHANGE old_col new_col;

No comments: