39

Working on a database priorly designed and maintained by some private agency.

The fuck I'm dealing with!

Boolean values stored as 'TRUE'/'FALSE'. It's varchar, my dudes.

There are no FK relations. Just the values of IDs in a column.

There are no indexes, all on just the PKs, nothing else. Nothing.

Null, what's that? I'm dealing with 'N/A', my dudes.

Unique key, what's that? The table which stores users has all the fields nullable. Email is not unique ( even though that's the required behaviour).

ALL the numeric values are stored as varchar. Varchar, my dudes. Varchar. '1', '1.1'

And finally, the good ole, 1 table to rule them all. Normalisation, fuck that.

And what's the root cause of all this? My PM used to hand them Excel sheets she maintains on her local system. FTW. I don't have a enough explanations.

Comments
  • 2
    At least there are primary keys... Sadly I once worked on a bit worse, but your case seems pretty well fucked up too! Take a deep breath and rewrite all that mess. Courage.
  • 3
    @batraman And an Indian "Product Manager"
  • 2
    @Masta wait, who doesn't put primary keys? That's illegal.
  • 2
    @Wack Actually, I already ranted about this : https://devrant.com/rants/738705/...

    There was a few table with primary keys, but not on all tables, and with no consistency at all: no naming convetion, no "id" columns here, but a different methodology on each table. For several tables the primary key was a grouped index made with 2 (or 3) random columns of the table, for some others tables it was whatever field you never think about as a primary key, and the remaining tables just had no primary key at all...

    My n+1, who created that mess and the ERP application who runs with it, had a perfect knowledge of the database as it was, and so he was satisfied with it. He never realized that his work was too stressfull partly because of this, and I struggled just to address the subject with him. The guy didn't understand utf-8, didn't even know what a unix timestamp is. Somewhere in the past, he had stopped learning.
  • 0
    (sorry for the few language mistakes, I always try to correct before I post, but my english is not perfect and sometimes I forget some. I wish it's possible to edit my comment...)
  • 3
    @Masta holy fuck, condolences
  • 1
    Dude, nothing makes me sadder that a badly designed database.

    The ERP system I support at work (not written by us) has about 3k tables and not a single FK to give you a clue about how they all link together.

    It’s a fucking nightmare
Add Comment