diff --git a/core/sql/0001_initial_schema.sql b/core/sql/0001_initial_schema.sql index 1641210..a80e9a3 100644 --- a/core/sql/0001_initial_schema.sql +++ b/core/sql/0001_initial_schema.sql @@ -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,