300
: ( (lemmy.dbzer0.com)
you are viewing a single comment's thread
view the rest of the comments
[-] TootSweet@lemmy.world 60 points 3 days ago
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.

[-] folekaule@lemmy.world 43 points 3 days ago

That on delete cascade is evil. I love it.

[-] Baizey@feddit.dk 21 points 3 days ago

Would this make 0 = true and 1 = false?

[-] TootSweet@lemmy.world 31 points 3 days ago

You're right, that's way too simple. Definitely need to rotate the booleans daily. For... security. Yeah, security.

this post was submitted on 10 May 2026
300 points (99.0% liked)

Programmer Humor

31384 readers
819 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS