summaryrefslogtreecommitdiffstats
path: root/Bugzilla/DB/Schema.pm
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2006-11-19 00:10:11 +0100
committermkanat%bugzilla.org <>2006-11-19 00:10:11 +0100
commit496a78f616b10c1c5c4bd0398021232e9bffa77e (patch)
treefd30d0e1fc1c7789111d43ef5d7ce7dd31baa7de /Bugzilla/DB/Schema.pm
parentb8012210e03800d6473d2b19d7cf1beae6d12dc3 (diff)
downloadbugzilla-496a78f616b10c1c5c4bd0398021232e9bffa77e.tar.gz
bugzilla-496a78f616b10c1c5c4bd0398021232e9bffa77e.tar.xz
Bug 304550: Bugzilla should always store data in MySQL as UTF-8
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=justdave
Diffstat (limited to 'Bugzilla/DB/Schema.pm')
-rw-r--r--Bugzilla/DB/Schema.pm23
1 files changed, 20 insertions, 3 deletions
diff --git a/Bugzilla/DB/Schema.pm b/Bugzilla/DB/Schema.pm
index 6846691e2..c2c884e6d 100644
--- a/Bugzilla/DB/Schema.pm
+++ b/Bugzilla/DB/Schema.pm
@@ -1302,7 +1302,7 @@ sub get_type_ddl {
}
my $fkref = $self->{enable_references} ? $finfo->{REFERENCES} : undef;
- my $type_ddl = $self->{db_specific}{$type} || $type;
+ my $type_ddl = $self->convert_type($type);
# DEFAULT attribute must appear before any column constraints
# (e.g., NOT NULL), for Oracle
$type_ddl .= " DEFAULT $default" if (defined($default));
@@ -1313,7 +1313,19 @@ sub get_type_ddl {
return($type_ddl);
} #eosub--get_type_ddl
-#--------------------------------------------------------------------------
+
+sub convert_type {
+
+=item C<convert_type>
+
+Converts a TYPE from the L</ABSTRACT_SCHEMA> format into the real SQL type.
+
+=cut
+
+ my ($self, $type) = @_;
+ return $self->{db_specific}->{$type} || $type;
+}
+
sub get_column {
=item C<get_column($table, $column)>
@@ -1383,7 +1395,12 @@ sub get_table_columns {
return @columns;
} #eosub--get_table_columns
-#--------------------------------------------------------------------------
+
+sub get_create_database_sql {
+ my ($self, $name) = @_;
+ return ("CREATE DATABASE $name");
+}
+
sub get_table_ddl {
=item C<get_table_ddl>