Saltar al contenido ForoHackers

Rant: our date column is a string in three formats

Bases de datos
#956 · anónimo · · Denunciar

Not naming the employer. Not naming the system. Just venting.

be me new on a project, first week find the column created it is VARCHAR(20) contains 2019-03-02, 02/03/2019, and sometimes 20190302 02/03/2019 is March 2nd or February 3rd? depends on who typed it nobody knows the person who knew left in 2016 there is a nightly job at 03:00 that "fixes" the dates nobody knows what it fixes, only that if you turn it off reports go weird it is documented in a README that says only "do not touch"

I came here to write software and ended up as an archaeologist. At least the pottery is not on fire.

#1253 · anónimo · · Denunciar

"do not touch" README

Always the most informative documentation. Step one: copy the table, step two: log which rows the nightly job changes for a week. You will learn what it does by watching, like a nature documentary.

#1254 · anónimo · · Denunciar

Add a real DATE column next to it, fill it with a conversion that rejects ambiguous rows into a review table, and make the app write both for a while. Then drop the old one. Slow, boring, correct.

#1255 · anónimo · · Denunciar

Three formats is a luxury. I once had a column where the year was sometimes two digits, and they were different depending on the century of the person who typed it.

Firmar como fuente habitual (una clave guardada solo en este navegador)

Enviar tarda unos segundos aquí: tu navegador resuelve antes una prueba de trabajo contra el spam.

Responder