Permalink
Browse files

ENHANCEMENT Making check/repair/vaccum of database tables on dev/buil…

…d configurable via SS_Database::$check_and_repair_on_build (AIR-12)
  • Loading branch information...
chillu committed Aug 22, 2011
1 parent dba9ee5 commit ce95041bdaa62f1c98e34ffb05078af1f63c7dbf
Showing with 9 additions and 1 deletion.
  1. +9 −1 core/model/Database.php
View
@@ -12,6 +12,14 @@
*/
static $globalConn;
+ /**
+ * @var boolean Check tables when running /dev/build, and repair them if necessary.
+ * In case of large databases or more fine-grained control on how to handle
+ * data corruption in tables, you can disable this behaviour and handle it
+ * outside of this class, e.g. through a nightly system task with extended logging capabilities.
+ */
+ static $check_and_repair_on_build = true;
+
/**
* If this is false, then information about database operations
* will be displayed, eg creation of tables.
@@ -275,7 +283,7 @@ function requireTable($table, $fieldSchema = null, $indexSchema = null, $hasAuto
$this->transCreateTable($table, $options, $extensions);
$this->alterationMessage("Table $table: created","created");
} else {
- $this->checkAndRepairTable($table, $options);
+ if(self::$check_and_repair_on_build) $this->checkAndRepairTable($table, $options);
// Check if options changed
$tableOptionsChanged = false;

0 comments on commit ce95041

Please sign in to comment.