Reverse engineer database schema from DBIx::Class

Oliver Gorwits oliver at
Thu Jul 5 22:01:33 BST 2012

On 2012-07-05 10:58, Zbigniew Łukasiak wrote:
> On Thu, Jul 5, 2012 at 11:47 AM, Shantanu Bhadoria 
> <shantanu at> wrote:
>> DBIx::Class. Then in a stupid move I deleted my db by accident and I 
>> am now
>> left with only the schema classes.I didnt really have any data in 
>> the db
>> but is there a way to create a DB schema sql back from DBIx::Class 
>> Result
>> classes?
> Have a look at:

and if you just want the SQL statements printing, something like this 
should work:

perl -I./lib -MDBIx::Class -MMy::Schema -e \
     '$s=My::Schema->connect("dbi:mysql:"); print scalar
      $s->storage->deployment_statements($s, undef, undef, undef,
        {no_comments => 1,
         quote_table_names => 0,
         quote_field_names => 0})'


More information about the mailing list