-- ------------------------------------------
-- Friendica 3.5.2-dev (Asparagus)
- -- DB_UPDATE_VERSION 1215
+ -- DB_UPDATE_VERSION 1218
-- ------------------------------------------
`plugin_admin` tinyint(1) NOT NULL DEFAULT 0,
PRIMARY KEY(`id`),
UNIQUE INDEX `name` (`name`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE attach
`deny_cid` mediumtext,
`deny_gid` mediumtext,
PRIMARY KEY(`id`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE auth_codes
`expires` int(11) NOT NULL DEFAULT 0,
`scope` varchar(250) NOT NULL DEFAULT '',
PRIMARY KEY(`id`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE cache
`updated` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
PRIMARY KEY(`k`),
INDEX `expire_mode_updated` (`expire_mode`,`updated`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE challenge
`type` varchar(255) NOT NULL DEFAULT '',
`last_update` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY(`id`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE clients
`icon` text,
`uid` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY(`client_id`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE config
`v` mediumtext,
PRIMARY KEY(`id`),
UNIQUE INDEX `cat_k` (`cat`,`k`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE contact
`writable` tinyint(1) NOT NULL DEFAULT 0,
`forum` tinyint(1) NOT NULL DEFAULT 0,
`prv` tinyint(1) NOT NULL DEFAULT 0,
- `contact-type` int(11) unsigned NOT NULL DEFAULT 0,
+ `contact-type` int(11) NOT NULL DEFAULT 0,
`hidden` tinyint(1) NOT NULL DEFAULT 0,
`archive` tinyint(1) NOT NULL DEFAULT 0,
`pending` tinyint(1) NOT NULL DEFAULT 1,
`info` mediumtext,
`profile-id` int(11) NOT NULL DEFAULT 0,
`bdyear` varchar(4) NOT NULL DEFAULT '',
- `bd` date NOT NULL DEFAULT '0000-00-00',
+ `bd` date NOT NULL DEFAULT '0001-01-01',
`notify_new_posts` tinyint(1) NOT NULL DEFAULT 0,
`fetch_further_information` tinyint(1) NOT NULL DEFAULT 0,
`ffi_keyword_blacklist` text,
INDEX `nick_uid` (`nick`(32),`uid`),
INDEX `dfrn-id` (`dfrn-id`),
INDEX `issued-id` (`issued-id`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE conv
`subject` text,
PRIMARY KEY(`id`),
INDEX `uid` (`uid`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE event
`deny_gid` mediumtext,
PRIMARY KEY(`id`),
INDEX `uid_start` (`uid`,`start`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE fcontact
PRIMARY KEY(`id`),
INDEX `addr` (`addr`(32)),
INDEX `url` (`url`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE ffinder
`cid` int(10) unsigned NOT NULL DEFAULT 0,
`fid` int(10) unsigned NOT NULL DEFAULT 0,
PRIMARY KEY(`id`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE fserver
`key` text,
PRIMARY KEY(`id`),
INDEX `server` (`server`(32))
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE fsuggest
`note` text,
`created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
PRIMARY KEY(`id`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE gcign
PRIMARY KEY(`id`),
INDEX `uid` (`uid`),
INDEX `gcid` (`gcid`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE gcontact
`about` text,
`keywords` text,
`gender` varchar(32) NOT NULL DEFAULT '',
- `birthday` varchar(32) NOT NULL DEFAULT '0000-00-00',
+ `birthday` varchar(32) NOT NULL DEFAULT '0001-01-01',
`community` tinyint(1) NOT NULL DEFAULT 0,
`contact-type` tinyint(1) NOT NULL DEFAULT -1,
`hide` tinyint(1) NOT NULL DEFAULT 0,
INDEX `addr` (`addr`(64)),
INDEX `hide_network_updated` (`hide`,`network`,`updated`),
INDEX `updated` (`updated`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE glink
PRIMARY KEY(`id`),
UNIQUE INDEX `cid_uid_gcid_zcid` (`cid`,`uid`,`gcid`,`zcid`),
INDEX `gcid` (`gcid`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE group
`name` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY(`id`),
INDEX `uid` (`uid`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE group_member
INDEX `contactid` (`contact-id`),
INDEX `gid_contactid` (`gid`,`contact-id`),
UNIQUE INDEX `uid_gid_contactid` (`uid`,`gid`,`contact-id`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE gserver
`last_failure` datetime DEFAULT '0001-01-01 00:00:00',
PRIMARY KEY(`id`),
INDEX `nurl` (`nurl`(32))
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE hook
`priority` int(11) unsigned NOT NULL DEFAULT 0,
PRIMARY KEY(`id`),
UNIQUE INDEX `hook_file_function` (`hook`(50),`file`(80),`function`(60))
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE intro
`blocked` tinyint(1) NOT NULL DEFAULT 1,
`ignore` tinyint(1) NOT NULL DEFAULT 0,
PRIMARY KEY(`id`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE item
INDEX `uid_eventid` (`uid`,`event-id`),
INDEX `uid_authorlink` (`uid`,`author-link`),
INDEX `uid_ownerlink` (`uid`,`owner-link`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE item_id
INDEX `sid` (`sid`),
INDEX `service` (`service`(32)),
INDEX `iid` (`iid`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE locks
`locked` tinyint(1) NOT NULL DEFAULT 0,
`created` datetime DEFAULT '0001-01-01 00:00:00',
PRIMARY KEY(`id`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE mail
INDEX `convid` (`convid`),
INDEX `uri` (`uri`(64)),
INDEX `parent-uri` (`parent-uri`(64))
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE mailacct
`pubmail` tinyint(1) NOT NULL DEFAULT 0,
`last_check` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
PRIMARY KEY(`id`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE manage
`mid` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY(`id`),
UNIQUE INDEX `uid_mid` (`uid`,`mid`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE notify
INDEX `seen_uid_date` (`seen`,`uid`,`date`),
INDEX `uid_date` (`uid`,`date`),
INDEX `uid_type_link` (`uid`,`type`,`link`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE notify-threads
`parent-item` int(10) unsigned NOT NULL DEFAULT 0,
`receiver-uid` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY(`id`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE oembed
`created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
PRIMARY KEY(`url`),
INDEX `created` (`created`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE parsed_url
`created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
PRIMARY KEY(`url`,`guessing`,`oembed`),
INDEX `created` (`created`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE pconfig
`v` mediumtext,
PRIMARY KEY(`id`),
UNIQUE INDEX `uid_cat_k` (`uid`,`cat`,`k`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE photo
INDEX `uid_album_scale_created` (`uid`,`album`(32),`scale`,`created`),
INDEX `uid_album_resource-id_created` (`uid`,`album`(32),`resource-id`(64),`created`),
INDEX `resource-id` (`resource-id`(64))
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE poll
`q9` text,
PRIMARY KEY(`id`),
INDEX `uid` (`uid`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE poll_result
PRIMARY KEY(`id`),
INDEX `poll_id` (`poll_id`),
INDEX `choice` (`choice`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE process
`created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
PRIMARY KEY(`pid`),
INDEX `command` (`command`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE profile
`hide-friends` tinyint(1) NOT NULL DEFAULT 0,
`name` varchar(255) NOT NULL DEFAULT '',
`pdesc` varchar(255) NOT NULL DEFAULT '',
- `dob` varchar(32) NOT NULL DEFAULT '0000-00-00',
+ `dob` varchar(32) NOT NULL DEFAULT '0001-01-01',
`address` varchar(255) NOT NULL DEFAULT '',
`locality` varchar(255) NOT NULL DEFAULT '',
`region` varchar(255) NOT NULL DEFAULT '',
`net-publish` tinyint(1) NOT NULL DEFAULT 0,
PRIMARY KEY(`id`),
INDEX `uid_is-default` (`uid`,`is-default`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE profile_check
`sec` varchar(255) NOT NULL DEFAULT '',
`expire` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY(`id`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE push_subscriber
`last_update` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
`secret` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY(`id`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE queue
INDEX `last` (`last`),
INDEX `network` (`network`),
INDEX `batch` (`batch`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE register
`language` varchar(16) NOT NULL DEFAULT '',
`note` text,
PRIMARY KEY(`id`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE search
`term` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY(`id`),
INDEX `uid` (`uid`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE session
PRIMARY KEY(`id`),
INDEX `sid` (`sid`(64)),
INDEX `expire` (`expire`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE sign
`signer` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY(`id`),
INDEX `iid` (`iid`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE spam
INDEX `spam` (`spam`),
INDEX `ham` (`ham`),
INDEX `term` (`term`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE term
INDEX `uid_otype_type_term_global_created` (`uid`,`otype`,`type`,`term`(32),`global`,`created`),
INDEX `uid_otype_type_url` (`uid`,`otype`,`type`,`url`(64)),
INDEX `guid` (`guid`(64))
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE thread
INDEX `uid_created` (`uid`,`created`),
INDEX `uid_commented` (`uid`,`commented`),
INDEX `uid_wall_created` (`uid`,`wall`,`created`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE tokens
`scope` varchar(200) NOT NULL DEFAULT '',
`uid` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY(`id`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE user
`openidserver` text,
PRIMARY KEY(`uid`),
INDEX `nickname` (`nickname`(32))
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE userd
`username` varchar(255) NOT NULL,
PRIMARY KEY(`id`),
INDEX `username` (`username`(32))
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE workerqueue
`pid` int(11) NOT NULL DEFAULT 0,
`executed` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
PRIMARY KEY(`id`)
- ) DEFAULT CHARSET=utf8mb4;
+ ) DEFAULT COLLATE utf8mb4_general_ci;
function table_structure($table) {
$structures = q("DESCRIBE `%s`", $table);
+ $full_columns = q("SHOW FULL COLUMNS FROM `%s`", $table);
+
$indexes = q("SHOW INDEX FROM `%s`", $table);
+ $table_status = q("SHOW TABLE STATUS WHERE `name` = '%s'", $table);
+
+ if (dbm::is_result($table_status)) {
+ $table_status = $table_status[0];
+ } else {
+ $table_status = array();
+ }
+
$fielddata = array();
$indexdata = array();
$indexdata[$index["Key_name"]][] = $column;
}
-
if (dbm::is_result($structures)) {
foreach ($structures AS $field) {
$fielddata[$field["Field"]]["type"] = $field["Type"];
}
}
}
- return(array("fields"=>$fielddata, "indexes"=>$indexdata));
+ if (dbm::is_result($full_columns)) {
+ foreach ($full_columns AS $column) {
+ $fielddata[$column["Field"]]["Collation"] = $column["Collation"];
+ }
+ }
+
+ return array("fields" => $fielddata, "indexes" => $indexdata, "table_status" => $table_status);
}
- function print_structure($database, $charset) {
+ function print_structure($database) {
echo "-- ------------------------------------------\n";
echo "-- ".FRIENDICA_PLATFORM." ".FRIENDICA_VERSION." (".FRIENDICA_CODENAME,")\n";
echo "-- DB_UPDATE_VERSION ".DB_UPDATE_VERSION."\n";
echo "--\n";
echo "-- TABLE $name\n";
echo "--\n";
- db_create_table($name, $structure['fields'], $charset, true, false, $structure["indexes"]);
+ db_create_table($name, $structure['fields'], true, false, $structure["indexes"]);
echo "\n";
}
if ($action) {
Config::set('system', 'maintenance', 1);
- Config::set('system', 'maintenance_reason', 'Database update');
- }
-
- if (isset($a->config["system"]["db_charset"])) {
- $charset = $a->config["system"]["db_charset"];
- } else {
- $charset = "utf8";
+ Config::set('system', 'maintenance_reason', sprintf(t(': Database update'), dbm::date().' '.date('e')));
}
$errors = false;
$tables = q("SHOW TABLES");
}
- foreach ($tables AS $table) {
- $table = current($table);
+ if (dbm::is_result($tables)) {
+ foreach ($tables AS $table) {
+ $table = current($table);
- logger(sprintf('updating structure for table %s ...', $table), LOGGER_DEBUG);
- $database[$table] = table_structure($table);
+ logger(sprintf('updating structure for table %s ...', $table), LOGGER_DEBUG);
+ $database[$table] = table_structure($table);
+ }
}
// Get the definition
if (is_null($definition)) {
- $definition = db_definition($charset);
+ $definition = db_definition();
}
// MySQL >= 5.7.4 doesn't support the IGNORE keyword in ALTER TABLE statements
$group_by = "";
$sql3 = "";
if (!isset($database[$name])) {
- $r = db_create_table($name, $structure["fields"], $charset, $verbose, $action, $structure['indexes']);
+ $r = db_create_table($name, $structure["fields"], $verbose, $action, $structure['indexes']);
if (!dbm::is_result($r)) {
$errors .= t('Errors encountered creating database tables.').$name.EOL;
}
}
} else {
// Compare the field definition
- $current_field_definition = implode(",",$database[$name]["fields"][$fieldname]);
- $new_field_definition = implode(",",$parameters);
+ $field_definition = $database[$name]["fields"][$fieldname];
+
+ // Define the default collation if not given
+ if (!isset($parameters['Collation']) AND !is_null($field_definition['Collation'])) {
+ $parameters['Collation'] = 'utf8mb4_general_ci';
+ } else {
+ $parameters['Collation'] = null;
+ }
+
+ $current_field_definition = implode(",", $field_definition);
+ $new_field_definition = implode(",", $parameters);
if ($current_field_definition != $new_field_definition) {
- $sql2=db_modify_table_field($fieldname, $parameters);
+ $sql2 = db_modify_table_field($fieldname, $parameters);
if ($sql3 == "") {
$sql3 = "ALTER" . $ignore . " TABLE `".$temp_name."` ".$sql2;
} else {
$sql3 .= ", ".$sql2;
}
}
-
}
}
}
$group_by = db_group_by($indexname, $fieldnames);
}
if ($sql2 != "") {
- if ($sql3 == "")
+ if ($sql3 == "") {
$sql3 = "ALTER" . $ignore . " TABLE `".$temp_name."` ".$sql2;
- else
+ } else {
$sql3 .= ", ".$sql2;
+ }
+ }
+ }
+ }
+
+ if (isset($database[$name]["table_status"]["Collation"])) {
+ if ($database[$name]["table_status"]["Collation"] != 'utf8mb4_general_ci') {
+ $sql2 = "DEFAULT COLLATE utf8mb4_general_ci";
+
+ if ($sql3 == "") {
+ $sql3 = "ALTER" . $ignore . " TABLE `".$temp_name."` ".$sql2;
+ } else {
+ $sql3 .= ", ".$sql2;
}
}
}
}
if ($action) {
+ Config::set('system', 'maintenance_reason', sprintf(t('%s: updating %s table.'), dbm::date().' '.date('e'), $name));
+
// Ensure index conversion to unique removes duplicates
if ($is_unique) {
if ($ignore != "") {
function db_field_command($parameters, $create = true) {
$fieldstruct = $parameters["type"];
+ if (!is_null($parameters["Collation"])) {
+ $fieldstruct .= " COLLATE ".$parameters["Collation"];
+ }
+
if ($parameters["not null"])
$fieldstruct .= " NOT NULL";
return($fieldstruct);
}
- function db_create_table($name, $fields, $charset, $verbose, $action, $indexes=null) {
+ function db_create_table($name, $fields, $verbose, $action, $indexes=null) {
global $a, $db;
$r = true;
$sql = implode(",\n\t", $sql_rows);
- $sql = sprintf("CREATE TABLE IF NOT EXISTS `%s` (\n\t", dbesc($name)).$sql."\n) DEFAULT CHARSET=".$charset;
+ $sql = sprintf("CREATE TABLE IF NOT EXISTS `%s` (\n\t", dbesc($name)).$sql."\n) DEFAULT COLLATE utf8mb4_general_ci";
if ($verbose)
echo $sql.";\n";
return $sql;
}
- function db_index_suffix($charset, $reduce = 0) {
- if ($charset != "utf8mb4") {
- return "";
- }
-
- // On utf8mb4 indexes can only have a length of 191
- $indexlength = 191 - $reduce;
-
- return "(".$indexlength.")";
- }
-
- function db_definition($charset) {
+ function db_definition() {
$database = array();
"writable" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"forum" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"prv" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
- "contact-type" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0"),
+ "contact-type" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"hidden" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"archive" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"pending" => array("type" => "tinyint(1)", "not null" => "1", "default" => "1"),
"info" => array("type" => "mediumtext"),
"profile-id" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"bdyear" => array("type" => "varchar(4)", "not null" => "1", "default" => ""),
- "bd" => array("type" => "date", "not null" => "1", "default" => "0000-00-00"),
+ "bd" => array("type" => "date", "not null" => "1", "default" => "0001-01-01"),
"notify_new_posts" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"fetch_further_information" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"ffi_keyword_blacklist" => array("type" => "text"),
"about" => array("type" => "text"),
"keywords" => array("type" => "text"),
"gender" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
- "birthday" => array("type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00"),
+ "birthday" => array("type" => "varchar(32)", "not null" => "1", "default" => "0001-01-01"),
"community" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"contact-type" => array("type" => "tinyint(1)", "not null" => "1", "default" => "-1"),
"hide" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"hide-friends" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"pdesc" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
- "dob" => array("type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00"),
+ "dob" => array("type" => "varchar(32)", "not null" => "1", "default" => "0001-01-01"),
"address" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"locality" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"region" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
set_config('system','build',DB_UPDATE_VERSION);
return;
case "dumpsql":
- // For the dump that is used to create the database.sql we always assume utfmb4
- $charset = "utf8mb4";
- print_structure(db_definition($charset), $charset);
+ print_structure(db_definition());
return;
}
}