@ -607,10 +607,10 @@ def create_image(cur, base64Image, date):
imageId = verifyImage ( cur , decImage )
imageId = verifyImage ( cur , decImage )
if not imageId :
if not imageId :
imageId = int ( getLastImage ( cur ) + 1 )
newImage = True
imageId = int ( getLastImage ( cur ) + 1 )
newImage = True
else :
else :
newImage = False
newImage = False
if newImage :
if newImage :
@ -660,8 +660,8 @@ def create_database(cur, con):
try :
try :
sql = " create table forum_images(image_id integer not null, hash_image character varying(64) not null, base64_image character varying(10000000) not null, " \
" resnet50_image character varying(1000000) null, siftkey_image character varying(1000000) null, siftdesc_image character varying(1000000) null, " \
sql = " create table forum_images(image_id integer not null, hash_image character varying(64) not null, base64_image text not null, " \
" resnet50_image text null, siftkey_image text null, siftdesc_image text null, " \
" dateinserted_image timestamp(6) with time zone not null, " \
" dateinserted_image timestamp(6) with time zone not null, " \
" constraint forum_images_pk primary key (image_id)) "
" constraint forum_images_pk primary key (image_id)) "
cur . execute ( sql )
cur . execute ( sql )
@ -685,7 +685,7 @@ def create_database(cur, con):
sql = " create table users (user_id integer NOT NULL, forum_id integer NOT NULL, name_user character varying( " \
sql = " create table users (user_id integer NOT NULL, forum_id integer NOT NULL, name_user character varying( " \
" 255) NOT NULL, status_user character varying(255) null, reputation_user character varying(255) null, " \
" 255) NOT NULL, status_user character varying(255) null, reputation_user character varying(255) null, " \
" interest_user character varying(5000) null, signature_user character varying(1 000) null, " \
" interest_user character varying(10000) null, signature_user character varying(10 000) null, " \
" image_user integer null, dateinserted_user timestamp(6) with time zone NOT NULL, " \
" image_user integer null, dateinserted_user timestamp(6) with time zone NOT NULL, " \
" constraint users_pk primary key (user_id), " \
" constraint users_pk primary key (user_id), " \
" constraint users_forum_id_fk foreign key (forum_id) references forums (forum_id), " \
" constraint users_forum_id_fk foreign key (forum_id) references forums (forum_id), " \
@ -697,8 +697,8 @@ def create_database(cur, con):
sql = " create table users_history(user_id integer NOT NULL, version_user integer not null, forum_id integer NOT NULL, " \
sql = " create table users_history(user_id integer NOT NULL, version_user integer not null, forum_id integer NOT NULL, " \
" name_user character varying(255) NOT NULL, status_user character varying(255) null, " \
" name_user character varying(255) NOT NULL, status_user character varying(255) null, " \
" reputation_user character varying(255) null, interest_user character varying(5 000) null, " \
" signature_user character varying(1000) null, image_user integer null, " \
" reputation_user character varying(255) null, interest_user character varying(10 000) null, " \
" signature_user character varying(10000 ) null, image_user integer null, " \
" dateinserted_user timestamp(6) with time zone NOT NULL, " \
" dateinserted_user timestamp(6) with time zone NOT NULL, " \
" constraint users_history_pk primary key (user_id, version_user), " \
" constraint users_history_pk primary key (user_id, version_user), " \
" constraint users_history_user_id_fk foreign key (user_id) references users (user_id), " \
" constraint users_history_user_id_fk foreign key (user_id) references users (user_id), " \
@ -730,7 +730,7 @@ def create_database(cur, con):
cur . execute ( sql )
cur . execute ( sql )
sql = " create table posts(post_id integer NOT NULL, topic_id integer NOT NULL, " \
sql = " create table posts(post_id integer NOT NULL, topic_id integer NOT NULL, " \
" user_id integer NOT NULL, content_post character varying(100000) NOT null, feedback_post integer null, " \
" user_id integer NOT NULL, content_post character varying(1000000 ) NOT null, feedback_post integer null, " \
" image_post integer null, dateadded_post timestamp(6) with time zone NOT NULL, " \
" image_post integer null, dateadded_post timestamp(6) with time zone NOT NULL, " \
" dateinserted_post timestamp(6) with time zone NOT NULL, " \
" dateinserted_post timestamp(6) with time zone NOT NULL, " \
" constraint posts_pk primary key (post_id), " \
" constraint posts_pk primary key (post_id), " \
@ -744,7 +744,7 @@ def create_database(cur, con):
cur . execute ( sql )
cur . execute ( sql )
sql = " create table posts_history(post_id integer NOT NULL, version_post integer not null, topic_id integer NOT NULL, " \
sql = " create table posts_history(post_id integer NOT NULL, version_post integer not null, topic_id integer NOT NULL, " \
" user_id integer NOT NULL, content_post character varying(100000) NOT null, feedback_post integer null, " \
" user_id integer NOT NULL, content_post character varying(1000000 ) NOT null, feedback_post integer null, " \
" image_post integer null, dateadded_post timestamp(6) with time zone NOT NULL, " \
" image_post integer null, dateadded_post timestamp(6) with time zone NOT NULL, " \
" dateinserted_post timestamp(6) with time zone NOT NULL, " \
" dateinserted_post timestamp(6) with time zone NOT NULL, " \
" constraint posts_history_pk primary key (post_id, version_post), " \
" constraint posts_history_pk primary key (post_id, version_post), " \