[DBIx-Class-Devel] [sql-translator] Topic/producer postgresql batch alter table (#44)

Dagfinn Ilmari Mannsåker notifications at github.com
Fri Aug 22 14:32:45 GMT 2014


> +
> +my $table = $target_sqlt->get_table('fluff');
> +$table->extra( renamed_from => 'foo' );
> +my $field = $table->get_field('biff');
> +$field->extra( renamed_from => 'bar' );
> +
> +my @diff = SQL::Translator::Diff->new({
> +    output_db => 'PostgreSQL',
> +    source_schema => $source_sqlt,
> +    target_schema => $target_sqlt,
> +})->compute_differences->produce_diff_sql;
> +
> +foreach my $line (@diff) {
> +    $line =~ s/\n//g;
> +    next if $line =~ /^--/;
> +    lives_ok { $dbh->do($line) || die } "$line";

Instead of `lives_ok { … || die }`, set `RaiseError` (preferrably) or just use `ok( … )`.  

---
Reply to this email directly or view it on GitHub:
https://github.com/dbsrgits/sql-translator/pull/44/files#r16600503
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/dbix-class-devel/attachments/20140822/244efcd9/attachment.htm>


More information about the DBIx-Class-Devel mailing list