phpBB

Code Changes

File: phpbb/db/tools.php

  Unmodified   Added   Modified   Removed
Line 1531Line 1531
					{
$sql .= ' COLLATE utf8_unicode_ci';
}

					{
$sql .= ' COLLATE utf8_unicode_ci';
}

 
				}

if (isset($column_data['after']))
{
$return_array['after'] = $column_data['after'];

				}

break;

				}

break;

Line 1571Line 1576
					$default_val = "'" . $column_data[1] . "'";
$return_array['null'] = 'NOT NULL';
$sql .= 'NOT NULL ';

					$default_val = "'" . $column_data[1] . "'";
$return_array['null'] = 'NOT NULL';
$sql .= 'NOT NULL ';

 
				}
else
{
// Integers need to have 0 instead of empty string as default
if (strpos($column_type, 'INT') === 0)
{
$default_val = '0';

				}
else
{
$default_val = "'" . $column_data[1] . "'";

				}
else
{
$default_val = "'" . $column_data[1] . "'";

 
					}

					$return_array['null'] = 'NULL';
$sql .= 'NULL ';
}

					$return_array['null'] = 'NULL';
$sql .= 'NULL ';
}

Line 2175Line 2188
				}
// no break
case 'mysql_41':

				}
// no break
case 'mysql_41':

				$statements[] = 'ALTER TABLE ' . $table_name . ' ADD INDEX ' . $index_name . '(' . implode(', ', $column) . ')';

				$statements[] = 'ALTER TABLE ' . $table_name . ' ADD INDEX ' . $index_name . ' (' . implode(', ', $column) . ')';

			break;

case 'mssql':

			break;

case 'mssql':

Line 2327Line 2340
				if (!empty($column_data['default']))
{
// Add new default value constraint

				if (!empty($column_data['default']))
{
// Add new default value constraint

					$statements[] = 'ALTER TABLE [' . $table_name . '] ADD CONSTRAINT [DF_' . $table_name . '_' . $column_name . '_1] ' . $this->db->sql_escape($column_data['default']) . ' FOR [' . $column_name . ']';

					$statements[] = 'ALTER TABLE [' . $table_name . '] ADD CONSTRAINT [DF_' . $table_name . '_' . $column_name . '_1] ' . $column_data['default'] . ' FOR [' . $column_name . ']';

				}

if (!empty($indexes))

				}

if (!empty($indexes))