mardi 27 novembre 2018

Truncate a table base on database connection in Laravel 5

I have a database connection nuc I have a table name Alerts

I'm trying to truncate that table by doing this

DB::connection('nuc')->statement('TRUNCATE Alerts');

I kept getting

enter image description here

QueryException in Connection.php line 629: SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "alerts" does not exist (SQL: TRUNCATE Alerts)

How do I force truncate a table base on database connection?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire