small renames of id to eid, added num_files to DIR and removed comments

This commit is contained in:
2021-01-19 23:32:47 +11:00
parent 3a73b9546d
commit 1c181668e8

View File

@@ -12,35 +12,14 @@ create table NEW_FILE ( EID integer, SIZE_MB integer, HASH varchar(34), THUMBNAI
constraint PK_FILE_ID primary key(EID),
constraint FK_FILE_ENTRY_ID foreign key (EID) references ENTRY(ID) );
create table DIR ( EID integer, PATH_PREFIX varchar(256),
constraint PK_DIR_ID primary key(EID),
create table DIR ( EID integer, PATH_PREFIX varchar(256), NUM_FILES integer,
constraint PK_DIR_EID primary key(EID),
constraint FK_DIR_ENTRY_ID foreign key (EID) references ENTRY(ID) );
create table ENTRY_DIR_LINK ( entry_id integer, dir_eid integer,
constraint PK_EDL_entry_id_dir_eid primary key (entry_id, dir_eid),
constraint FK_EDL_ENTRY_ID foreign key (ENTRY_ID) references ENTRY(ID),
constraint FK_EDL_DIR_ID foreign key (DIR_EID) references DIR(EID) );
-- ENTRY( 1, 'images_to_process', D)
-- ENTRY( 2, 'IMG_9289.JPG', F )
-- ENTRY( 3, 'IMG_9289.JPG', F )
-- ENTRY( 4, 'TEST', D )
-- ENTRY( 5, 'a.jpg', F ) ; -- in TEST/
-- ENTRY( 6, 'new_img_dir/', F )
-- ENTRY( 7, 'b.jpg', F ) ; -- in new_img_dir/
--
-- DIR( 1, 'static/images_to_process/'
-- NEW_FILE( 3, size, hash, thumb )
-- DIR( 4, 'static/images_to_process/TEST/'
-- NEW_FILE( 5, size, hash, thumb )
-- DIR( 6, 'static/new_img_dir/'
-- NEW_FILE( 7, size, hash, thumb )
--
-- DIR, ENTRY ( 1, 2 )
-- DIR, ENTRY ( 1, 3 )
-- DIR, ENTRY ( 1, 4 )
-- DIR, ENTRY ( 4, 5 )
-- DIR, ENTRY ( 6, 7 )
constraint FK_EDL_DIR_EID foreign key (DIR_EID) references DIR(EID) );
create table file( id integer, name varchar(128), size_MB integer, type varchar(20), path_prefix varchar(256), hash varchar(34), thumbnail varchar,
constraint pk_photos_id primary key(id) );