Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate SQL schema from Perl DBIx::Class files?

Please show me how to generate SQL schema from my Perl DBIx::Class files ?

Basically the reverse of make_schema_at in DBIx::Class::Schema::Loader.

I have already built the Perl schema files, I just wish to recreate the schema in my SQL database.

I can't seem to find examples going from Perl -> SQL.

Many thanks in advance.

like image 316
null Avatar asked Jun 03 '14 12:06

null


1 Answers

I believe you are looking for the deploy and deployment_statements functions in DBIx::Class::Schema.

my $statements = $schema->deployment_statements;
print "$statements\n";
like image 122
AKHolland Avatar answered Nov 01 '22 10:11

AKHolland