The alter method loads up an existing table in order to make modifications. These modifications may include adding, renaming, or dropping columns and constraints.
To begin altering an existing table, call the alter method off of the SchemaBuilder. This method takes a callback as the second parameter that is passed a Blueprint object, much like the create method.
Calling multiple methods inside a single alter callback creates multiple SQL statements to be executed. qb takes care of this execution for you by default.
The following methods off of Blueprint let you modify the table inside the callback:
addColumn
Add a new column to an existing table. Takes a Column instance as the only argument.
Any instance of Column is valid like those returned by the column methods (integer, string, etc.) as well as the column modifier methods (unsigned, nullable, etc.).
ALTERTABLE`users` CHANGE `name``username`VARCHAR(255) NOT NULL
renameColumn
Rename a column on a table. A full Column instance is required as the second argument for Grammars that need to redeclare the column definition when renaming.