foreign key (package,version,release) references packages (package,version,release) on delete cascade on update cascade,
check (not (filetype = 'l' and target is null)),
check (not (filetype = 'r' and hash is null)),
- check (not (filetype = 'c' and (devmajor is null or devminor is null)))
+ check (not (filetype = 'c' and (devmajor is null or devminor is null))),
+ check (not (filetype = 'b' and (devmajor is null or devminor is null))),
+ check (configuration = 0 or configuration = 1)
)
without rowid
;
from packagefiles
;
+create trigger packagefiles_update_trigger instead of
+update on packagefiles_pkgid
+begin
+ update packagefiles
+ set package = NEW.package,
+ version = NEW.version,
+ release = NEW.release,
+ path = NEW.path,
+ mode = NEW.mode,
+ username = NEW.username,
+ groupname = NEW.groupname,
+ uid = NEW.uid,
+ gid = NEW.gid,
+ configuration = NEW.configuration,
+ filetype = NEW.filetype,
+ target = NEW.target,
+ devmajor = NEW.devmajor,
+ devminor = NEW.devminor,
+ hash = NEW.hash,
+ mtime = NEW.mtime
+ where package = OLD.package
+ and version = OLD.version
+ and release = OLD.release
+ and path = OLD.path
+ ;
+end
+;
+
create view installed_ref_count as
select I.path, count(*) as refcount
from installedfiles I
create table elfinfo (
file text primary key, -- hash of blob
- elftype text,
- foreign key (file) references files on delete cascade
+ elftype text
)
without rowid
;
file text,
soname text,
dependency text,
- primary key (file, soname, dependency),
- foreign key (file) references files on delete cascade
+ primary key (file, soname, dependency)
)
without rowid
;
-- and just hash, not package?
create table elflibraries (
file text primary key,
- soname text,
- foreign key (file) references files on delete cascade
+ soname text
)
without rowid
;
create table elfneeded (
file text,
needed text, -- soname of dependency
- primary key (file, needed),
- foreign key (file) references files on delete cascade
+ primary key (file, needed)
)
without rowid
;