{
  "formatVersion": 1,
  "database": {
    "version": 8,
    "identityHash": "2afd85d88de505ee40c2b9523bee1fb4",
    "entities": [
      {
        "tableName": "Patient",
        "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`uuid` TEXT NOT NULL, `addressUuid` TEXT NOT NULL, `fullName` TEXT NOT NULL, `searchableName` TEXT NOT NULL, `gender` TEXT NOT NULL, `dateOfBirth` TEXT, `status` TEXT NOT NULL, `createdAt` TEXT NOT NULL, `updatedAt` TEXT NOT NULL, `syncStatus` TEXT NOT NULL, `age_value` INTEGER, `age_updatedAt` TEXT, `age_computedDateOfBirth` TEXT, PRIMARY KEY(`uuid`), FOREIGN KEY(`addressUuid`) REFERENCES `PatientAddress`(`uuid`) ON UPDATE CASCADE ON DELETE CASCADE )",
        "fields": [
          {
            "fieldPath": "uuid",
            "columnName": "uuid",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "addressUuid",
            "columnName": "addressUuid",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "fullName",
            "columnName": "fullName",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "searchableName",
            "columnName": "searchableName",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "gender",
            "columnName": "gender",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "dateOfBirth",
            "columnName": "dateOfBirth",
            "affinity": "TEXT",
            "notNull": false
          },
          {
            "fieldPath": "status",
            "columnName": "status",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "createdAt",
            "columnName": "createdAt",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "updatedAt",
            "columnName": "updatedAt",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "syncStatus",
            "columnName": "syncStatus",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "age.value",
            "columnName": "age_value",
            "affinity": "INTEGER",
            "notNull": false
          },
          {
            "fieldPath": "age.updatedAt",
            "columnName": "age_updatedAt",
            "affinity": "TEXT",
            "notNull": false
          },
          {
            "fieldPath": "age.computedDateOfBirth",
            "columnName": "age_computedDateOfBirth",
            "affinity": "TEXT",
            "notNull": false
          }
        ],
        "primaryKey": {
          "columnNames": [
            "uuid"
          ],
          "autoGenerate": false
        },
        "indices": [
          {
            "name": "index_Patient_addressUuid",
            "unique": true,
            "columnNames": [
              "addressUuid"
            ],
            "createSql": "CREATE UNIQUE INDEX `index_Patient_addressUuid` ON `${TABLE_NAME}` (`addressUuid`)"
          }
        ],
        "foreignKeys": [
          {
            "table": "PatientAddress",
            "onDelete": "CASCADE",
            "onUpdate": "CASCADE",
            "columns": [
              "addressUuid"
            ],
            "referencedColumns": [
              "uuid"
            ]
          }
        ]
      },
      {
        "tableName": "PatientAddress",
        "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`uuid` TEXT NOT NULL, `colonyOrVillage` TEXT, `district` TEXT NOT NULL, `state` TEXT NOT NULL, `country` TEXT, `createdAt` TEXT NOT NULL, `updatedAt` TEXT NOT NULL, PRIMARY KEY(`uuid`))",
        "fields": [
          {
            "fieldPath": "uuid",
            "columnName": "uuid",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "colonyOrVillage",
            "columnName": "colonyOrVillage",
            "affinity": "TEXT",
            "notNull": false
          },
          {
            "fieldPath": "district",
            "columnName": "district",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "state",
            "columnName": "state",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "country",
            "columnName": "country",
            "affinity": "TEXT",
            "notNull": false
          },
          {
            "fieldPath": "createdAt",
            "columnName": "createdAt",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "updatedAt",
            "columnName": "updatedAt",
            "affinity": "TEXT",
            "notNull": true
          }
        ],
        "primaryKey": {
          "columnNames": [
            "uuid"
          ],
          "autoGenerate": false
        },
        "indices": [],
        "foreignKeys": []
      },
      {
        "tableName": "PatientPhoneNumber",
        "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`uuid` TEXT NOT NULL, `patientUuid` TEXT NOT NULL, `number` TEXT NOT NULL, `phoneType` TEXT NOT NULL, `active` INTEGER NOT NULL, `createdAt` TEXT NOT NULL, `updatedAt` TEXT NOT NULL, PRIMARY KEY(`uuid`), FOREIGN KEY(`patientUuid`) REFERENCES `Patient`(`uuid`) ON UPDATE CASCADE ON DELETE CASCADE )",
        "fields": [
          {
            "fieldPath": "uuid",
            "columnName": "uuid",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "patientUuid",
            "columnName": "patientUuid",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "number",
            "columnName": "number",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "phoneType",
            "columnName": "phoneType",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "active",
            "columnName": "active",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "createdAt",
            "columnName": "createdAt",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "updatedAt",
            "columnName": "updatedAt",
            "affinity": "TEXT",
            "notNull": true
          }
        ],
        "primaryKey": {
          "columnNames": [
            "uuid"
          ],
          "autoGenerate": false
        },
        "indices": [
          {
            "name": "index_PatientPhoneNumber_patientUuid",
            "unique": false,
            "columnNames": [
              "patientUuid"
            ],
            "createSql": "CREATE  INDEX `index_PatientPhoneNumber_patientUuid` ON `${TABLE_NAME}` (`patientUuid`)"
          }
        ],
        "foreignKeys": [
          {
            "table": "Patient",
            "onDelete": "CASCADE",
            "onUpdate": "CASCADE",
            "columns": [
              "patientUuid"
            ],
            "referencedColumns": [
              "uuid"
            ]
          }
        ]
      },
      {
        "tableName": "BloodPressureMeasurement",
        "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`uuid` TEXT NOT NULL, `systolic` INTEGER NOT NULL, `diastolic` INTEGER NOT NULL, `syncStatus` TEXT NOT NULL, `userUuid` TEXT NOT NULL, `facilityUuid` TEXT NOT NULL, `patientUuid` TEXT NOT NULL, `createdAt` TEXT NOT NULL, `updatedAt` TEXT NOT NULL, PRIMARY KEY(`uuid`), FOREIGN KEY(`facilityUuid`) REFERENCES `Facility`(`uuid`) ON UPDATE CASCADE ON DELETE CASCADE )",
        "fields": [
          {
            "fieldPath": "uuid",
            "columnName": "uuid",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "systolic",
            "columnName": "systolic",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "diastolic",
            "columnName": "diastolic",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "syncStatus",
            "columnName": "syncStatus",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "userUuid",
            "columnName": "userUuid",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "facilityUuid",
            "columnName": "facilityUuid",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "patientUuid",
            "columnName": "patientUuid",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "createdAt",
            "columnName": "createdAt",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "updatedAt",
            "columnName": "updatedAt",
            "affinity": "TEXT",
            "notNull": true
          }
        ],
        "primaryKey": {
          "columnNames": [
            "uuid"
          ],
          "autoGenerate": false
        },
        "indices": [
          {
            "name": "index_BloodPressureMeasurement_patientUuid",
            "unique": false,
            "columnNames": [
              "patientUuid"
            ],
            "createSql": "CREATE  INDEX `index_BloodPressureMeasurement_patientUuid` ON `${TABLE_NAME}` (`patientUuid`)"
          },
          {
            "name": "index_BloodPressureMeasurement_facilityUuid",
            "unique": false,
            "columnNames": [
              "facilityUuid"
            ],
            "createSql": "CREATE  INDEX `index_BloodPressureMeasurement_facilityUuid` ON `${TABLE_NAME}` (`facilityUuid`)"
          }
        ],
        "foreignKeys": [
          {
            "table": "Facility",
            "onDelete": "CASCADE",
            "onUpdate": "CASCADE",
            "columns": [
              "facilityUuid"
            ],
            "referencedColumns": [
              "uuid"
            ]
          }
        ]
      },
      {
        "tableName": "PrescribedDrug",
        "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`uuid` TEXT NOT NULL, `name` TEXT NOT NULL, `dosage` TEXT, `rxNormCode` TEXT, `isDeleted` INTEGER NOT NULL, `isProtocolDrug` INTEGER NOT NULL, `patientUuid` TEXT NOT NULL, `facilityUuid` TEXT NOT NULL, `syncStatus` TEXT NOT NULL, `createdAt` TEXT NOT NULL, `updatedAt` TEXT NOT NULL, PRIMARY KEY(`uuid`), FOREIGN KEY(`facilityUuid`) REFERENCES `Facility`(`uuid`) ON UPDATE CASCADE ON DELETE CASCADE )",
        "fields": [
          {
            "fieldPath": "uuid",
            "columnName": "uuid",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "name",
            "columnName": "name",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "dosage",
            "columnName": "dosage",
            "affinity": "TEXT",
            "notNull": false
          },
          {
            "fieldPath": "rxNormCode",
            "columnName": "rxNormCode",
            "affinity": "TEXT",
            "notNull": false
          },
          {
            "fieldPath": "isDeleted",
            "columnName": "isDeleted",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "isProtocolDrug",
            "columnName": "isProtocolDrug",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "patientUuid",
            "columnName": "patientUuid",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "facilityUuid",
            "columnName": "facilityUuid",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "syncStatus",
            "columnName": "syncStatus",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "createdAt",
            "columnName": "createdAt",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "updatedAt",
            "columnName": "updatedAt",
            "affinity": "TEXT",
            "notNull": true
          }
        ],
        "primaryKey": {
          "columnNames": [
            "uuid"
          ],
          "autoGenerate": false
        },
        "indices": [
          {
            "name": "index_PrescribedDrug_patientUuid",
            "unique": false,
            "columnNames": [
              "patientUuid"
            ],
            "createSql": "CREATE  INDEX `index_PrescribedDrug_patientUuid` ON `${TABLE_NAME}` (`patientUuid`)"
          },
          {
            "name": "index_PrescribedDrug_facilityUuid",
            "unique": false,
            "columnNames": [
              "facilityUuid"
            ],
            "createSql": "CREATE  INDEX `index_PrescribedDrug_facilityUuid` ON `${TABLE_NAME}` (`facilityUuid`)"
          }
        ],
        "foreignKeys": [
          {
            "table": "Facility",
            "onDelete": "CASCADE",
            "onUpdate": "CASCADE",
            "columns": [
              "facilityUuid"
            ],
            "referencedColumns": [
              "uuid"
            ]
          }
        ]
      },
      {
        "tableName": "Facility",
        "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`uuid` TEXT NOT NULL, `name` TEXT NOT NULL, `facilityType` TEXT, `streetAddress` TEXT, `villageOrColony` TEXT, `district` TEXT NOT NULL, `state` TEXT NOT NULL, `country` TEXT NOT NULL, `pinCode` TEXT, `createdAt` TEXT NOT NULL, `updatedAt` TEXT NOT NULL, `syncStatus` TEXT NOT NULL, PRIMARY KEY(`uuid`))",
        "fields": [
          {
            "fieldPath": "uuid",
            "columnName": "uuid",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "name",
            "columnName": "name",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "facilityType",
            "columnName": "facilityType",
            "affinity": "TEXT",
            "notNull": false
          },
          {
            "fieldPath": "streetAddress",
            "columnName": "streetAddress",
            "affinity": "TEXT",
            "notNull": false
          },
          {
            "fieldPath": "villageOrColony",
            "columnName": "villageOrColony",
            "affinity": "TEXT",
            "notNull": false
          },
          {
            "fieldPath": "district",
            "columnName": "district",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "state",
            "columnName": "state",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "country",
            "columnName": "country",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "pinCode",
            "columnName": "pinCode",
            "affinity": "TEXT",
            "notNull": false
          },
          {
            "fieldPath": "createdAt",
            "columnName": "createdAt",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "updatedAt",
            "columnName": "updatedAt",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "syncStatus",
            "columnName": "syncStatus",
            "affinity": "TEXT",
            "notNull": true
          }
        ],
        "primaryKey": {
          "columnNames": [
            "uuid"
          ],
          "autoGenerate": false
        },
        "indices": [],
        "foreignKeys": []
      },
      {
        "tableName": "LoggedInUser",
        "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`uuid` TEXT NOT NULL, `fullName` TEXT NOT NULL, `phoneNumber` TEXT NOT NULL, `pinDigest` TEXT NOT NULL, `status` TEXT NOT NULL, `createdAt` TEXT NOT NULL, `updatedAt` TEXT NOT NULL, `loggedInStatus` TEXT NOT NULL, PRIMARY KEY(`uuid`))",
        "fields": [
          {
            "fieldPath": "uuid",
            "columnName": "uuid",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "fullName",
            "columnName": "fullName",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "phoneNumber",
            "columnName": "phoneNumber",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "pinDigest",
            "columnName": "pinDigest",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "status",
            "columnName": "status",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "createdAt",
            "columnName": "createdAt",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "updatedAt",
            "columnName": "updatedAt",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "loggedInStatus",
            "columnName": "loggedInStatus",
            "affinity": "TEXT",
            "notNull": true
          }
        ],
        "primaryKey": {
          "columnNames": [
            "uuid"
          ],
          "autoGenerate": false
        },
        "indices": [],
        "foreignKeys": []
      },
      {
        "tableName": "LoggedInUserFacilityMapping",
        "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`userUuid` TEXT NOT NULL, `facilityUuid` TEXT NOT NULL, `isCurrentFacility` INTEGER NOT NULL, PRIMARY KEY(`userUuid`, `facilityUuid`), FOREIGN KEY(`userUuid`) REFERENCES `LoggedInUser`(`uuid`) ON UPDATE NO ACTION ON DELETE NO ACTION , FOREIGN KEY(`facilityUuid`) REFERENCES `Facility`(`uuid`) ON UPDATE NO ACTION ON DELETE NO ACTION )",
        "fields": [
          {
            "fieldPath": "userUuid",
            "columnName": "userUuid",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "facilityUuid",
            "columnName": "facilityUuid",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "isCurrentFacility",
            "columnName": "isCurrentFacility",
            "affinity": "INTEGER",
            "notNull": true
          }
        ],
        "primaryKey": {
          "columnNames": [
            "userUuid",
            "facilityUuid"
          ],
          "autoGenerate": false
        },
        "indices": [
          {
            "name": "index_LoggedInUserFacilityMapping_facilityUuid",
            "unique": false,
            "columnNames": [
              "facilityUuid"
            ],
            "createSql": "CREATE  INDEX `index_LoggedInUserFacilityMapping_facilityUuid` ON `${TABLE_NAME}` (`facilityUuid`)"
          }
        ],
        "foreignKeys": [
          {
            "table": "LoggedInUser",
            "onDelete": "NO ACTION",
            "onUpdate": "NO ACTION",
            "columns": [
              "userUuid"
            ],
            "referencedColumns": [
              "uuid"
            ]
          },
          {
            "table": "Facility",
            "onDelete": "NO ACTION",
            "onUpdate": "NO ACTION",
            "columns": [
              "facilityUuid"
            ],
            "referencedColumns": [
              "uuid"
            ]
          }
        ]
      }
    ],
    "setupQueries": [
      "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
      "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"2afd85d88de505ee40c2b9523bee1fb4\")"
    ]
  }
}