package SQL::Translator::Generator::DDL::SQLServer;
-# AUTHOR: Arthur Axel fREW Schmidt
-# Copyright: Same as Perl 5
+=head1 NAME
+
+SQL::Translator::Generator::DDL::SQLServer - A Moo based MS SQL Server DDL
+generation engine.
+
+=head1 DESCRIPTION
+
+I<documentation volunteers needed>
+
+=cut
use Moo;
-use SQL::Translator::Generator::Utils;
use SQL::Translator::Schema::Constants;
with 'SQL::Translator::Generator::Role::Quote';
'CREATE UNIQUE NONCLUSTERED INDEX ' .
$self->unique_constraint_name($constraint) .
' ON ' . $self->quote($constraint->table->name) . ' (' .
- join( ', ', $constraint->fields ) . ')' .
+ join( ', ', map $self->quote($_), $constraint->fields ) . ')' .
' WHERE ' . join( ' AND ',
map $self->quote($_->name) . ' IS NOT NULL',
grep { $_->is_nullable } $constraint->fields ) . ';'
return (
'CONSTRAINT ' . $self->enum_constraint_name($field_name) .
' CHECK (' . $self->quote($field_name) .
- ' IN (' . join( ',', map qq('$_'), @$vals ) . '))'
+ ' IN (' . join( ',', map $self->quote_string($_), @$vals ) . '))'
)
}
}
sub drop_tables {
- my ($self, $schema) = shift;
+ my ($self, $schema) = @_;
if ($self->add_drop_table) {
my @tables = sort { $b->order <=> $a->order } $schema->get_tables;
1;
+=head1 AUTHORS
+
+See the included AUTHORS file:
+L<http://search.cpan.org/dist/SQL-Translator/AUTHORS>
+
+=head1 COPYRIGHT
+
+Copyright (c) 2012 the SQL::Translator L</AUTHORS> as listed above.
+
+=head1 LICENSE
+
+This code is free software and may be distributed under the same terms as Perl
+itself.
+
+=cut