]> pd.if.org Git - zpackage/commitdiff
add table for file tags
authorNathan Wagner <nw@hydaspes.if.org>
Sun, 5 Mar 2017 14:57:54 +0000 (08:57 -0600)
committerNathan Wagner <nw@hydaspes.if.org>
Sun, 5 Mar 2017 15:05:15 +0000 (09:05 -0600)
db.sql

diff --git a/db.sql b/db.sql
index fab5b24752c99aae59417bfe07c379c7a3fa857f..75e5354809459683fda2c04872de6ebf04c1a0a1 100644 (file)
--- a/db.sql
+++ b/db.sql
@@ -5,6 +5,8 @@ PRAGMA user_version = 1;
 
 -- should be faster with rowid due to the blob content
 -- these are really just blobs of data
+-- TODO copyright and license information should probably
+-- go here
 CREATE TABLE files (
        hash text primary key,
                size integer,
@@ -16,9 +18,12 @@ CREATE TABLE files (
 -- information about packages
 -- a package is identified by a package,version,release triple
 create table packages (
+       -- primary key columns
        package text,
        version text, -- the upstream version string
        release integer, -- the local release number
+
+       -- metadata columns
        description     text,
        architecture    text,
        url     text,
@@ -45,15 +50,18 @@ create table packagefiles (
        groupname       text, -- group of owner
        uid     integer, -- numeric uid, generally ignored
        gid     integer, -- numeric gid, generally ignored
-       --filetype      integer default 0, -- 0 regular file, 1 directory, 2 symlink
-       -- regular file if null target and not null hash
-       -- except that we could not know the hash, or care
-       -- directory if null hash and null target
-       -- symlink if null hash and not null target
-       -- hard link if not null hash and not null target
-       -- device special files add dev number column
-       -- fifos add mode?  Can encode filetype in mode.
-       target  text, -- link target for symlinks
+       filetype varchar default 'r',
+       -- r regular file
+       -- d directory
+       -- s symlink
+       -- h hard link -- not supported
+       -- c character special and b device special files add dev number column
+       -- b block special
+       -- p fifos (i.e. pipe)
+       target  text, -- link target for links
+       -- device file dev numbers, should probably be a separate table
+       devmajor        integer,
+       devminor        integer,
        hash    text, -- null if no actual content, i.e. anything but a regular file
        mtime   integer, -- seconds since epoch, finer resolution probably not needed
        primary key (package,version,release,path),
@@ -62,6 +70,19 @@ create table packagefiles (
 without rowid
 ;
 
+create table packagefiletags (
+       -- package id triple
+       package text,
+       version text,
+       release integer,
+
+       path    text, -- filesystem path
+       tag     text,
+       primary key (package,version,release,path,tag)
+)
+without rowid
+;
+
 create table elfinfo (
        file    text, -- hash of blob
        elftype text,