| { |
| "formatVersion": 1, |
| "database": { |
| "version": 13, |
| "identityHash": "243330983fa2a2c935ba4427cbd2238b", |
| "entities": [ |
| { |
| "tableName": "Entity1", |
| "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT, `addedInV10` INTEGER NOT NULL DEFAULT 0, `added1InV13` INTEGER NOT NULL DEFAULT (0), PRIMARY KEY(`id`))", |
| "fields": [ |
| { |
| "fieldPath": "id", |
| "columnName": "id", |
| "affinity": "INTEGER", |
| "notNull": true |
| }, |
| { |
| "fieldPath": "name", |
| "columnName": "name", |
| "affinity": "TEXT", |
| "notNull": false |
| }, |
| { |
| "fieldPath": "addedInV10", |
| "columnName": "addedInV10", |
| "affinity": "INTEGER", |
| "notNull": true, |
| "defaultValue": "0" |
| }, |
| { |
| "fieldPath": "added1InV13", |
| "columnName": "added1InV13", |
| "affinity": "INTEGER", |
| "notNull": true, |
| "defaultValue": "(0)" |
| } |
| ], |
| "primaryKey": { |
| "columnNames": [ |
| "id" |
| ], |
| "autoGenerate": false |
| }, |
| "indices": [ |
| { |
| "name": "index_Entity1_name", |
| "unique": true, |
| "columnNames": [ |
| "name" |
| ], |
| "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_Entity1_name` ON `${TABLE_NAME}` (`name`)" |
| }, |
| { |
| "name": "index_Entity1_addedInV10", |
| "unique": false, |
| "columnNames": [ |
| "addedInV10" |
| ], |
| "createSql": "CREATE INDEX IF NOT EXISTS `index_Entity1_addedInV10` ON `${TABLE_NAME}` (`addedInV10`)" |
| } |
| ], |
| "foreignKeys": [] |
| }, |
| { |
| "tableName": "Entity2", |
| "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `addedInV3` TEXT, `name` TEXT DEFAULT 'Unknown', `addedInV9` TEXT)", |
| "fields": [ |
| { |
| "fieldPath": "id", |
| "columnName": "id", |
| "affinity": "INTEGER", |
| "notNull": true |
| }, |
| { |
| "fieldPath": "addedInV3", |
| "columnName": "addedInV3", |
| "affinity": "TEXT", |
| "notNull": false |
| }, |
| { |
| "fieldPath": "name", |
| "columnName": "name", |
| "affinity": "TEXT", |
| "notNull": false, |
| "defaultValue": "'Unknown'" |
| }, |
| { |
| "fieldPath": "addedInV9", |
| "columnName": "addedInV9", |
| "affinity": "TEXT", |
| "notNull": false |
| } |
| ], |
| "primaryKey": { |
| "columnNames": [ |
| "id" |
| ], |
| "autoGenerate": true |
| }, |
| "indices": [], |
| "foreignKeys": [] |
| }, |
| { |
| "tableName": "Entity4", |
| "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT COLLATE NOCASE, PRIMARY KEY(`id`), FOREIGN KEY(`name`) REFERENCES `Entity1`(`name`) ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED)", |
| "fields": [ |
| { |
| "fieldPath": "id", |
| "columnName": "id", |
| "affinity": "INTEGER", |
| "notNull": true |
| }, |
| { |
| "fieldPath": "name", |
| "columnName": "name", |
| "affinity": "TEXT", |
| "notNull": false |
| } |
| ], |
| "primaryKey": { |
| "columnNames": [ |
| "id" |
| ], |
| "autoGenerate": false |
| }, |
| "indices": [], |
| "foreignKeys": [ |
| { |
| "table": "Entity1", |
| "onDelete": "NO ACTION", |
| "onUpdate": "NO ACTION", |
| "columns": [ |
| "name" |
| ], |
| "referencedColumns": [ |
| "name" |
| ] |
| } |
| ] |
| } |
| ], |
| "views": [ |
| { |
| "viewName": "View1", |
| "createSql": "CREATE VIEW `${VIEW_NAME}` AS SELECT Entity4.id, Entity4.name, Entity1.id AS entity1Id FROM Entity4 INNER JOIN Entity1 ON Entity4.name = Entity1.name" |
| } |
| ], |
| "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, '243330983fa2a2c935ba4427cbd2238b')" |
| ] |
| } |
| } |