1
1
Fork 0

The creation of unique keys failed for MariaDB

This commit is contained in:
Michael Vogel 2016-10-09 07:01:19 +00:00
parent a1c63994d2
commit 4404bf1651
3 changed files with 6 additions and 5 deletions

View file

@ -38,7 +38,7 @@ define ( 'FRIENDICA_PLATFORM', 'Friendica');
define ( 'FRIENDICA_CODENAME', 'Asparagus');
define ( 'FRIENDICA_VERSION', '3.5.1-dev' );
define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
define ( 'DB_UPDATE_VERSION', 1205 );
define ( 'DB_UPDATE_VERSION', 1206 );
/**
* @brief Constant with a HTML line break.

View file

@ -166,7 +166,8 @@ function update_structure($verbose, $action, $tables=null, $definition=null) {
@$db->q($sql_config);
// MySQL >= 5.7.4 doesn't support the IGNORE keyword in ALTER TABLE statements
if (version_compare($db->server_info(), '5.7.4') >= 0) {
if ((version_compare($db->server_info(), '5.7.4') >= 0) AND
!(strpos($db->server_info(), 'MariaDB') !== false)) {
$ignore = '';
}else {
$ignore = ' IGNORE';
@ -196,7 +197,7 @@ function update_structure($verbose, $action, $tables=null, $definition=null) {
if ($current_index_definition != $new_index_definition && substr($indexname, 0, 6) != 'local_') {
$sql2=db_drop_index($indexname);
if ($sql3 == "")
$sql3 = "ALTER TABLE `".$name."` ".$sql2;
$sql3 = "ALTER".$ignore." TABLE `".$name."` ".$sql2;
else
$sql3 .= ", ".$sql2;
}

View file

@ -1,6 +1,6 @@
<?php
define('UPDATE_VERSION' , 1205);
define('UPDATE_VERSION' , 1206);
/**
*