payservedb 2.3.11 → 2.3.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payservedb",
3
- "version": "2.3.11",
3
+ "version": "2.3.12",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -1,6 +1,6 @@
1
1
  const mongoose = require('mongoose');
2
2
 
3
- // Define the schema for companies
3
+ // Define the schema for facilities
4
4
  const facilitySchema = new mongoose.Schema({
5
5
  name: {
6
6
  type: String,
@@ -24,6 +24,12 @@ const facilitySchema = new mongoose.Schema({
24
24
  type: String,
25
25
  trim: false,
26
26
  default: null
27
+ },
28
+ dbName: {
29
+ type: String,
30
+ required: [true, 'Database name is required'],
31
+ unique: true,
32
+ trim: true
27
33
  }
28
34
 
29
35
  }, {
@@ -32,6 +38,7 @@ const facilitySchema = new mongoose.Schema({
32
38
 
33
39
  // Indexes for improved performance
34
40
  facilitySchema.index({ name: 1 });
41
+ facilitySchema.index({ dbName: 1 });
35
42
 
36
43
  // Compile the model from the schema
37
44
  const Facility = mongoose.model('Facility', facilitySchema);