59

Poorly designed databases be like

VARCHAR VARCHAR VARCHAR VARCHAR VARCHAR

Comments
  • 4
    Umm...errr...well... That is how I did all my sqlite databases... Because it doesn't enforce data types...
  • 6
    @Demolishun Booo dynamic typing
  • 11
    database.txt
  • 3
    @hack

    string dbfilename “database.csv”
    char separator ‘\t’
  • 4
  • 4
    public static object[] Data;
  • 3
    TEXT TEXT TEXT
  • 4
    BLOB BLOB BLOB
  • 2
    VARCHAR NVARCHAR VARCHAR NVARCHAR
  • 7
    My boss actually tried to convince me it's OK to put a column of "extra fields" as json in mssql. We didn't even work with json at the time
  • 1
    @hubiruchi I thought "extra fields" were done with a new table with a foreign key...
  • 4
    @Demolishun Extra fields are done by properly redoing the schema with a migration plan... or by simply using the functions all major DBMSs provide to add fields...
  • 0
    No poorly designed database is when your team takes NoSql literally so the "schema" is always changing and you never know whether a field is expected or not or how to search for things...
  • 0
    Wait guess that's like varchar....
  • 3
    @hubiruchi
    At one company we had a VARCHAR(max) that was xml data.
  • 1
    add = {‘name’: ‘Xalys’, ‘creditcard’: ‘’}
    with rev(open(file, ‘w+’)) as f:
    for line in f:
    if f != add:
    continue
    else:
    f.write(‘%s\n’ % add)

    I made a banking system
  • 1
    @hubiruchi I do have an `additionalData` field, which is JSON in one table, but just because every entry in that field can Gold about 4 known keys and as much other key value pairs as the user deams appropriate.

    Since you can't search by that data or anything and it's only used to display whatever crap they put in, plus there's no index on that field, I don't really care.

    Sure I could have an additional data table and a foreign key field pointing to it. Having the 4 known keys as Volumens and then either another table with key value and a foreign key to the extra data table or just the JSON fuckery in there, but I don't really see the point.

    How would you solve this? Additional info: as we remove old entries after a certain period of time, the table has at most 6'000 entries of which maybe halbe have the sadditional data stuff set. They get retrived by two other fields in that row (for which we have an Index)
Add Comment