database design - Conditionally add a column to a mysql table -
i have project want able manage several instances of same database on several people's localhosts. want each developer able reset db canonical origin no matter state db into. end maintain standard database file. holds schema using create table table_name if not exists {
however, want able add starting table structures needed project moves along. this, love able following alter table table_name add column if not exists column_name
not seem exist. did notice stored procedure floating around internet solves this, wanted know if simpler able achieve goal have in mind. thank time , help.
it won't possible plain sql. stored procedure should work best: read information_schema , check if column present. if not - execute alter statement.