@@ -11,7 +11,7 @@ func TestDuplicateIndexSkipsInvalid(t *testing.T) {
1111 snap .Tables = []schema.Table {{
1212 Schema : "public" , Name : "orders" ,
1313 Indexes : []schema.Index {
14- {Name : "idx_a" , Columns : []string {"user_id" }, IndexType : "btree" , IsValid : true },
14+ {Name : "idx_a" , Columns : []string {"user_id" }, IndexType : "btree" , IsValid : true , IsReady : true },
1515 {Name : "idx_b" , Columns : []string {"user_id" }, IndexType : "btree" , IsValid : false },
1616 },
1717 }}
@@ -26,8 +26,8 @@ func TestRedundantSkipsUniqueIndex(t *testing.T) {
2626 snap .Tables = []schema.Table {{
2727 Schema : "public" , Name : "orders" ,
2828 Indexes : []schema.Index {
29- {Name : "idx_unique_email" , Columns : []string {"email" }, IndexType : "btree" , IsUnique : true , IsValid : true },
30- {Name : "idx_email_created" , Columns : []string {"email" , "created_at" }, IndexType : "btree" , IsValid : true },
29+ {Name : "idx_unique_email" , Columns : []string {"email" }, IndexType : "btree" , IsUnique : true , IsValid : true , IsReady : true },
30+ {Name : "idx_email_created" , Columns : []string {"email" , "created_at" }, IndexType : "btree" , IsValid : true , IsReady : true },
3131 },
3232 }}
3333 findings := checkRedundantIndexes (snap )
@@ -41,8 +41,8 @@ func TestNonUniqueRedundantWithUnique(t *testing.T) {
4141 snap .Tables = []schema.Table {{
4242 Schema : "public" , Name : "orders" ,
4343 Indexes : []schema.Index {
44- {Name : "idx_email" , Columns : []string {"email" }, IndexType : "btree" , IsValid : true },
45- {Name : "idx_email_unique" , Columns : []string {"email" }, IndexType : "btree" , IsUnique : true , IsValid : true },
44+ {Name : "idx_email" , Columns : []string {"email" }, IndexType : "btree" , IsValid : true , IsReady : true },
45+ {Name : "idx_email_unique" , Columns : []string {"email" }, IndexType : "btree" , IsUnique : true , IsValid : true , IsReady : true },
4646 },
4747 }}
4848 findings := checkRedundantIndexes (snap )
@@ -59,8 +59,8 @@ func TestDuplicateIndexBothValid(t *testing.T) {
5959 snap .Tables = []schema.Table {{
6060 Schema : "public" , Name : "orders" ,
6161 Indexes : []schema.Index {
62- {Name : "idx_a" , Columns : []string {"user_id" }, IndexType : "btree" , IsValid : true },
63- {Name : "idx_b" , Columns : []string {"user_id" }, IndexType : "btree" , IsValid : true },
62+ {Name : "idx_a" , Columns : []string {"user_id" }, IndexType : "btree" , IsValid : true , IsReady : true },
63+ {Name : "idx_b" , Columns : []string {"user_id" }, IndexType : "btree" , IsValid : true , IsReady : true },
6464 },
6565 }}
6666 findings := checkDuplicateIndexes (snap )
0 commit comments