[Dbix-class] Dumping fixtures and loading in test script
Adam Witney
awitney at sgul.ac.uk
Mon Nov 11 19:22:00 GMT 2013
> On 11 Nov 2013, at 16:05, Rob Kinyon <rob.kinyon at gmail.com> wrote:
>
>> On Mon, Nov 11, 2013 at 10:48 AM, Adam Witney <awitney at sgul.ac.uk> wrote:
>>
>> Thanks again for your email Rob,
>>
>> Just to clarify from looking at the docs again, I would have to edit all my
>> Result classes to add sim information, right? Wouldn't this break every time
>> I refreshed the schema from the database (./script/xxx_create.pl model DB
>> ... etc)?
>
> This is correct, assuming you're refreshing your schema from your
> database. I would **STRONGLY** urge you to never do this. Your schema
> files should be considered the source of truth, not your database.
That's an interesting point of view. I tend to make my database changes directly with SQL and when I am ready regenerate the schema files from there.
One other question, when you used your $schema object, where do you put your connection information, to avoid having it in every single test script?
Thanks again
Adam
More information about the DBIx-Class
mailing list