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

Date columns are only stored as date, not datetime #1

Closed
raphaelm opened this issue Sep 6, 2019 · 2 comments
Closed

Date columns are only stored as date, not datetime #1

raphaelm opened this issue Sep 6, 2019 · 2 comments
Labels
bug Something isn't working

Comments

@raphaelm
Copy link
Member

raphaelm commented Sep 6, 2019

No description provided.

@raphaelm raphaelm added the bug Something isn't working label Sep 6, 2019
@raphaelm
Copy link
Member Author

requery/requery#894
However, that is unfortunately vastly backwards-incompatible.

@raphaelm
Copy link
Member Author

raphaelm commented Feb 5, 2020

Okay, so here's the problem:

  • With Date, requery creates a TEXT column on SQLite where it stores the datetime in text, which is fine for our Android apps. However, on PostgreSQL it creates a DATE column which loses the time component.
  • With java.sql.Timestamp, starts storing Unix timestamps on SQLite, and who-knows-what on PostgreSQl.
  • The "clean" solution would probably be to convert all of libpretixsync to java.sql.Timestamp, although I really do not like storing Unix timestamps.
  • This would be very backwards-incompatible and we'd need to migrate the internal databases of all pretixSCAN and pretixPOS installations, which I would like to avoid for now.
  • Therefore, we'll make a special-case solution for the QueuedCheckIn model and explicitly store the datetime as text on all databases, which is absolutely good enough for our usecase.
  • However, that means that all other datetimes in libpretixsync stay unsafe on PostgreSQL for now!

raphaelm added a commit to pretix/libpretixsync that referenced this issue Feb 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant