laravel 5 - What to put in down() function if up() drops table? -
just starting learn laravel, go easy. made couple migration files try out. first creates table, second adds column, , third drops table. i'm curious know should put in down()
function of third migration, since can't "undrop" table. how handle rolling migration drops table?
the point of down function restore database same state in before ran function. if up()
drops table, down()
should recreate table.
it important note lose data if this. migrations intended manage scheme of database, not contents. if want preserve data, that's backup.
Comments
Post a Comment