new procurement
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
const mongoose = require('mongoose')
|
||||
const mongoose = require('mongoose');
|
||||
|
||||
const companySchema = new mongoose.Schema({
|
||||
fullName: {
|
||||
@@ -8,7 +8,6 @@ const companySchema = new mongoose.Schema({
|
||||
shortName: String,
|
||||
inn: {
|
||||
type: String,
|
||||
unique: true,
|
||||
sparse: true
|
||||
},
|
||||
ogrn: String,
|
||||
@@ -46,6 +45,10 @@ const companySchema = new mongoose.Schema({
|
||||
productsNeeded: String,
|
||||
partnerIndustries: [String],
|
||||
partnerGeography: [String],
|
||||
verified: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
createdAt: {
|
||||
type: Date,
|
||||
default: Date.now
|
||||
@@ -54,11 +57,14 @@ const companySchema = new mongoose.Schema({
|
||||
type: Date,
|
||||
default: Date.now
|
||||
}
|
||||
})
|
||||
}, {
|
||||
collection: 'companies',
|
||||
minimize: false
|
||||
});
|
||||
|
||||
// Индексы для поиска
|
||||
companySchema.index({ fullName: 'text', shortName: 'text', description: 'text' })
|
||||
companySchema.index({ industry: 1 })
|
||||
companySchema.index({ rating: -1 })
|
||||
companySchema.index({ fullName: 'text', shortName: 'text', description: 'text' });
|
||||
companySchema.index({ industry: 1 });
|
||||
companySchema.index({ rating: -1 });
|
||||
|
||||
module.exports = mongoose.model('Company', companySchema)
|
||||
module.exports = mongoose.model('Company', companySchema);
|
||||
|
||||
Reference in New Issue
Block a user