Faster initial database creation (#12297)

* Faster initial database creation
Add db dumps to improve initial db migration
On my test system 13s -> 7s, a 46% reduction.
Should help out a lot on systems like RPi

* lnms schema:dump command

--snapshots saves db snapshots, otherwise it saves the yaml

* fix style

* fix timezones...

* not working with in-memory db yet
remove build.sql
This commit is contained in:
Tony Murray
2020-11-05 18:19:15 -06:00
committed by GitHub
parent 03c950af8c
commit 25722bbbd5
10 changed files with 5663 additions and 196 deletions

View File

@@ -1,14 +0,0 @@
#!/usr/bin/env php
<?php
$install_dir = realpath(__DIR__ . '/..');
// update.php will call init.php
require $install_dir . '/includes/sql-schema/update.php';
$file = $install_dir . '/misc/db_schema.yaml';
$yaml = Symfony\Component\Yaml\Yaml::dump(dump_db_schema(), 3, 2);
if (file_put_contents($file, $yaml)) {
echo "Updated!\n";
}