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

Change "time" column to use DATETIME type #1

Open
mefranklin6 opened this issue Sep 17, 2024 · 0 comments
Open

Change "time" column to use DATETIME type #1

mefranklin6 opened this issue Sep 17, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@mefranklin6
Copy link
Owner

The "time" column should probably be using the MySQL "DATETIME" type instead of "VARCHAR(255)" type (storing the date as a string) to improve database queries.

Workaround: cast the "time" column to to date in queries like:

SELECT * FROM sometable
WHERE DATE(STR_TO_DATE(time, '%Y-%m-%dT%H:%i:%s')) = CURDATE();
@mefranklin6 mefranklin6 added the enhancement New feature or request label Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant