Add backend admin page
This commit is contained in:
26
src/apply_indexes_safe.php
Executable file
26
src/apply_indexes_safe.php
Executable file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
require __DIR__.'/vendor/autoload.php';
|
||||
$app = require_once __DIR__.'/bootstrap/app.php';
|
||||
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
|
||||
$kernel->bootstrap();
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
$sql = file_get_contents('/var/www/gauges.stargas.co.za/add_indexes.sql');
|
||||
$queries = array_filter(array_map('trim', explode(';', $sql)));
|
||||
|
||||
foreach ($queries as $query) {
|
||||
if (empty($query) || str_starts_with($query, '--')) continue;
|
||||
echo "Running: " . substr($query, 0, 60) . "...\n";
|
||||
try {
|
||||
DB::unprepared($query);
|
||||
echo "Success.\n";
|
||||
} catch (\Exception $e) {
|
||||
if (str_contains($e->getMessage(), 'Duplicate key name')) {
|
||||
echo "Index already exists, skipping.\n";
|
||||
} else {
|
||||
echo "Error: " . $e->getMessage() . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "Done.\n";
|
||||
0
src/bootstrap/cache/.gitignore
vendored
Normal file → Executable file
0
src/bootstrap/cache/.gitignore
vendored
Normal file → Executable file
2421
src/package-lock.json
generated
Normal file
2421
src/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
0
src/storage/app/.gitignore
vendored
Normal file → Executable file
0
src/storage/app/.gitignore
vendored
Normal file → Executable file
0
src/storage/app/private/.gitignore
vendored
Normal file → Executable file
0
src/storage/app/private/.gitignore
vendored
Normal file → Executable file
0
src/storage/app/public/.gitignore
vendored
Normal file → Executable file
0
src/storage/app/public/.gitignore
vendored
Normal file → Executable file
0
src/storage/framework/.gitignore
vendored
Normal file → Executable file
0
src/storage/framework/.gitignore
vendored
Normal file → Executable file
0
src/storage/framework/cache/.gitignore
vendored
Normal file → Executable file
0
src/storage/framework/cache/.gitignore
vendored
Normal file → Executable file
0
src/storage/framework/cache/data/.gitignore
vendored
Normal file → Executable file
0
src/storage/framework/cache/data/.gitignore
vendored
Normal file → Executable file
0
src/storage/framework/sessions/.gitignore
vendored
Normal file → Executable file
0
src/storage/framework/sessions/.gitignore
vendored
Normal file → Executable file
0
src/storage/framework/testing/.gitignore
vendored
Normal file → Executable file
0
src/storage/framework/testing/.gitignore
vendored
Normal file → Executable file
0
src/storage/framework/views/.gitignore
vendored
Normal file → Executable file
0
src/storage/framework/views/.gitignore
vendored
Normal file → Executable file
0
src/storage/logs/.gitignore
vendored
Normal file → Executable file
0
src/storage/logs/.gitignore
vendored
Normal file → Executable file
Reference in New Issue
Block a user