]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #1487 from fabrixxm/projects
authorMichael Vogel <icarus@dabo.de>
Mon, 13 Apr 2015 13:47:11 +0000 (15:47 +0200)
committerMichael Vogel <icarus@dabo.de>
Mon, 13 Apr 2015 13:47:11 +0000 (15:47 +0200)
new api dfrn/remoteauth, allow plugins to use update_structure

1  2 
include/dbstructure.php

diff --combined include/dbstructure.php
index d25834edff801bae2b81a6bf98c7519073cc0084,bd33858dad74fca8838d19781bda034435de0637..083255b8ae87ae4baf9ca612ec43c57500006922
@@@ -120,7 -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;
        // 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);
        }
  
        // Get the definition
-       $definition = db_definition();
+       if (is_null($definition))
+               $definition = db_definition();
  
        // Compare it
        foreach ($definition AS $name => $structure) {
@@@ -453,7 -455,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"),