Dear database designer

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Dear database designer

Post by dandymcgee »

This is not how you assign a primary key:

Image
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
Nokurn
Chaos Rift Regular
Chaos Rift Regular
Posts: 164
Joined: Mon Jan 31, 2011 12:08 pm
Favorite Gaming Platforms: PC, SNES, Dreamcast, PS2, N64
Programming Language of Choice: Proper C++
Location: Southern California
Contact:

Re: Dear database designer

Post by Nokurn »

Mother of god. That's just asking for trouble. DId you fix it?
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: Dear database designer

Post by dandymcgee »

Nokurn wrote:Mother of god. That's just asking for trouble. DId you fix it?
I can't right now because my boss is on vacation and I don't know the details of what, if anything, accesses this table. It may just be a history table for our reference, as I don't know of any application that allows rolling back records. If that is the case, I'll remove all of the '_%TicketNumber%' suffixes from the pkBackupDate column and set (pkBackupDate, TicketNumber) to the primary key like it should be. There's a reason primary keys can span multiple columns and it's to prevent the need for this sort of silly "hashing" approach to creating a unique key.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
Post Reply