]> git.mxchange.org Git - friendica.git/blobdiff - include/dbstructure.php
Merge pull request #1487 from fabrixxm/projects
[friendica.git] / include / dbstructure.php
index f131abe64f13b489621c85114536ce3b3f6524cd..083255b8ae87ae4baf9ca612ec43c57500006922 100644 (file)
@@ -120,7 +120,7 @@ function print_structure($database) {
        }
 }
 
-function update_structure($verbose, $action) {
+function update_structure($verbose, $action, $tables=null, $definition=null) {
        global $a, $db;
 
        $errors = false;
@@ -130,7 +130,8 @@ function update_structure($verbose, $action) {
        // Get the current structure
        $database = array();
 
-       $tables = q("show tables");
+       if (is_null($tables))
+               $tables = q("show tables");
 
        foreach ($tables AS $table) {
                $table = current($table);
@@ -139,7 +140,8 @@ function update_structure($verbose, $action) {
        }
 
        // Get the definition
-       $definition = db_definition();
+       if (is_null($definition))
+               $definition = db_definition();
 
        // Compare it
        foreach ($definition AS $name => $structure) {
@@ -453,6 +455,7 @@ function db_definition() {
                                        "uri-date" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
                                        "avatar-date" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
                                        "term-date" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
+                                       "last-item" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
                                        "priority" => array("type" => "tinyint(3)", "not null" => "1", "default" => "0"),
                                        "blocked" => array("type" => "tinyint(1)", "not null" => "1", "default" => "1"),
                                        "readonly" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),