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

1

6

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.

Parquetry answered 3/6, 2014 at 12:51 Comment(0)
D
5

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

my $statements = $schema->deployment_statements;
print "$statements\n";
Dyadic answered 3/6, 2014 at 13:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.