Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schema True/False flag #558

Merged
merged 1 commit into from
Jul 11, 2013

Conversation

particlebanana
Copy link
Contributor

This allows a flag to be set that will allow arbitrary data keys to be persisted in schemaless databases.

There are a few ways of defining it. If an adapter supports schemaless it can set it's default schema flag to false and this will allow anything to be persisted. This should be the default for the disk and memory adapters.

You can set it on a per model basis:

module.exports = {
   schema: false,
   attributes: {}
}

Or you can set it globally in the adapters.js config:

module.exports.adapters = {
    mongo: {
        schema: false
    }
}

It's already pushed to Waterline and I'll push it to the disk, memory and mongo adapters after this.

mikermcneil added a commit that referenced this pull request Jul 11, 2013
@mikermcneil mikermcneil merged commit 571770c into balderdashy:development Jul 11, 2013
@particlebanana particlebanana deleted the schema_flag branch July 11, 2013 14:11
@mikermcneil
Copy link
Member

@particlebanana with the latest waterline and sails-disk, I'm still not getting a default of schema:false atm. I'll dig more into this when I can, but i thought I'd bring it up in case anything sticks out immediately

@particlebanana
Copy link
Contributor Author

hmm just pulled down all the latest and it's working for me. Do you have sails-disk npm linked in your new project? Not sure how sails handles copying down dependencies but it may need to be linked in your global sails and your project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants