added in DB tables for new face DB structures/links
This commit is contained in:
@@ -181,7 +181,6 @@ class DelFile(Base):
|
|||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return f"<file_eid: {self.file_eid}, orig_path_prefix={self.orig_path_prefix}>"
|
return f"<file_eid: {self.file_eid}, orig_path_prefix={self.orig_path_prefix}>"
|
||||||
|
|
||||||
|
|
||||||
class FileType(Base):
|
class FileType(Base):
|
||||||
__tablename__ = "file_type"
|
__tablename__ = "file_type"
|
||||||
id = Column(Integer, Sequence('file_type_id_seq'), primary_key=True )
|
id = Column(Integer, Sequence('file_type_id_seq'), primary_key=True )
|
||||||
@@ -229,6 +228,30 @@ class Refimg(Base):
|
|||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return f"<id: {self.id}, fname: {self.fname}, created_on: {self.created_on}, encodings: {self.encodings}>"
|
return f"<id: {self.id}, fname: {self.fname}, created_on: {self.created_on}, encodings: {self.encodings}>"
|
||||||
|
|
||||||
|
class Face(Base):
|
||||||
|
__tablename__ = "face"
|
||||||
|
id = Column(Integer, Sequence('face_id_seq'), primary_key=True )
|
||||||
|
face = Column( LargeBinary )
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
return f"<id: {self.id}, face={self.face}"
|
||||||
|
|
||||||
|
class FaceFileLink(Base):
|
||||||
|
__tablename__ = "face_file_link"
|
||||||
|
face_id = Column(Integer, ForeignKey("face.id"), primary_key=True )
|
||||||
|
file_eid = Column(Integer, ForeignKey("file.eid"), primary_key=True )
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
return f"<face_id: {self.face_id}, file_eid={self.file_eid}"
|
||||||
|
|
||||||
|
class FaceRefimgLink(Base):
|
||||||
|
__tablename__ = "face_refimg_link"
|
||||||
|
face_id = Column(Integer, ForeignKey("face.id"), primary_key=True )
|
||||||
|
refimg_id = Column(Integer, ForeignKey("refimg.id"), primary_key=True )
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
return f"<face_id: {self.face_id}, refimg_id={self.refimg_id}"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|||||||
13
tables.sql
13
tables.sql
@@ -49,6 +49,18 @@ create table FILE_REFIMG_LINK ( FILE_ID integer, REFIMG_ID integer, WHEN_PROCESS
|
|||||||
constraint FK_FRL_FILE_ID foreign key (FILE_ID) references FILE(EID),
|
constraint FK_FRL_FILE_ID foreign key (FILE_ID) references FILE(EID),
|
||||||
constraint FK_FRL_REFIMG_ID foreign key (REFIMG_ID) references REFIMG(ID) );
|
constraint FK_FRL_REFIMG_ID foreign key (REFIMG_ID) references REFIMG(ID) );
|
||||||
|
|
||||||
|
create table FACE( ID integer, FACE bytea, constraint PK_FACE_ID primary key(ID) );
|
||||||
|
|
||||||
|
create table FACE_FILE_LINK( FACE_ID integer, FILE_EID integer,
|
||||||
|
constraint PK_FFL_FACE_ID_FILE_ID primary key(FACE_ID, FILE_EID),
|
||||||
|
constraint FK_FFL_FACE_ID foreign key (FACE_ID) references FACE(ID) on delete cascade,
|
||||||
|
constraint FK_FFL_FILE_EID foreign key (FILE_EID) references FILE(EID) );
|
||||||
|
|
||||||
|
create table FACE_REFIMG_LINK( FACE_ID integer, REFIMG_ID integer,
|
||||||
|
constraint PK_FRL_FACE_ID_REFIMG_ID primary key(FACE_ID, REFIMG_ID),
|
||||||
|
constraint FK_FRL_FACE_ID foreign key (FACE_ID) references FACE(ID) on delete cascade,
|
||||||
|
constraint FK_FRL_REFIMG_ID foreign key (REFIMG_ID) references REFIMG(ID) );
|
||||||
|
|
||||||
create table PERSON_REFIMG_LINK ( PERSON_ID integer, REFIMG_ID integer,
|
create table PERSON_REFIMG_LINK ( PERSON_ID integer, REFIMG_ID integer,
|
||||||
constraint PK_PRL primary key(PERSON_ID, REFIMG_ID),
|
constraint PK_PRL primary key(PERSON_ID, REFIMG_ID),
|
||||||
constraint FK_PRL_PERSON_ID foreign key (PERSON_ID) references PERSON(ID),
|
constraint FK_PRL_PERSON_ID foreign key (PERSON_ID) references PERSON(ID),
|
||||||
@@ -72,6 +84,7 @@ create table PA_JOB_MANAGER_FE_MESSAGE ( ID integer, JOB_ID integer, ALERT varch
|
|||||||
constraint FK_PA_JOB_MANAGER_FE_MESSAGE_JOB_ID foreign key(JOB_ID) references JOB(ID) );
|
constraint FK_PA_JOB_MANAGER_FE_MESSAGE_JOB_ID foreign key(JOB_ID) references JOB(ID) );
|
||||||
|
|
||||||
create sequence PA_USER_ID_SEQ;
|
create sequence PA_USER_ID_SEQ;
|
||||||
|
create sequence FACE_ID_SEQ;
|
||||||
create sequence PATH_ID_SEQ;
|
create sequence PATH_ID_SEQ;
|
||||||
create sequence PATH_TYPE_ID_SEQ;
|
create sequence PATH_TYPE_ID_SEQ;
|
||||||
create sequence FILE_ID_SEQ;
|
create sequence FILE_ID_SEQ;
|
||||||
|
|||||||
Reference in New Issue
Block a user