Open Schniz opened 8 years ago
As @danielmewes replied on Twitter, since 2.2 we can query the index functions
rethink-migrate seed-db
is an option too. lets say you have this structure:
- migrations/
- 20150301163012_some_migration.js
- seed/
- users.json
- products.json
and then when migrating just r.table(tableName).insert(require(tableName+".json"))
for every json
file
this will help you speed up testing:
create-db
commandseed-db
commandI used some bash and node scripts for it. but we can put all these scripts into this package.
The first thing I built was actually a tool to generate a RethinkDB from a schema, with seed and all. Then I realised that it would be more powerful to make a migration tool so that the db can be handled after first release as well.
To your point though, a quick gen tool could be useful but I think this would be better implemented as helper methods on top of the regular API.
Right now the main focus is to tweak it so that rethinkdb-dash can be used and test for generation in clusters. But after that, I'll look at your suggestions :smile:
Will you accept a pull request providing these features?
I will accept any good pull request as long as it doesn't muddle up the api och generalize the package too much :smile:
Submit it and I'll look at it as soon as I can - I'm currently trying to fix migrations using rethinkdbdash and clusters but I can hopefully find som time during the weekend.
Thanks!
hey man! love this one! I think that creating a
_schema.json
file to just create the DB as is (instead of creating and running every step) can be a great feature. then, callingrethink-migrate create-db
or something like Rails' migration can be awesome.