Skip to content

DATETIME is not compatible with TIMESTAMP in MySQL #355

@jimiherk

Description

@jimiherk

Description of the bug

When creating the tables in my MySQL Database, for some reason the created_at and visited_at are assigned the type "timestamp".
According to the code (and Error Message) they are supposed to have the type DateTime though.
This produces the following Error message in the API:
2025-06-12T10:36:49.472793Z ERROR crabfit_api::errors: e=DbErr(Query(SqlxError(ColumnDecode { index: "\"created_at\"", source: "mismatched types; Rust type `core::option::Option<chrono::naive::datetime::NaiveDateTime>` (as SQL type `DATETIME`) is not compatible with SQL type `TIMESTAMP`" })))

To reproduce

  1. Run API using sql-adaptor
  2. Use empty MySQL Database
  3. Try to create an event using the frontend

Expected behavior

The event should be created.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions