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

Support Partial Indexes #562

Open
mhaddon opened this issue Mar 22, 2022 · 1 comment
Open

Support Partial Indexes #562

mhaddon opened this issue Mar 22, 2022 · 1 comment

Comments

@mhaddon
Copy link

mhaddon commented Mar 22, 2022

This tool is great, but it does not seem to be able to support partial indexes.
Eg:

  indexes: [
    {
      unique: true,
      fields: ['col1', 'col2'],
      where: {
        deletedAt: null
      }
    }
  ]
@mhaddon
Copy link
Author

mhaddon commented Apr 30, 2022

I had a look and the whole reason it wasnt working, was this line here:

if (ArrayOfIndexes) index = index[index];

that if statement breaks the ability for this tool to correctly generate indexes

if i comment it out, everything seems to magically work, what is the point of this statement?

also i imagine we need:

if (idx.where) options.where = idx.where; here:

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