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

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -