Post #2360625
2026-05-10 20:02 UTC
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.
Replies (2)
-
@folekaule@lemmy.world 2026-05-10 21:02
That on delete cascade is evil. I love it.
-
@Baizey@feddit.dk 2026-05-11 00:08
Would this make 0 = true and 1 = false?