Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: DBIx::Class Randomise datbase primary keys for testing.

by afoken (Chancellor)
on Nov 24, 2010 at 14:04 UTC ( [id://873447]=note: print w/replies, xml ) Need Help??


in reply to Re: DBIx::Class Randomise datbase primary keys for testing.
in thread DBIx::Class Randomise datbase primary keys for testing.

If one creates a complete database scheme just for testing, as done in the original post, inserting a random number of dummy records into each of the tables could be sufficient. On a RDBMS with real sequences (like Oracle), creating the sequences in a way that they start at a random number should give a similar effect.

A different approach, again needing sequences, would be to use a single sequence to generate all IDs, at least for the test database. That would reliably detect that special problem of using IDs from a wrong table.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
  • Comment on Re^2: DBIx::Class Randomise datbase primary keys for testing.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://873447]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-25 19:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found