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

Store author/committer date as DATETIME instead of VARCHAR #33

Open
brianwarner opened this issue Apr 1, 2019 · 3 comments
Open

Store author/committer date as DATETIME instead of VARCHAR #33

brianwarner opened this issue Apr 1, 2019 · 3 comments

Comments

@brianwarner
Copy link
Owner

Per @sgoggins' request, this feature would alter the tables to store the committer and author dates in a DATETIME column instead of VARCHAR. The context of the original decision is that the date info comes in as text from git log, and there wasn't any reason to do it otherwise. So, basically, laziness on my part...

Sean now has a reason, so this issue will track the downstream consequences of storing this commit data as a DATETIME. At minimum, it will require:

  • Changing the column definitions for data and cache tables in setup.py
  • Adding a clause to the function update_db() in facade-worker.py so that existing instances are properly updated
  • Making sure everything displays properly in the web and cli views
  • A new major release.

There are a few ways to do this. One is to alter the analysis_data table in-place, and force a recreation of the data. Another way is to split this data out separately (this appears preferable, as it will come with other benefits, and is tracked in a different issue).

@chrisinmtown
Copy link

chrisinmtown commented Apr 13, 2020

Please consider using TIMESTAMP in Mysql which represents a well defined point in time unambiguously just as the git log data does -- both include a timezone offset.

@brianwarner
Copy link
Owner Author

Thanks! Is there a reason to prefer this over DATETIME?

@chrisinmtown
Copy link

chrisinmtown commented Apr 13, 2020

I tried to give my reasoning above. DATETIME is old, TIMESTAMP is an improvement, but with that said, still can cause confusion.

FWIW there are ENORMOUS discussions on this topic in stackoverflow. For example https://stackoverflow.com/questions/31761047/what-difference-between-the-date-time-datetime-and-timestamp-types/56138746

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants