In one of the apps we support we need to have “realistic demonstration data” for our salespeople to use in demoing and selling.
We currently have a rake task that resets this demo data once a day, however it’s really quite inefficient and slow (it takes about 5 – 10minutes to run through)
There are definitely ways that I could optimise the code which generates the demo data (which I’m planning to do) but I’m thinking that there is probably a better way to do this altogether…
What I’m hoping to do is grab the output of the reset (i.e. grab the raw SQL). I’m hoping with this I can just make a scheduled task which resets the demo data directly to the DB everyday instead of having to load the whole Rails environment and execute a bunch of ruby methods.
This way I can only run the slow task when the nature of the demo data changes (which is quite rare) in order to update my SQL.
Is this the best approach? How can I grab the SQL in a nice format?
It seems to be a good solution! if you have no asset at all simple make a dump a.e. in
mysql
and to restore
here a usefull rake task that you could use.
bye