Index in db annotation on remix type


#1

Let’s suppose I have a base type with an index on fieldA:

@db(index=[“fieldA”])
entity type Type … {
fieldA: …

}

And I want to remix this type and ADD another index on fieldB that is defined in the remix type:

@db(index=[“fieldB”]
remix type Type {
fieldB: …

}

Is it going to override the index on fieldA or add a second index?

Thank you.


#2

It is supposed to merge the indexes from both. Currently there is a bug that David T. has to fix that.


#3

Ran into this myself today. Learned this from David:

If base type defines unique index on 2 columns and you want to change it to use 3 columns with a remix – the underlying index enforcing uniqueness of the original 2 columns won’t be removed.

That is, a new index with 3 columns would be created in addition to the 2 column unique index that already exists.