Rollback in specific table Laravel 4

5

I am manipulating a MySQL database with Laravel 4. I want to know if there is any way to do a rollback on just one of the database tables. For example, my migration included the x, y, and z tables. I want to do a rollback only on the table and. Is it possible?

    
asked by anonymous 14.12.2015 / 12:57

1 answer

4

Yes it is possible:

To delete the table data:

DB::table('tabela_y')->delete();

Truncating into a table:

DB::table('tabela_y')->truncate();

Link of the documentation.

    
14.12.2015 / 13:04