Skip to content

Instantly share code, notes, and snippets.

@mr5z
Created November 14, 2017 19:22
Show Gist options
  • Save mr5z/6a531a7d82f84ae7c2b1f66768e7bbe4 to your computer and use it in GitHub Desktop.
Save mr5z/6a531a7d82f84ae7c2b1f66768e7bbe4 to your computer and use it in GitHub Desktop.
{
"formatVersion": 1,
"database": {
"version": 1,
"identityHash": "f0cd29d11d4a03881fedffb2c12feb23",
"entities": [
{
"tableName": "Certificates",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `userId` INTEGER NOT NULL, `title` TEXT, `description` TEXT, `dateCreated` TEXT, `expirationDate` TEXT, `certificateLink` TEXT, `deliveryStatus` INTEGER, PRIMARY KEY(`id`), FOREIGN KEY(`userId`) REFERENCES `Users`(`id`) ON UPDATE SET NULL ON DELETE SET NULL )",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "userId",
"columnName": "userId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "description",
"columnName": "description",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "dateCreated",
"columnName": "dateCreated",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "expirationDate",
"columnName": "expirationDate",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "certificateLink",
"columnName": "certificateLink",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "deliveryStatus",
"columnName": "deliveryStatus",
"affinity": "INTEGER",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": [
{
"table": "Users",
"onDelete": "SET NULL",
"onUpdate": "SET NULL",
"columns": [
"userId"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "Users",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `firstName` TEXT, `lastName` TEXT, `email` TEXT, `password` TEXT, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "firstName",
"columnName": "firstName",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "lastName",
"columnName": "lastName",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "email",
"columnName": "email",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "password",
"columnName": "password",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
}
],
"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, \"f0cd29d11d4a03881fedffb2c12feb23\")"
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment