Add check constraints to ensure names aren't empty

This commit is contained in:
Tim Van Baak 2025-02-20 16:07:06 -08:00
parent c8bdf0f4b2
commit c22ab7b5b4

View File

@ -2,21 +2,24 @@ create table sources(
name text not null,
state blob,
lastUpdated int not null,
primary key (name)
primary key (name),
check (name <> '')
) strict;
create table actions(
source text not null,
name text not null,
argv blob not null,
unique (source, name) on conflict replace,
foreign key (source) references sources (name) on delete cascade
foreign key (source) references sources (name) on delete cascade,
check (name <> '')
) strict;
create table envs(
source text not null,
name text not null,
value text not null,
unique (source, name) on conflict replace,
foreign key (source) references sources (name) on delete cascade
foreign key (source) references sources (name) on delete cascade,
check (name <> '')
) strict;
create table items(
source text not null,
@ -33,13 +36,15 @@ create table items(
tts int,
action blob,
primary key (source, id),
foreign key (source) references sources (name) on delete cascade
foreign key (source) references sources (name) on delete cascade,
check (id <> '')
) strict;
create table channels(
name text not null,
source text not null,
unique (name, source) on conflict replace
foreign key (source) references sources (name) on delete cascade
foreign key (source) references sources (name) on delete cascade,
check (name <> '')
) strict;
create table password(
id int not null,