commit 338f73dde58e191472f8dd4b26690f092240e5bf
parent f41ac71f4b123de694cc095a8548d1489b774911
Author: Jan Dankert <devnull@localhost>
Date: Fri, 7 Sep 2018 22:38:35 +0200
Datenbank-Version 17 mit Gültigkeitszeitraum für alle Objekte. Eine UI gibt es dafür noch nicht.
Diffstat:
2 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/modules/database-update/DbUpdate.class.php b/modules/database-update/DbUpdate.class.php
@@ -2,7 +2,7 @@
use database\Database;
-define('OR_DB_SUPPORTED_VERSION' ,16);
+define('OR_DB_SUPPORTED_VERSION' ,17);
define('OR_DB_STATUS_UPDATE_PROGRESS', 0);
define('OR_DB_STATUS_UPDATE_SUCCESS' , 1);
@@ -83,7 +83,7 @@ SQL
,$db->id);
$countErrors = $sql->getOne();
if ( $countErrors > 0 )
- throw new \LogicException('Database error','there are dirty versions (means: versions with status 0), see table VERSION for details.');
+ throw new \LogicException('Database error: There are dirty versions (means: versions with status 0), see table VERSION for details.');
// Aktuelle Version ermitteln.
$sql = $db->sql(<<<SQL
diff --git a/modules/database-update/update/DBVersion000017.class.php b/modules/database-update/update/DBVersion000017.class.php
@@ -0,0 +1,23 @@
+<?php
+
+use database\DbVersion;
+use security\Password;
+
+/**
+ * Objects gets new columns for storing valid-dates.
+ *
+ * @author dankert
+ *
+ */
+class DBVersion000017 extends DbVersion
+{
+ /**
+ *
+ */
+ public function update()
+ {
+ $this->addColumn('object','valid_from',OR_DB_COLUMN_TYPE_INT,0,null,OR_DB_COLUMN_NULLABLE);
+ $this->addColumn('object','valid_to' ,OR_DB_COLUMN_TYPE_INT,0,null,OR_DB_COLUMN_NULLABLE);
+ }
+}
+