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

Model's indexes aren't updated #18

Open
DalerAkhmetov opened this issue May 2, 2018 · 0 comments
Open

Model's indexes aren't updated #18

DalerAkhmetov opened this issue May 2, 2018 · 0 comments

Comments

@DalerAkhmetov
Copy link

DalerAkhmetov commented May 2, 2018

Hello.
If model of previous state have no indexes and i will add index in this model then i will still get message "No changes found".

I found bug. Could you fix this code section:


        if (models[model].options.indexes.length > 0)
        {
            let idx_out = {};
            for (let _i in models[model].options.indexes)
            {
                let index = parseIndex(models[model].options.indexes[_i]);
                idx_out[index.hash+''] = index;
                delete index.hash;
                
                // make it immutable
                Object.freeze(index);
            }
            models[model].options.indexes = idx_out;
        } else {
            models[model].options.indexes = {}; // Important change, because models[model].options.indexes is [] but it must be {}
        }
        
        tables[models[model].tableName].indexes = models[model].options.indexes;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant