Skip to content

Commit

Permalink
Merge pull request #68 from TimPushkin/updates
Browse files Browse the repository at this point in the history
spbu-mm map improvements
  • Loading branch information
TimPushkin authored Jun 24, 2023
2 parents 7fd7596 + 3fc2322 commit 93a505e
Show file tree
Hide file tree
Showing 4 changed files with 278 additions and 6 deletions.
272 changes: 272 additions & 0 deletions app/schemas/ru.spbu.depnav.data.db.AppDatabase/8.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,272 @@
{
"formatVersion": 1,
"database": {
"version": 8,
"identityHash": "4758aac06395f9babe465ff1a1274632",
"entities": [
{
"tableName": "map_info",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`name` TEXT NOT NULL, `floor_width` INTEGER NOT NULL, `floor_height` INTEGER NOT NULL, `tile_size` INTEGER NOT NULL, `levels_num` INTEGER NOT NULL, `floors_num` INTEGER NOT NULL, PRIMARY KEY(`name`))",
"fields": [
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "floorWidth",
"columnName": "floor_width",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "floorHeight",
"columnName": "floor_height",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "tileSize",
"columnName": "tile_size",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "levelsNum",
"columnName": "levels_num",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "floorsNum",
"columnName": "floors_num",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"name"
]
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "marker",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `map_name` TEXT NOT NULL, `type` TEXT NOT NULL, `is_closed` INTEGER NOT NULL, `floor` INTEGER NOT NULL, `x` REAL NOT NULL, `y` REAL NOT NULL, PRIMARY KEY(`id`), FOREIGN KEY(`map_name`) REFERENCES `map_info`(`name`) ON UPDATE NO ACTION ON DELETE RESTRICT )",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "mapName",
"columnName": "map_name",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "type",
"columnName": "type",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "isClosed",
"columnName": "is_closed",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "floor",
"columnName": "floor",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "x",
"columnName": "x",
"affinity": "REAL",
"notNull": true
},
{
"fieldPath": "y",
"columnName": "y",
"affinity": "REAL",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"id"
]
},
"indices": [
{
"name": "index_marker_map_name",
"unique": false,
"columnNames": [
"map_name"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_marker_map_name` ON `${TABLE_NAME}` (`map_name`)"
}
],
"foreignKeys": [
{
"table": "map_info",
"onDelete": "RESTRICT",
"onUpdate": "NO ACTION",
"columns": [
"map_name"
],
"referencedColumns": [
"name"
]
}
]
},
{
"tableName": "marker_text",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`marker_id` INTEGER NOT NULL, `language_id` TEXT NOT NULL, `title` TEXT, `description` TEXT, PRIMARY KEY(`marker_id`, `language_id`), FOREIGN KEY(`marker_id`) REFERENCES `marker`(`id`) ON UPDATE NO ACTION ON DELETE RESTRICT )",
"fields": [
{
"fieldPath": "markerId",
"columnName": "marker_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "languageId",
"columnName": "language_id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "description",
"columnName": "description",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"marker_id",
"language_id"
]
},
"indices": [],
"foreignKeys": [
{
"table": "marker",
"onDelete": "RESTRICT",
"onUpdate": "NO ACTION",
"columns": [
"marker_id"
],
"referencedColumns": [
"id"
]
}
]
},
{
"ftsVersion": "FTS4",
"ftsOptions": {
"tokenizer": "unicode61",
"tokenizerArgs": [],
"contentTable": "marker_text",
"languageIdColumnName": "",
"matchInfo": "FTS4",
"notIndexedColumns": [],
"prefixSizes": [],
"preferredOrder": "ASC"
},
"contentSyncTriggers": [
"CREATE TRIGGER IF NOT EXISTS room_fts_content_sync_marker_text_fts_BEFORE_UPDATE BEFORE UPDATE ON `marker_text` BEGIN DELETE FROM `marker_text_fts` WHERE `docid`=OLD.`rowid`; END",
"CREATE TRIGGER IF NOT EXISTS room_fts_content_sync_marker_text_fts_BEFORE_DELETE BEFORE DELETE ON `marker_text` BEGIN DELETE FROM `marker_text_fts` WHERE `docid`=OLD.`rowid`; END",
"CREATE TRIGGER IF NOT EXISTS room_fts_content_sync_marker_text_fts_AFTER_UPDATE AFTER UPDATE ON `marker_text` BEGIN INSERT INTO `marker_text_fts`(`docid`, `title`, `description`) VALUES (NEW.`rowid`, NEW.`title`, NEW.`description`); END",
"CREATE TRIGGER IF NOT EXISTS room_fts_content_sync_marker_text_fts_AFTER_INSERT AFTER INSERT ON `marker_text` BEGIN INSERT INTO `marker_text_fts`(`docid`, `title`, `description`) VALUES (NEW.`rowid`, NEW.`title`, NEW.`description`); END"
],
"tableName": "marker_text_fts",
"createSql": "CREATE VIRTUAL TABLE IF NOT EXISTS `${TABLE_NAME}` USING FTS4(`title` TEXT, `description` TEXT, tokenize=unicode61, content=`marker_text`)",
"fields": [
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "description",
"columnName": "description",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": []
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "search_history_entry",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`marker_id` INTEGER NOT NULL, `timestamp` INTEGER NOT NULL, PRIMARY KEY(`marker_id`), FOREIGN KEY(`marker_id`) REFERENCES `marker`(`id`) ON UPDATE NO ACTION ON DELETE RESTRICT )",
"fields": [
{
"fieldPath": "markerId",
"columnName": "marker_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "timestamp",
"columnName": "timestamp",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"marker_id"
]
},
"indices": [],
"foreignKeys": [
{
"table": "marker",
"onDelete": "RESTRICT",
"onUpdate": "NO ACTION",
"columns": [
"marker_id"
],
"referencedColumns": [
"id"
]
}
]
}
],
"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, '4758aac06395f9babe465ff1a1274632')"
]
}
}
Binary file modified app/src/main/assets/maps.db
Binary file not shown.
2 changes: 1 addition & 1 deletion app/src/main/java/ru/spbu/depnav/data/db/AppDatabase.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import ru.spbu.depnav.data.model.SearchHistoryEntry
MapInfo::class, Marker::class, MarkerText::class, MarkerTextFts::class,
SearchHistoryEntry::class
],
version = 7
version = 8
)
abstract class AppDatabase : RoomDatabase() {
/** DAO for the table containing information about the available maps. */
Expand Down
10 changes: 5 additions & 5 deletions data/jsons/spbu-mm.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"mapName": "spbu-mm",
"version": 7,
"version": 8,
"floorWidth": 8192,
"floorHeight": 4096,
"tileSize": 256,
Expand Down Expand Up @@ -375,7 +375,7 @@
},
{
"type": "STAIRS_UP",
"is_closed": true,
"is_closed": false,
"x": 4773,
"y": 866,
"ru": {
Expand Down Expand Up @@ -2480,7 +2480,7 @@
},
{
"type": "STAIRS_BOTH",
"is_closed": true,
"is_closed": false,
"x": 4773,
"y": 866,
"ru": {
Expand Down Expand Up @@ -5397,7 +5397,7 @@
},
{
"type": "STAIRS_BOTH",
"is_closed": true,
"is_closed": false,
"x": 4773,
"y": 866,
"ru": {
Expand Down Expand Up @@ -8216,7 +8216,7 @@
},
{
"type": "STAIRS_DOWN",
"is_closed": true,
"is_closed": false,
"x": 4773,
"y": 866,
"ru": {
Expand Down

0 comments on commit 93a505e

Please sign in to comment.