Przeglądaj źródła

fix unique compound index

Yuki Takei 6 lat temu
rodzic
commit
7eb8d12887
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      src/server/models/page-tag-relation.js

+ 1 - 1
src/server/models/page-tag-relation.js

@@ -27,7 +27,7 @@ const schema = new mongoose.Schema({
   },
   },
 });
 });
 // define unique compound index
 // define unique compound index
-schema.index({ page: 1, user: 1 }, { unique: true });
+schema.index({ relatedPage: 1, relatedTag: 1 }, { unique: true });
 schema.plugin(mongoosePaginate);
 schema.plugin(mongoosePaginate);
 schema.plugin(uniqueValidator);
 schema.plugin(uniqueValidator);