Migrates Monster class to be storable in roomdb.
This commit is contained in:
		| @@ -2,11 +2,11 @@ | ||||
|   "formatVersion": 1, | ||||
|   "database": { | ||||
|     "version": 1, | ||||
|     "identityHash": "a9371223372fb64522cc40f5529ada09", | ||||
|     "identityHash": "db1293d2f490940b55ca1f4f56b21b1a", | ||||
|     "entities": [ | ||||
|       { | ||||
|         "tableName": "Monster", | ||||
|         "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT NOT NULL DEFAULT '', PRIMARY KEY(`id`))", | ||||
|         "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT NOT NULL DEFAULT '', `size` TEXT NOT NULL DEFAULT '', `type` TEXT NOT NULL DEFAULT '', `subtype` TEXT NOT NULL DEFAULT '', `alignment` TEXT NOT NULL DEFAULT '', `strength_score` INTEGER NOT NULL DEFAULT 10, `strength_saving_throw_advantage` TEXT DEFAULT 'none', `strength_saving_throw_proficiency` TEXT DEFAULT 'none', `dexterity_score` INTEGER NOT NULL DEFAULT 10, `dexterity_saving_throw_advantage` TEXT DEFAULT 'none', `dexterity_saving_throw_proficiency` TEXT DEFAULT 'none', `constitution_score` INTEGER NOT NULL DEFAULT 10, `constitution_saving_throw_advantage` TEXT DEFAULT 'none', `constitution_saving_throw_proficiency` TEXT DEFAULT 'none', `intelligence_score` INTEGER NOT NULL DEFAULT 10, `intelligence_saving_throw_advantage` TEXT DEFAULT 'none', `intelligence_saving_throw_proficiency` TEXT DEFAULT 'none', `wisdom_score` INTEGER NOT NULL DEFAULT 10, `wisdom_saving_throw_advantage` TEXT DEFAULT 'none', `wisdom_saving_throw_proficiency` TEXT DEFAULT 'none', `charisma_score` INTEGER NOT NULL DEFAULT 10, `charisma_saving_throw_advantage` TEXT DEFAULT 'none', `charisma_saving_throw_proficiency` TEXT DEFAULT 'none', `armor_type` TEXT DEFAULT 'none', `shield_bonus` INTEGER NOT NULL DEFAULT 0, `natural_armor_bonus` INTEGER NOT NULL DEFAULT 0, `other_armor_description` TEXT DEFAULT '', `hit_dice` INTEGER NOT NULL DEFAULT 1, `has_custom_hit_points` INTEGER NOT NULL, `custom_hit_points_description` TEXT DEFAULT '', `walk_speed` INTEGER NOT NULL DEFAULT 0, `burrow_speed` INTEGER NOT NULL DEFAULT 0, `climb_speed` INTEGER NOT NULL DEFAULT 0, `fly_speed` INTEGER NOT NULL DEFAULT 0, `can_hover` INTEGER NOT NULL DEFAULT false, `swim_speed` INTEGER NOT NULL DEFAULT 0, `has_custom_speed` INTEGER NOT NULL DEFAULT false, `custom_speed_description` TEXT, `challenge_rating` TEXT DEFAULT '1', `custom_challenge_rating_description` TEXT DEFAULT '', `custom_proficiency_bonus` INTEGER NOT NULL DEFAULT 0, `blindsight_range` INTEGER NOT NULL DEFAULT 0, `is_blind_beyond_blindsight_range` INTEGER NOT NULL DEFAULT false, `darkvision_range` INTEGER NOT NULL DEFAULT 0, `tremorsense_range` INTEGER NOT NULL DEFAULT 0, `truesight_range` INTEGER NOT NULL DEFAULT 0, `telepathy_range` INTEGER NOT NULL DEFAULT 0, `understands_but_description` TEXT DEFAULT '', `skills` TEXT, `damage_immunities` TEXT, `damage_resistances` TEXT, `damage_vulnerabilities` TEXT, `condition_immunities` TEXT, `languages` TEXT, `abilities` TEXT, `actions` TEXT, `reactions` TEXT, `lair_actions` TEXT, `legendary_actions` TEXT, `regional_actions` TEXT, PRIMARY KEY(`id`))", | ||||
|         "fields": [ | ||||
|           { | ||||
|             "fieldPath": "id", | ||||
| @@ -20,6 +20,405 @@ | ||||
|             "affinity": "TEXT", | ||||
|             "notNull": true, | ||||
|             "defaultValue": "''" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "size", | ||||
|             "columnName": "size", | ||||
|             "affinity": "TEXT", | ||||
|             "notNull": true, | ||||
|             "defaultValue": "''" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "type", | ||||
|             "columnName": "type", | ||||
|             "affinity": "TEXT", | ||||
|             "notNull": true, | ||||
|             "defaultValue": "''" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "subtype", | ||||
|             "columnName": "subtype", | ||||
|             "affinity": "TEXT", | ||||
|             "notNull": true, | ||||
|             "defaultValue": "''" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "alignment", | ||||
|             "columnName": "alignment", | ||||
|             "affinity": "TEXT", | ||||
|             "notNull": true, | ||||
|             "defaultValue": "''" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "strengthScore", | ||||
|             "columnName": "strength_score", | ||||
|             "affinity": "INTEGER", | ||||
|             "notNull": true, | ||||
|             "defaultValue": "10" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "strengthSavingThrowAdvantage", | ||||
|             "columnName": "strength_saving_throw_advantage", | ||||
|             "affinity": "TEXT", | ||||
|             "notNull": false, | ||||
|             "defaultValue": "'none'" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "strengthSavingThrowProficiency", | ||||
|             "columnName": "strength_saving_throw_proficiency", | ||||
|             "affinity": "TEXT", | ||||
|             "notNull": false, | ||||
|             "defaultValue": "'none'" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "dexterityScore", | ||||
|             "columnName": "dexterity_score", | ||||
|             "affinity": "INTEGER", | ||||
|             "notNull": true, | ||||
|             "defaultValue": "10" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "dexteritySavingThrowAdvantage", | ||||
|             "columnName": "dexterity_saving_throw_advantage", | ||||
|             "affinity": "TEXT", | ||||
|             "notNull": false, | ||||
|             "defaultValue": "'none'" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "dexteritySavingThrowProficiency", | ||||
|             "columnName": "dexterity_saving_throw_proficiency", | ||||
|             "affinity": "TEXT", | ||||
|             "notNull": false, | ||||
|             "defaultValue": "'none'" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "constitutionScore", | ||||
|             "columnName": "constitution_score", | ||||
|             "affinity": "INTEGER", | ||||
|             "notNull": true, | ||||
|             "defaultValue": "10" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "constitutionSavingThrowAdvantage", | ||||
|             "columnName": "constitution_saving_throw_advantage", | ||||
|             "affinity": "TEXT", | ||||
|             "notNull": false, | ||||
|             "defaultValue": "'none'" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "constitutionSavingThrowProficiency", | ||||
|             "columnName": "constitution_saving_throw_proficiency", | ||||
|             "affinity": "TEXT", | ||||
|             "notNull": false, | ||||
|             "defaultValue": "'none'" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "intelligenceScore", | ||||
|             "columnName": "intelligence_score", | ||||
|             "affinity": "INTEGER", | ||||
|             "notNull": true, | ||||
|             "defaultValue": "10" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "intelligenceSavingThrowAdvantage", | ||||
|             "columnName": "intelligence_saving_throw_advantage", | ||||
|             "affinity": "TEXT", | ||||
|             "notNull": false, | ||||
|             "defaultValue": "'none'" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "intelligenceSavingThrowProficiency", | ||||
|             "columnName": "intelligence_saving_throw_proficiency", | ||||
|             "affinity": "TEXT", | ||||
|             "notNull": false, | ||||
|             "defaultValue": "'none'" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "wisdomScore", | ||||
|             "columnName": "wisdom_score", | ||||
|             "affinity": "INTEGER", | ||||
|             "notNull": true, | ||||
|             "defaultValue": "10" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "wisdomSavingThrowAdvantage", | ||||
|             "columnName": "wisdom_saving_throw_advantage", | ||||
|             "affinity": "TEXT", | ||||
|             "notNull": false, | ||||
|             "defaultValue": "'none'" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "wisdomSavingThrowProficiency", | ||||
|             "columnName": "wisdom_saving_throw_proficiency", | ||||
|             "affinity": "TEXT", | ||||
|             "notNull": false, | ||||
|             "defaultValue": "'none'" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "charismaScore", | ||||
|             "columnName": "charisma_score", | ||||
|             "affinity": "INTEGER", | ||||
|             "notNull": true, | ||||
|             "defaultValue": "10" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "charismaSavingThrowAdvantage", | ||||
|             "columnName": "charisma_saving_throw_advantage", | ||||
|             "affinity": "TEXT", | ||||
|             "notNull": false, | ||||
|             "defaultValue": "'none'" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "charismaSavingThrowProficiency", | ||||
|             "columnName": "charisma_saving_throw_proficiency", | ||||
|             "affinity": "TEXT", | ||||
|             "notNull": false, | ||||
|             "defaultValue": "'none'" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "armorType", | ||||
|             "columnName": "armor_type", | ||||
|             "affinity": "TEXT", | ||||
|             "notNull": false, | ||||
|             "defaultValue": "'none'" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "shieldBonus", | ||||
|             "columnName": "shield_bonus", | ||||
|             "affinity": "INTEGER", | ||||
|             "notNull": true, | ||||
|             "defaultValue": "0" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "naturalArmorBonus", | ||||
|             "columnName": "natural_armor_bonus", | ||||
|             "affinity": "INTEGER", | ||||
|             "notNull": true, | ||||
|             "defaultValue": "0" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "otherArmorDescription", | ||||
|             "columnName": "other_armor_description", | ||||
|             "affinity": "TEXT", | ||||
|             "notNull": false, | ||||
|             "defaultValue": "''" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "hitDice", | ||||
|             "columnName": "hit_dice", | ||||
|             "affinity": "INTEGER", | ||||
|             "notNull": true, | ||||
|             "defaultValue": "1" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "hasCustomHP", | ||||
|             "columnName": "has_custom_hit_points", | ||||
|             "affinity": "INTEGER", | ||||
|             "notNull": true | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "customHPDescription", | ||||
|             "columnName": "custom_hit_points_description", | ||||
|             "affinity": "TEXT", | ||||
|             "notNull": false, | ||||
|             "defaultValue": "''" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "walkSpeed", | ||||
|             "columnName": "walk_speed", | ||||
|             "affinity": "INTEGER", | ||||
|             "notNull": true, | ||||
|             "defaultValue": "0" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "burrowSpeed", | ||||
|             "columnName": "burrow_speed", | ||||
|             "affinity": "INTEGER", | ||||
|             "notNull": true, | ||||
|             "defaultValue": "0" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "climbSpeed", | ||||
|             "columnName": "climb_speed", | ||||
|             "affinity": "INTEGER", | ||||
|             "notNull": true, | ||||
|             "defaultValue": "0" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "flySpeed", | ||||
|             "columnName": "fly_speed", | ||||
|             "affinity": "INTEGER", | ||||
|             "notNull": true, | ||||
|             "defaultValue": "0" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "canHover", | ||||
|             "columnName": "can_hover", | ||||
|             "affinity": "INTEGER", | ||||
|             "notNull": true, | ||||
|             "defaultValue": "false" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "swimSpeed", | ||||
|             "columnName": "swim_speed", | ||||
|             "affinity": "INTEGER", | ||||
|             "notNull": true, | ||||
|             "defaultValue": "0" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "hasCustomSpeed", | ||||
|             "columnName": "has_custom_speed", | ||||
|             "affinity": "INTEGER", | ||||
|             "notNull": true, | ||||
|             "defaultValue": "false" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "customSpeedDescription", | ||||
|             "columnName": "custom_speed_description", | ||||
|             "affinity": "TEXT", | ||||
|             "notNull": false | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "challengeRating", | ||||
|             "columnName": "challenge_rating", | ||||
|             "affinity": "TEXT", | ||||
|             "notNull": false, | ||||
|             "defaultValue": "'1'" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "customChallengeRatingDescription", | ||||
|             "columnName": "custom_challenge_rating_description", | ||||
|             "affinity": "TEXT", | ||||
|             "notNull": false, | ||||
|             "defaultValue": "''" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "customProficiencyBonus", | ||||
|             "columnName": "custom_proficiency_bonus", | ||||
|             "affinity": "INTEGER", | ||||
|             "notNull": true, | ||||
|             "defaultValue": "0" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "blindsightRange", | ||||
|             "columnName": "blindsight_range", | ||||
|             "affinity": "INTEGER", | ||||
|             "notNull": true, | ||||
|             "defaultValue": "0" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "isBlindBeyondBlindsightRange", | ||||
|             "columnName": "is_blind_beyond_blindsight_range", | ||||
|             "affinity": "INTEGER", | ||||
|             "notNull": true, | ||||
|             "defaultValue": "false" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "darkvisionRange", | ||||
|             "columnName": "darkvision_range", | ||||
|             "affinity": "INTEGER", | ||||
|             "notNull": true, | ||||
|             "defaultValue": "0" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "tremorsenseRange", | ||||
|             "columnName": "tremorsense_range", | ||||
|             "affinity": "INTEGER", | ||||
|             "notNull": true, | ||||
|             "defaultValue": "0" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "truesightRange", | ||||
|             "columnName": "truesight_range", | ||||
|             "affinity": "INTEGER", | ||||
|             "notNull": true, | ||||
|             "defaultValue": "0" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "telepathyRange", | ||||
|             "columnName": "telepathy_range", | ||||
|             "affinity": "INTEGER", | ||||
|             "notNull": true, | ||||
|             "defaultValue": "0" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "understandsButDescription", | ||||
|             "columnName": "understands_but_description", | ||||
|             "affinity": "TEXT", | ||||
|             "notNull": false, | ||||
|             "defaultValue": "''" | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "skills", | ||||
|             "columnName": "skills", | ||||
|             "affinity": "TEXT", | ||||
|             "notNull": false | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "damageImmunities", | ||||
|             "columnName": "damage_immunities", | ||||
|             "affinity": "TEXT", | ||||
|             "notNull": false | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "damageResistances", | ||||
|             "columnName": "damage_resistances", | ||||
|             "affinity": "TEXT", | ||||
|             "notNull": false | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "damageVulnerabilities", | ||||
|             "columnName": "damage_vulnerabilities", | ||||
|             "affinity": "TEXT", | ||||
|             "notNull": false | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "conditionImmunities", | ||||
|             "columnName": "condition_immunities", | ||||
|             "affinity": "TEXT", | ||||
|             "notNull": false | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "languages", | ||||
|             "columnName": "languages", | ||||
|             "affinity": "TEXT", | ||||
|             "notNull": false | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "abilities", | ||||
|             "columnName": "abilities", | ||||
|             "affinity": "TEXT", | ||||
|             "notNull": false | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "actions", | ||||
|             "columnName": "actions", | ||||
|             "affinity": "TEXT", | ||||
|             "notNull": false | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "reactions", | ||||
|             "columnName": "reactions", | ||||
|             "affinity": "TEXT", | ||||
|             "notNull": false | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "lairActions", | ||||
|             "columnName": "lair_actions", | ||||
|             "affinity": "TEXT", | ||||
|             "notNull": false | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "legendaryActions", | ||||
|             "columnName": "legendary_actions", | ||||
|             "affinity": "TEXT", | ||||
|             "notNull": false | ||||
|           }, | ||||
|           { | ||||
|             "fieldPath": "regionalActions", | ||||
|             "columnName": "regional_actions", | ||||
|             "affinity": "TEXT", | ||||
|             "notNull": false | ||||
|           } | ||||
|         ], | ||||
|         "primaryKey": { | ||||
| @@ -35,7 +434,7 @@ | ||||
|     "views": [], | ||||
|     "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, 'a9371223372fb64522cc40f5529ada09')" | ||||
|       "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'db1293d2f490940b55ca1f4f56b21b1a')" | ||||
|     ] | ||||
|   } | ||||
| } | ||||
| @@ -0,0 +1,73 @@ | ||||
| ## Monster | ||||
| id: UUID as TEXT // doesn't exist in the iOS model | ||||
| abilities: Set<Trait> converted to JSON as TEXT | ||||
| actions: Set<Trait> converted to JSON as TEXT | ||||
| alignment: String as TEXT | ||||
| armor_type: Enum<String> as TEXT | ||||
| blindsight_range: int as INTEGER | ||||
| burrow_speed: int as INTEGER | ||||
| can_hover: boolean as INTEGER | ||||
| challenge_rating: Enum<String> as TEXT | ||||
| charisma_saving_throw_advantage | ||||
| charisma_saving_throw_proficiency | ||||
| charisma_score: int as INTEGER | ||||
| climb_speed: int as INTEGER | ||||
| condition_immunities: Set<String> converted to JSON as TEXT | ||||
| constitution_saving_throw_advantage | ||||
| constitution_saving_throw_proficiency | ||||
| constitution_score: int as INTEGER | ||||
| //other_armor_description: String as TEXT | ||||
| custom_challenge_rating_description: String as TEXT | ||||
| custom_hit_points_description: String | ||||
| custom_proficiency_bonus: int as INTEGER | ||||
| custom_speed_description: String as TEXT | ||||
| damage_immunities: Set<String> converted to JSON as TEXT | ||||
| damage_resistances: Set<String> converted to JSON as TEXT | ||||
| damage_vulnerabilities: Set<String> converted to JSON as TEXT | ||||
| darkvision_range: int as INTEGER | ||||
| dexterity_saving_throw_advantage | ||||
| dexterity_saving_throw_proficiency | ||||
| dexterity_score: int as INTEGER | ||||
| fly_speed: int as INTEGER | ||||
| has_custom_hit_points: boolean as INTEGER | ||||
| has_custom_speed: boolean as INTEGER | ||||
| // has_shield | ||||
| hit_dice: int as INTEGER | ||||
| intelligence_saving_throw_advantage | ||||
| intelligence_saving_throw_proficiency | ||||
| intelligence_score: int as INTEGER | ||||
| is_blind_beyond_blindsight_range: boolean as INTEGER | ||||
| lair_actions | ||||
| languages: Set<Language> converted to JSON as TEXT | ||||
| legendary_actions | ||||
| name: String as TEXT | ||||
| natural_armor_bonus: int as INTEGER | ||||
| other_armor_description: String as TEXT | ||||
| reactions | ||||
| regional_actions | ||||
| // senses | ||||
| shield_bonus: int as INTEGER | ||||
| size: String as TEXT | ||||
| strength_saving_throw_advantage | ||||
| strength_saving_throw_proficiency | ||||
| strength_score: int as INTEGER | ||||
| tag: String as TEXT // subtype || tag | ||||
| swim_speed: int as INTEGER | ||||
| telepathy_range: int as INTEGER | ||||
| tremorsense_range: int as INTEGER | ||||
| truesight_range: int as INTEGER | ||||
| type: String as TEXT | ||||
| understands_but_description: String as TEXT | ||||
| walk_speed: int as INTEGER | ||||
| wisdom_saving_throw_advantage | ||||
| wisdom_saving_throw_proficiency | ||||
| wisdom_score: int as INTEGER | ||||
|  | ||||
| // tracked as relationship (don't do this) | ||||
| skills: Set<Skill> converted to JSON as TEXT | ||||
|  | ||||
| ## Skill | ||||
| // ability_score_name String defaults to "strength" | ||||
| // advantage String defaults to "none" | ||||
| // name String defaults to "" | ||||
| // proficiency String defaults to "none" | ||||
		Reference in New Issue
	
	Block a user