<?php
require 'vendor/autoload.php';
$app = require 'bootstrap/app.php';
$app->make('Illuminate\Contracts\Console\Kernel')->bootstrap();

$result = DB::select("SELECT setval(pg_get_serial_sequence('orders_override', 'id'), COALESCE(MAX(id), 0) + 1, false) FROM orders_override");
echo "Sequence reset. Next id will be: " . $result[0]->setval . PHP_EOL;
