irelephant [he/him]@lemmy.dbzer0.com to Programmer Humor@programming.dev · 12 hours ago: (lemmy.dbzer0.comimagemessage-square24fedilinkarrow-up1203arrow-down12
arrow-up1201arrow-down1image: (lemmy.dbzer0.comirelephant [he/him]@lemmy.dbzer0.com to Programmer Humor@programming.dev · 12 hours agomessage-square24fedilink
minus-squareTootSweet@lemmy.worldlinkfedilinkEnglisharrow-up36·10 hours agocreate table boolean ( id integer primary key, name text not null unique ) insert into boolean (name) values ('true'); insert into boolean (name) values ('false'); create table document ( id integer primary key, name text not null unique, body text not null, is_archived not null integer, foreign key (is_archived) references boolean (id) on delete cascade on update no action ); Solved. Bonus: DBAs hate this one weird trick that can free up incredible amounts of disk space by deleting just two rows.
minus-squareBaizey@feddit.dklinkfedilinkarrow-up13·6 hours agoWould this make 0 = true and 1 = false?
minus-squareTootSweet@lemmy.worldlinkfedilinkEnglisharrow-up11·6 hours agoYou’re right, that’s way too simple. Definitely need to rotate the booleans daily. For… security. Yeah, security.
minus-squarefolekaule@lemmy.worldlinkfedilinkarrow-up24·9 hours agoThat on delete cascade is evil. I love it.
create table boolean ( id integer primary key, name text not null unique ) insert into boolean (name) values ('true'); insert into boolean (name) values ('false'); create table document ( id integer primary key, name text not null unique, body text not null, is_archived not null integer, foreign key (is_archived) references boolean (id) on delete cascade on update no action );Solved.
Bonus: DBAs hate this one weird trick that can free up incredible amounts of disk space by deleting just two rows.
Would this make 0 = true and 1 = false?
You’re right, that’s way too simple. Definitely need to rotate the booleans daily. For… security. Yeah, security.
That
on delete cascadeis evil. I love it.