Getting the schema for a DB table
domm at cpan.org
Sun May 25 18:38:54 BST 2014
On Sun, May 25, 2014 at 05:46:45PM +0100, Simon Wistow wrote:
> Alternatively - what I'm really trying to do is get a unique finger
> print for the schema of a database. My current plan is hashing the
> CREATE TABLE statement but other methods would be gratefully received.
If you want a hash of the current DB schema, take a look at
We use it to automate DB updates (but this will only work for DBs which
can create tables inside a transcation, i.e. Postgres and sqlite, but
neither Oracle nor MySQL).
It also comes with a script, which you could use like this to get the
scs.pl checksum --dsn dbi:Pg:dbname=your_db
To show the data on which the checksum is based:
scs.pl checksum --dsn dbi:Pg:dbname=your_db --show_dum
Not sure if this is what you're after, but I hope it helps..
More information about the london.pm