BlueHotDog / sails-migrations

The missing, migrations, arm of the octopus
MIT License
158 stars 37 forks source link

Auto-generate migrations for models #57

Open kevinob11 opened 9 years ago

kevinob11 commented 9 years ago

A new feature that I think might be useful for sails migrations:

The ability to auto-generate a migration based on a model file. It wouldn't consistently auto-generate migrations for changes, as this seems like it would be difficult and require managing state. The thought is more of a one-time per model time saver. You define your model then call: sails-migrations generate:model [name of model] It then parses the model file and creates a migration file based on that model. It doesn't have to parse everything in attributes, if there is some non-standard or in-depth attribute we can just rely on the user updating the migration file to handle that attribute. In my mind the low hanging fruit are:

I'm happy to take a hack at it, but it will just be weekend time which itself is a bit limited right now for me.

BlueHotDog commented 9 years ago

Hmm, sounds really cool, And not that hard, no actual parsing is probably needed since we actually load sails, so you can access all the models easily.

I've no idea when i'll have some free time to work at it.. a lot on my plate right now.

RWOverdijk commented 8 years ago

Still open for PRs though :D