I tried using https://github.com/building5/sails-db-migrate module for creating migrations but it did not run correctly. Table used to get generated but few columns were missing. Is there a better way to create and run migrations? Sorry i am new to sails, recently migrated from Php.
So, it turn out i was stupid to think we need a module to write migration in sails. It turn out on sails lift the application automatically creates the table from attributes of the model.
But on trying that i realized the waterline module which takes care of this does not create for foreign-key constraints as of now.They are still working on it.
If you are using a nosql db then you can use the associations http://sailsjs.org/#!/documentation/concepts/ORM
Time is pass, but nothing changes with sails. Beware use it. If you already in this trap - try https://www.npmjs.com/package/sails-migrations
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With