Laravel Eloquent truncate - Foreign key constraint
问题 I am having some issues with deleting data using Laravel 5. I seem to be stuck on a 'foreign key constraint', while I don't see why. In my current database model I have a datapoints table, which has a foreign key to the sensors table (datapoints.sensors_id -> sensor.id). The code I am trying: Route::get('/truncateData', function() { DB::table('datapoints')->truncate(); DB::table('sensors')->truncate(); return 'Done...'; }); The result: SQLSTATE[42000]: Syntax error or access violation: 1701