I store the schema as SQL instead of the .rb file nightmare. Here's the script to do it quickly with Postgres & bypass the Rake slowness:
#!/bin/bash
root="/path/to/your/code"
user='postgres'
db='dev'
schema="$root/db/schema.sql"
pg_dump -U $user $db \
--schema=public \
--schema-only \
--no-owner \
--no-privileges \
--file $schema
pg_dump -U $user $db \
--table public.schema_migrations \
--no-owner \
--data-only \
--insert \
>> $schema
Then a trivial `dropdb`, `createdb`, `psql < db/schema.sql`And then a small script with 4 or 5 curl calls can get enough data into the database to drive some tests.