package SQL::Translator::Generator::Role::DDL;
use Moo::Role;
+use SQL::Translator::Utils qw(header_comment);
requires '_build_shim';
requires '_build_type_map';
sub nullable { 'NULL' }
+sub header_comments { header_comment() . "\n" if $_[0]->add_comments }
+
1;
our $VERSION = '1.59';
$DEBUG = 1 unless defined $DEBUG;
-use Data::Dumper;
use SQL::Translator::Schema::Constants;
use SQL::Translator::Utils qw(debug header_comment);
use SQL::Translator::Generator::DDL::SQLServer;
my $add_drop_table = $translator->add_drop_table;
my $schema = $translator->schema;
- my $output;
- $output .= header_comment."\n" unless ($no_comments);
+ my $output = $future->header_comments;
+ $output .= $future->drop_tables($schema);
- # Generate the DROP statements.
- $output .= $future->drop_tables;
-
- # these need to be added separately, as tables may not exist yet
my @foreign_constraints = ();
for my $table ( grep { $_->name } $schema->get_tables ) {