Update: 2026-05-15 04:35:25
This commit is contained in:
30
public/migrate_008.php
Normal file
30
public/migrate_008.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* Manual Migration Runner for 008_invoice_lines_enhance
|
||||
*/
|
||||
require_once __DIR__ . '/../app/bootstrap/init.php';
|
||||
|
||||
use App\Core\Database;
|
||||
|
||||
try {
|
||||
$db = Database::getInstance();
|
||||
$sql = file_get_contents(__DIR__ . '/../database/migrations/008_invoice_lines_enhance.sql');
|
||||
|
||||
// Split by semicolon and execute
|
||||
$queries = array_filter(array_map('trim', explode(';', $sql)));
|
||||
|
||||
echo "<h1>Running Migration 008...</h1>";
|
||||
echo "<ul>";
|
||||
foreach ($queries as $query) {
|
||||
if (empty($query)) continue;
|
||||
$db->exec($query);
|
||||
echo "<li>✅ Executed: <pre>" . htmlspecialchars(substr($query, 0, 50)) . "...</pre></li>";
|
||||
}
|
||||
echo "</ul>";
|
||||
echo "<h2>Migration completed successfully!</h2>";
|
||||
echo "<p>Please delete this file (public/migrate_008.php) for security.</p>";
|
||||
|
||||
} catch (\Exception $e) {
|
||||
echo "<h2 style='color:red;'>Migration failed:</h2>";
|
||||
echo "<pre>" . htmlspecialchars($e->getMessage()) . "</pre>";
|
||||
}
|
||||
Reference in New Issue
Block a user