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.

Miller
  • 34,962
  • 4
  • 39
  • 60
null
  • 889
  • 1
  • 13
  • 24

1 Answers1

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";
null
  • 889
  • 1
  • 13
  • 24
AKHolland
  • 4,435
  • 23
  • 35