So I wanted to take the approach of explicitly creating my schemas and shying away from the
config/database.js file... something similar to
this post. I've got the following code:
config/database.js
module.exports = {
development: {},
test: {},
production: {}
};
db/schema.jsvar Schema = require('jugglingdb').Schema;
var mongoDbSchema = new Schema('mongodb', {
driver: 'mongodb',
url: 'mongodb://localhost/cache-dev'
});
mongoDbSchema.define('Compression', function(model) {
model.property('compression', 'String');
});
This seems to work, as the mongoDbSchema has my model attached to it after starting my server. The problem, however, comes with the seed file, and I believe it's because my model that I create above is on a different schema than where the seed file is pulling from, so if I have a CoffeeScript seed file like this:
Compression.seed ->
compression: 'mp4'
So when I try to run
compound seed, I get
ReferenceError: Compression is not defined, but like I said, I think this is because the seed is trying to use the default database's schema, which is defined in database.js, but it's just empty objects, so there's no model named
Compression in the scope of the seed file.
My question is, can I specify a seed file to use a certain schema that I have defined, or does it only use the default database connection/schema defined in database.js and schema.js?