Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Migration to eat api #1422

Closed
wants to merge 113 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
ae4b566
Found a bug causing the cafeteria card to not be shown; Refactoring f…
Liqs-v2 Dec 8, 2021
c49652d
Added data classes used to deserialize eat-api response
Liqs-v2 Dec 8, 2021
e7b0e81
Updated API helpers to use eat-api
Liqs-v2 Dec 8, 2021
3db3f14
Refactored field for better readability
Liqs-v2 Dec 8, 2021
4c521ab
Updated cafeteria response to use the new data classes
Liqs-v2 Dec 10, 2021
9b16844
Moved deserialization POJOs into their own package
Liqs-v2 Dec 15, 2021
d3d416f
Fixed proguard bug, causing the deserialization to fail
Liqs-v2 Dec 15, 2021
6939b2f
Updated POJO imports
Liqs-v2 Dec 15, 2021
fef1ecc
Updated POJO to match eat-api after changes
Liqs-v2 Dec 22, 2021
a53f8e7
Added db migration to new table used for eat-api data; Updated deseri…
Liqs-v2 Jan 12, 2022
1e12de1
Increased version number to reflect changed schema
Liqs-v2 Jan 12, 2022
3b5662c
Fixed multiple bugs concerning Migration6to7.kt
Liqs-v2 Jan 12, 2022
f5488fb
Fixed bug regarding deserialization introduced when migrating db table
Liqs-v2 Jan 12, 2022
eaed9a8
Added new DB schema to git
Liqs-v2 Jan 12, 2022
a401e50
Added helper class for parsing eat-api data to database format
Liqs-v2 Jan 12, 2022
b237862
Updated DAO sql queries to work with new table
Liqs-v2 Jan 12, 2022
3d1e6ac
Added comments/documentation
Liqs-v2 Jan 12, 2022
d39b721
Updated queries to work with new table; Added documentation
Liqs-v2 Jan 12, 2022
06a7781
Updated CafeteriaMenu to work with new table
Liqs-v2 Jan 12, 2022
6399406
Added an enum for the cafeteriaIds
Liqs-v2 Jan 12, 2022
fd1c959
Refactored Cafeterias to CafeteriaLocation and change method naming
Liqs-v2 Jan 13, 2022
00164f6
Migrated CafeteriaLocalRepository.kt to use CafeteriaLocation and wor…
Liqs-v2 Jan 13, 2022
7e2628a
Migrated CafeteriaWithMenus.kt
Liqs-v2 Jan 13, 2022
d9a2829
Refactored method naming
Liqs-v2 Jan 17, 2022
0b65f1e
Added table migration for Cafeteria table
Liqs-v2 Jan 17, 2022
a8282b5
Added API deserialization POJOs for Cafeteria table
Liqs-v2 Jan 17, 2022
00c1f00
Added schema for db version 8 to git
Liqs-v2 Jan 17, 2022
d7a53e1
Updated Cafeteria entity to new cafeteriaId
Liqs-v2 Jan 17, 2022
e3e81b5
Fixed deserialization POJO datatypes
Liqs-v2 Jan 17, 2022
cf8ea7e
Updated CafeteriaLocalRepository.kt with parser for deserialized API …
Liqs-v2 Jan 17, 2022
176611f
Refactored CafeteriaLocation.kt; Added another helper method to gener…
Liqs-v2 Jan 17, 2022
f44da1e
Refactored EatAPIParser.kt method name, which is used in CafeteriaMen…
Liqs-v2 Jan 17, 2022
f1111fb
Added second parsing method for CafeteriaMetadata.kt to EatAPIParser.kt
Liqs-v2 Jan 17, 2022
d3a36a8
Refactored TUMCabe to fetch data for the Cafeteria db table from EatAPI
Liqs-v2 Jan 17, 2022
6c12cee
Migrated CafeteriaDao to new table and id datatype
Liqs-v2 Jan 19, 2022
c3e1df1
Update documentation
Liqs-v2 Jan 19, 2022
6e4631f
Migrated to androidx PreferenceManager; Migrated to CafeteriaLocation
Liqs-v2 Jan 19, 2022
619febb
Migrated CafeteriaManager to CafeteriaLocation (new Cafeteria id and …
Liqs-v2 Jan 19, 2022
282e164
Migrated CafeteriaMenuCard to CafeteriaLocation; Migrated PreferenceM…
Liqs-v2 Jan 19, 2022
80aab46
Updated cafeteria settings default value to reflect new Cafeteria id
Liqs-v2 Jan 19, 2022
d79c347
Migrated CafeteriaDetailsSectionFragment.kt and CafeteriaDetailsSecti…
Liqs-v2 Jan 20, 2022
1394ffa
Migrated CafeteriaViewModel.kt to new table and CafeteriaLocation id
Liqs-v2 Jan 20, 2022
5d87e05
Migrated MensaRemoteViewFactory.kt to CafeteriaLocation and new table
Liqs-v2 Jan 20, 2022
5499788
Migrated CafeteriaFragment.kt to CafeteriaLocation.kt and new table
Liqs-v2 Jan 20, 2022
a466e26
Migrating CafeteriaMenusAdapter.kt to CafeteriaLocation.kt and new table
Liqs-v2 Jan 20, 2022
d5c69a4
Reintroduced some fields that were mistakenly deleted
Liqs-v2 Jan 20, 2022
76e8914
Moved EatAPI endpoint to the per calendarWeek and cafeteria one, inst…
Liqs-v2 Jan 20, 2022
4045fa5
Refactored deserialization POJOs to allow usage of lazy fetching per …
Liqs-v2 Jan 20, 2022
8f3ed56
Refactored EatAPIParser in preparation for lazy fetching (uses dummy …
Liqs-v2 Feb 4, 2022
9e54c7c
Refactored Cafeteria entity and CafeteriaMetadata POJO for soft DB mi…
Liqs-v2 Feb 4, 2022
4d4cab3
Refactored Migration7to8.kt to a soft migration
Liqs-v2 Feb 4, 2022
afac8d6
Updated DB schema
Liqs-v2 Feb 4, 2022
73a0dfe
Reverted CafeteriaDetailsSectionFragment.kt to use int cafeteriaId
Liqs-v2 Feb 4, 2022
86ba4ce
Reverted CafeteriaWithMenus.kt to use int cafeteriaId
Liqs-v2 Feb 4, 2022
a5d1404
Reverted CafeteriaViewModel.kt to use int cafeteriaId
Liqs-v2 Feb 4, 2022
eba3dbc
Refactored CafeteriaLocalRepository.kt to use int cafeteriaId
Liqs-v2 Feb 4, 2022
a41c53d
Consolidated DB migrations needed for eat-api migration
Liqs-v2 Feb 7, 2022
703b840
Reintroduced constant needed for int cafeteriaId
Liqs-v2 Feb 7, 2022
e3a6a55
Refactored table fields for clearer naming
Liqs-v2 Feb 7, 2022
163bd8b
Fixed bug causing the request for the menus of a cafeteria to return …
Liqs-v2 Feb 7, 2022
e41d4f2
Refactored CafeteriaDao to int cafeteriaId
Liqs-v2 Feb 7, 2022
c33ea6d
Refactored CafeteriaFragment to int cafeteriaId
Liqs-v2 Feb 7, 2022
4aff455
Refactored CafeteriaDetailsSectionFragment to int cafeteriaId
Liqs-v2 Feb 7, 2022
5ed42e0
Refactored CafeteriaDetailsSectionsPagerAdapter to int cafeteriaId
Liqs-v2 Feb 7, 2022
65e9d67
Refactored CafeteriaLocalRepository to int cafeteriaId
Liqs-v2 Feb 7, 2022
d47b541
Refactored helpers method for clearer naming and return values
Liqs-v2 Feb 7, 2022
cf3ec13
Refactored CafeteriaMenuManager for int cafeteriaId
Liqs-v2 Feb 7, 2022
c402602
Refactored CafeteriaMenuCard to int cafeteriaId
Liqs-v2 Feb 7, 2022
c34ca07
Refactored CafeteriaMenuDao to int cafeteriaId and new table field na…
Liqs-v2 Feb 7, 2022
15b58e2
Improved error handling and debugging info provided; Refactored Cafet…
Liqs-v2 Feb 7, 2022
7f36e00
Refactored POJO field name to match refactored table field names
Liqs-v2 Feb 7, 2022
abb8c29
Refactored EatAPIParser to reflect changes in POJO and DB table field…
Liqs-v2 Feb 7, 2022
3c07f52
Refactored to int cafeteriaId and to reflect changes in DB table fiel…
Liqs-v2 Feb 7, 2022
ead49ab
Improved documentation in OpenHoursHelper
Liqs-v2 Feb 7, 2022
e3845e6
Expanded edge case handling; Refactored for better readability
Liqs-v2 Feb 8, 2022
a5cc34c
Added a const as workaround for low project SDK version
Liqs-v2 Feb 8, 2022
70f1d68
Moved getIdFrom(cafeteriaSlug) into CafeteriaDao
Liqs-v2 Feb 8, 2022
412e176
Fixed bug causing getCafeteria to fail
Liqs-v2 Feb 8, 2022
9612916
Updated hardcoded preference mappings to cafeteria slugs
Liqs-v2 Feb 8, 2022
23ef260
Removed schema 8, as the consolidation of migrations will leave the D…
Liqs-v2 Feb 8, 2022
96b7cd7
Fixed bug causing cafeterias to be repeatedly inserted into the db
Liqs-v2 Feb 8, 2022
69a964f
Updated cafeteriaMenu db table and dependencies, due to a semantic mi…
Liqs-v2 Feb 8, 2022
71dc5d7
Removed TODO of false positive for bug
Liqs-v2 Feb 8, 2022
071eb55
Changed default value to always display menus while working on this
Liqs-v2 Feb 8, 2022
5ae3897
Refactored to facilitate lazy fetching
Liqs-v2 Feb 9, 2022
2670ceb
Improved documentation; Added query getSlugFrom(cafeteriaId:Int):String
Liqs-v2 Feb 9, 2022
0f1aed8
Refactored CafeteriaDetailsSectionFragment to facilitate lazy fetching
Liqs-v2 Feb 9, 2022
ffd8b68
CafeteriaDownloadAction no longer fetches CafeteriaMenus
Liqs-v2 Feb 9, 2022
5f716a3
Removed fixed TODO and unused import
Liqs-v2 Feb 9, 2022
0b7a550
Added hasNoMenusFor to allow for dynamic fetching from local or remot…
Liqs-v2 Feb 9, 2022
3630b60
Removed handled TODO
Liqs-v2 Feb 9, 2022
00437e1
Fixed bug in old query caused by migration; Added hasMenusFor query
Liqs-v2 Feb 9, 2022
f06dfb7
Removed old methods for handling cafeteria menu downloads via Cafeter…
Liqs-v2 Feb 9, 2022
76dbea2
Added methods used for lazy fetching
Liqs-v2 Feb 9, 2022
8d56544
Refactored fetchCafeteriaMenus, to dynamically fetch from local or re…
Liqs-v2 Feb 9, 2022
4793037
Removed TODO
Liqs-v2 Feb 9, 2022
1791eec
Refactored parseCafeteriaMenuFrom to be fully dynamic and compatible …
Liqs-v2 Feb 9, 2022
d06750e
Fixed bug causing the application to crash when selecting certain caf…
Liqs-v2 Feb 9, 2022
91dedc0
Added bugfix for cafeteria menus not being fetched from remote reposi…
Liqs-v2 Feb 10, 2022
b8ef560
Added helper method to facilitate bugfix causing cafeteria menus to n…
Liqs-v2 Feb 10, 2022
b891285
Update method signature due to lazy fetching changes
Liqs-v2 Feb 10, 2022
637cd06
Formatting
Liqs-v2 Feb 10, 2022
a848d18
Fixed bug, causing menus to never be cached
Liqs-v2 Feb 27, 2022
d409217
Reintroduced cache behaviour
Liqs-v2 May 12, 2022
8668d20
Fixed warnings and removed todos
Liqs-v2 May 12, 2022
83e5d07
Fixed bugs caused by migration
Liqs-v2 May 12, 2022
93a1ea2
Added TODO for migration
Liqs-v2 May 12, 2022
cc668d0
Removed TODO
Liqs-v2 Jun 18, 2022
52860d8
Identified position for potential fix for CafeteriaCard not showing menu
Liqs-v2 Jun 18, 2022
a45bd6e
Attempting to fix bug causing Cafeteria Card to not be showing menus
Liqs-v2 Jun 18, 2022
4279ee9
Removed unused method stub
Liqs-v2 Jun 18, 2022
c15dce1
Removed code used for debugging
Liqs-v2 Jul 2, 2022
edf9aca
Identical contents, but stashing doesnt work
Liqs-v2 Jul 2, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified .idea/inspectionProfiles/Project_Default.xml
100755 → 100644
Empty file.
57 changes: 29 additions & 28 deletions app/schemas/de.tum.in.tumcampusapp.database.TcaDb/6.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,12 @@
"formatVersion": 1,
"database": {
"version": 6,
"identityHash": "f743f786b0866afd26a4cc1c1fafc8d1",
"identityHash": "07b6e7b518ae4df546549d9a64c87963",
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I know, existing migrations should not be changed. Could you have another look into why this was changed?

"entities": [
{
"tableName": "Cafeteria",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`distance` REAL NOT NULL, `id` INTEGER NOT NULL, `name` TEXT NOT NULL, `address` TEXT NOT NULL, `latitude` REAL NOT NULL, `longitude` REAL NOT NULL, PRIMARY KEY(`id`))",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT NOT NULL, `address` TEXT NOT NULL, `latitude` REAL NOT NULL, `longitude` REAL NOT NULL, `distance` REAL NOT NULL, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "distance",
"columnName": "distance",
"affinity": "REAL",
"notNull": true
},
{
"fieldPath": "id",
"columnName": "id",
Expand Down Expand Up @@ -43,6 +37,12 @@
"columnName": "longitude",
"affinity": "REAL",
"notNull": true
},
{
"fieldPath": "distance",
"columnName": "distance",
"affinity": "REAL",
"notNull": true
}
],
"primaryKey": {
Expand All @@ -56,7 +56,7 @@
},
{
"tableName": "CafeteriaMenu",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `cafeteriaId` INTEGER NOT NULL, `date` TEXT, `typeShort` TEXT NOT NULL, `typeLong` TEXT NOT NULL, `typeNr` INTEGER NOT NULL, `name` TEXT NOT NULL)",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `cafeteriaId` TEXT NOT NULL, `date` TEXT, `dishType` TEXT NOT NULL, `name` TEXT NOT NULL, `labels` TEXT NOT NULL, `calendarWeek` INTEGER NOT NULL)",
"fields": [
{
"fieldPath": "id",
Expand All @@ -67,7 +67,7 @@
{
"fieldPath": "cafeteriaId",
"columnName": "cafeteriaId",
"affinity": "INTEGER",
"affinity": "TEXT",
"notNull": true
},
{
Expand All @@ -77,27 +77,27 @@
"notNull": false
},
{
"fieldPath": "typeShort",
"columnName": "typeShort",
"fieldPath": "dishType",
"columnName": "dishType",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "typeLong",
"columnName": "typeLong",
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "typeNr",
"columnName": "typeNr",
"affinity": "INTEGER",
"fieldPath": "labels",
"columnName": "labels",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"fieldPath": "calendarWeek",
"columnName": "calendarWeek",
"affinity": "INTEGER",
"notNull": true
}
],
Expand Down Expand Up @@ -760,14 +760,8 @@
},
{
"tableName": "eventSeriesMappings",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `seriesId` TEXT NOT NULL, `eventId` TEXT NOT NULL)",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`seriesId` TEXT NOT NULL, `eventId` TEXT NOT NULL, `id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL)",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "seriesId",
"columnName": "seriesId",
Expand All @@ -779,6 +773,12 @@
"columnName": "eventId",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
Expand Down Expand Up @@ -1049,6 +1049,7 @@
"columnNames": [
"symbol"
],
"orders": [],
"createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_transport_favorites_symbol` ON `${TABLE_NAME}` (`symbol`)"
}
],
Expand Down Expand Up @@ -1223,7 +1224,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, 'f743f786b0866afd26a4cc1c1fafc8d1')"
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '07b6e7b518ae4df546549d9a64c87963')"
]
}
}
Loading