Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from "id" to "guid" #350

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Conversation

johnjohndoe
Copy link
Member

@johnjohndoe johnjohndoe commented Dec 23, 2020

Description

⚠️ !!! ATTENTION !!! This change is NOT compatible to UPDATE exiting apps! ⚠️

This branch contains the following changes:

  • Migrate from id to guid.
  • Reset all database tables.
  • Ensure sessions have unique guid values.

Test scenarios

The following use cases have been identified as important to test with regards to the changes made in this pull request.

  • Automatic schedule updates
  • Release build + installation
  • Scheduling and discarding session alarms
  • Scheduling session alarms, consuming notifications
  • Sharing a session
  • Exporting a session to a calendar app
  • Load Engelsystem shifts

Testing

  • in progress 🚧

Resolves #319

@johnjohndoe johnjohndoe added Feature request A request for a new feature. Architecture Notifications System notifications for session alarms or schedule updates labels Dec 23, 2020
cketti
cketti previously approved these changes Dec 24, 2020
Copy link
Collaborator

@cketti cketti left a comment

Choose a reason for hiding this comment

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

LGTM 👍


private static final String SESSIONS_TABLE_CREATE =
"CREATE TABLE " + SessionsTable.NAME + " (" +
BaseColumns._ID + " INTEGER PRIMARY KEY AUTOINCREMENT," +
Columns.SESSION_ID + " TEXT, " +
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should use this opportunity to remove the SESSION_ID column from the database.

@johnjohndoe johnjohndoe mentioned this pull request Dec 24, 2020
11 tasks
@johnjohndoe johnjohndoe force-pushed the id-guid-minimal-migration branch 2 times, most recently from 74e46d4 to 1749388 Compare December 28, 2020 13:25
@johnjohndoe johnjohndoe force-pushed the id-guid-minimal-migration branch 2 times, most recently from 4fce673 to c5e3e02 Compare August 3, 2021 18:43
@johnjohndoe johnjohndoe force-pushed the id-guid-minimal-migration branch 2 times, most recently from 8a257c6 to d64ff82 Compare December 21, 2021 17:33
@github-actions
Copy link

github-actions bot commented Apr 8, 2022

Unit Test Results

0 tests  ±0   0 ✔️ ±0   0s ⏱️ ±0s
0 suites ±0   0 💤 ±0 
0 files   ±0   0 ±0 

Results for commit 04d5466. ± Comparison against base commit 4fd2afe.

♻️ This comment has been updated with latest results.

@johnjohndoe johnjohndoe force-pushed the id-guid-minimal-migration branch 2 times, most recently from 8c78fb6 to 14ab9b1 Compare September 22, 2022 20:37
@johnjohndoe johnjohndoe force-pushed the id-guid-minimal-migration branch 2 times, most recently from 7717fc3 to ae992cc Compare December 22, 2022 22:11
@johnjohndoe johnjohndoe force-pushed the id-guid-minimal-migration branch 2 times, most recently from 71350ab to bc71a30 Compare April 21, 2023 07:24
!!! ATTENTION !!! This change is NOT compatible to UPDATE exiting apps!

+ As of this commit the "id" XML attribute is no longer used as the unique
  token because its value cannot be guaranteed to be unique by the provider
  of the schedule XML. See voc/schedule#63.
+ Instead the "guid" XML attribute is used which guarantees unique values.
+ To keep this migration to a minimum only the value of the Session#sessionId
  field is changed. The value of the new primary key (auto-incrementing,
  unique through the "guid" column) is written into the "sessionId" field
  when a Session is queried from the database. See SessionsDatabaseRepository.
+ By this the value of the "id" XML attribute becomes unused hence the
  deprecation of the SESSION_ID database column.
!!! ATTENTION !!! This change is NOT compatible to UPDATE exiting apps!

+ This reset is possible and needed because the former commit is
  incompatible with current installations.
+ Improve a few table and column names.
+ Non-unique session will be discarded without telling the user.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Architecture Feature request A request for a new feature. Notifications System notifications for session alarms or schedule updates
Development

Successfully merging this pull request may close these issues.

Migrate from id to guid
2 participants