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))

Line 2643Line 2656
							AND cols.id = ix.id
WHERE ix.id = object_id('{$table_name}')
AND cols.name = '{$column_name}'

							AND cols.id = ix.id
WHERE ix.id = object_id('{$table_name}')
AND cols.name = '{$column_name}'

						AND INDEXPROPERTY(ix.id, ix.name, 'IsUnique') = " . ($unique) ? '1' : '0';

						AND INDEXPROPERTY(ix.id, ix.name, 'IsUnique') = " . ($unique ? '1' : '0');

				}
else
{

				}
else
{

Line 2657Line 2670
							AND cols.object_id = ix.object_id
WHERE ix.object_id = object_id('{$table_name}')
AND cols.name = '{$column_name}'

							AND cols.object_id = ix.object_id
WHERE ix.object_id = object_id('{$table_name}')
AND cols.name = '{$column_name}'

						AND ix.is_unique = " . ($unique) ? '1' : '0';

						AND ix.is_unique = " . ($unique ? '1' : '0');

				}
break;


				}
break;