testfixtures icon indicating copy to clipboard operation
testfixtures copied to clipboard

Error loading string data

Open dowglaz opened this issue 3 years ago • 1 comments

I have the current data in the table creation:

amount varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL

and in the fixture file:

amount: "000000601"

When it loads the fixtures, for some unknown reason, it converts it to: 0000-06-01 00:00:00 -0659 LMT.

When I remove the quotes in the fixture file:

amount: 000000601

it converts correctly to a varchar.

However, I would like to keep being explicit about the data type by using quotes.

dowglaz avatar Dec 06 '22 20:12 dowglaz

Perhaps that value is implicitly casted to a time.Time in this code https://github.com/go-testfixtures/testfixtures/blob/98baced6f3905ea319026663731723f8612903d2/time.go#L8-L43

Removing this pattern would help, but I am worried about breaking a backward compatibility to this feature

slsyy avatar Jul 30 '24 15:07 slsyy