=over 4
-=item field.list
+=item B<field.list>
Set the list of allowed values for Enum fields.
-=item field.binary, field.unsigned, field.zerofill
+=item B<field.binary>, B<field.unsigned>, B<field.zerofill>
Set the MySQL field options of the same name.
-=item field.renamed_from
+=item B<field.renamed_from>, B<table.renamed_from>
-Used when producing diffs to say this column is the new name fo the specified
-old column.
+Use when producing diffs to indicate that the current table/field has been
+renamed from the old name as given in the attribute value.
-=item table.mysql_table_type
+=item B<table.mysql_table_type>
Set the type of the table e.g. 'InnoDB', 'MyISAM'. This will be
automatically set for tables involved in foreign key constraints if it is
not already set explicitly. See L<"Table Types">.
-=item table.mysql_charset, table.mysql_collate
+Please note that the C<ENGINE> option is the prefered method of specifying
+the MySQL storage engine to use, but this method still works for backwards
+compatability.
+
+=item B<table.mysql_charset>, B<table.mysql_collate>
Set the tables default charater set and collation order.
-=item field.mysql_charset, field.mysql_collate
+=item B<field.mysql_charset>, B<field.mysql_collate>
Set the fields charater set and collation order.
my $qc = $options->{quote_constraint_names} || '';
my $out = sprintf('ALTER TABLE %s DROP %s %s',
- $c->table->name,
+ $qt . $c->table->name . $qt,
$c->type eq FOREIGN_KEY ? $c->type : "INDEX",
$qc . $c->name . $qc );
my $qf = $options->{quote_field_names} || '';
my $qt = $options->{quote_table_names} || '';
+ my $qc = $options->{quote_constraint_names} || '';
my $leave_name = $options->{leave_name} || undef;
my @fields = $c->fields or next;
my $def = join(' ',
map { $_ || () }
'CONSTRAINT',
- $qt . $c_name . $qt,
+ $qc . $c_name . $qc,
'FOREIGN KEY'
);
{
my ($to_table, $options) = @_;
- my $qt = $options->{quote_table_name} || '';
+ my $qt = $options->{quote_table_names} || '';
my $table_options = generate_table_options($to_table) || '';
my $out = sprintf('ALTER TABLE %s%s',
{
my ($from_field, $to_field, $options) = @_;
- my $qf = $options->{quote_field_name} || '';
- my $qt = $options->{quote_table_name} || '';
+ my $qf = $options->{quote_field_names} || '';
+ my $qt = $options->{quote_table_names} || '';
my $out = sprintf('ALTER TABLE %s CHANGE COLUMN %s %s',
$qt . $to_field->table->name . $qt,
{
my ($new_field, $options) = @_;
- my $qt = $options->{quote_table_name} || '';
+ my $qt = $options->{quote_table_names} || '';
my $out = sprintf('ALTER TABLE %s ADD COLUMN %s',
$qt . $new_field->table->name . $qt,
{
my ($old_field, $options) = @_;
- my $qf = $options->{quote_field_name} || '';
- my $qt = $options->{quote_table_name} || '';
+ my $qf = $options->{quote_field_names} || '';
+ my $qt = $options->{quote_table_names} || '';
my $out = sprintf('ALTER TABLE %s DROP COLUMN %s',
$qt . $old_field->table->name . $qt,
# Now strip off the 'ALTER TABLE xyz' of all but the first one
- my $qt = $options->{quote_table_name} || '';
+ my $qt = $options->{quote_table_names} || '';
my $table_name = $qt . $table->name . $qt;