<?php
require_once __DIR__ . '/../app/includes/auth.php';
$tables = db()->query('SHOW TABLES')->fetchAll(PDO::FETCH_COLUMN);
$out = '';
foreach ($tables as $t) {
    $out .= "--- $t ---\n";
    $out .= db()->query("SHOW CREATE TABLE $t")->fetchColumn(1);
    $out .= "\n";
}
file_put_contents('schema.txt', $out);
