SailsJS - Waterline - Many to Many Database Table

Viewed 16

I've joined an existing project where we use SailsJS and Waterline for our ORM. I've noticed the following database table : category_items__item_categories but I don't see any model for it.

Here's the actual models:

Item.JS

Item.JS
module.exports = {

    attributes: {
        name: {
            type: 'string'
        },
        description: {
            type: 'string',
            allowNull: true
        },
        categories: {
            collection: 'category',
            via: 'items',
        },
    }
}

Category.JS

module.exports = {

    attributes: {
        name: {
            type: 'string'
        },
        description: {
            type: 'string',
            allowNull: true
        },
        items: {
            collection: 'item',
            via: 'categories',
        },
    }
}

Does SailsJS generate tables at all? does it generate many to many tables? If not , how does it represent many to many relationship in the data store (in this case PostgreSQL database)?

Thanks!

1 Answers
Related