Martijn Voncken wrote:
> Hi,
>
> See previous topic: "media database , smartplaylists,albumtree etc"
>
> The current schema I'm testing:
>
> create table media (mediaid integer primary key,medianame character);
> create table attr (attrid integer primary key,attrname character);
>
> create table file (fileid integer primary key
> ,mediaid integer default 0,dirid integer default null
> ,filename character,mtime integer default null
> ,url character unique,removable integer default 0,title character);
> create index ix_file_dirid on file (dirid);
> insert into file (fileid,dirid,filename,title,url)
> values(0,null,'','Root','file:///');
>
> create table file_attr (fileid integer,mediaid integer,attrid
> integer,value character);
> create unique index ix_file_attr on file_attr (fileid,attrid);
> create index ix_file_attr_media_val on file_attr (mediaid,attrid,value);
> /*
> note that unique and primary fields create an (invisible) index.
> dirid = fileid of parent directory.
> mediaid = {0:dir,1:image,etc..}
> */
I have no idea what you are talking about :)
So you have one table for a file and one for the attributes? Isn't
that slow? How do you get a list of all files in a dir?
Dischi, never created a database schema before
--
Unix is the worst operating system; except for all others.
-- Berry Kercheval
pgpW74cjFnGLF.pgp
Description: PGP signature
