sails-generate-models
sails-generate-models copied to clipboard
Sails v1 MySQL Data Models
I created this fork in order to manage data models for Sails v1. There are some key differences between the original project.
-
I've added data types that v1 now supports.
-
My camel-case handling is a bit different due to how my own project needs were concerned (I have MySQL tables with underscores), so I added and am using a
ucwordsfunction instead of usingucfirst. -
Sails v1 data models formatting has been updated along with some handling of referential data.
I haven't tested this with Sails versions earlier than v1 so I'm not completely sure of backward compatibility....hence why I haven't submitted these changes earlier. Hopefully someone can find it useful...or a stepping stone to something useful.
Thanks!
@jovanross Thanks! Just, fyi, I didn't mention you in a negative way. I hope it didn't sound like that.
If this works well for sails v1 (I'm guessing you mean waterline v1?), I think it could be merged in such a way that the version is a choice you can make on the cli, or a version you can install specifically. (I'll have to take your word for it for now, as I don't use waterline anymore). Once merged, I'll tag this up (I'll have to do some branch magic first).
No, I didn't take anything negatively at all.
I'm not sure if the waterline version is maintained at the same level as sails, but yes, this is for whatever waterline version is compatible with the new sails v1. http://sailsjs.com/documentation/upgrading/to-v-1-0
I'm starting to migrate a large PHP project to sails so I'll probably be active in updating this project over the next year or so at least.
@jovanross I sent you a message on gitter. Are you active there?
Any chance for this being merged in the main branch? Running into an issue now with datastores.js. Will try to implement this on my local install for now though. Thanks
@risingsunomi It can be if it works. It'll need to be a major version bump and the readme needs to be updated accordingly. Also, there appears to be a conflict. If you're willing to make those minimal changes I'd be more than happy to merge this.
Hi, is it possible to use this changes for Sails v1.0 now?
@dzarezenko Sure thing. I'll release updates for PRs and do maintainer stuff but I won't work on the repo anymore.
I work with stixjs and wetland ORM now.