commit melhorias sgf

This commit is contained in:
2026-11-11 09:00:17 +02:00
parent 0b05a1192c
commit 1d11a5e57b
736 changed files with 40746 additions and 210 deletions
+2
View File
@@ -0,0 +1,2 @@
<?php
$book=$argv[1]??'regression';require __DIR__.'/sgf-single-bootstrap.php';if(!$host->getSchemaBuilder()->hasTable('cq_versions'))$host->transaction(function()use($host,$repo){$host->unprepared(file_get_contents($repo.'/database/sql/commercial_quotes.sql'));foreach(['cq_versions','cq_commands','cq_conversions'] as $table){$host->unprepared('CREATE TRIGGER cq_immutable BEFORE UPDATE OR DELETE ON '.$table.' FOR EACH ROW EXECUTE FUNCTION sgf_append_only_audit()');$host->unprepared('CREATE TRIGGER cq_testing BEFORE INSERT ON '.$table.' FOR EACH ROW EXECUTE FUNCTION sgf_wo_test_only()');$host->statement('REVOKE ALL ON TABLE '.$table.' FROM PUBLIC');$host->statement('REVOKE ALL ON SEQUENCE '.$table.'_id_seq FROM PUBLIC');}$host->statement('REVOKE ALL ON FUNCTION sgf_cq_guard() FROM PUBLIC');});echo json_encode(['passed'=>true,'book'=>$book,'business_commands'=>0,'new_grants'=>0]).PHP_EOL;