Browse Source

increased character length limit of table columns

main
westernmeadow 1 year ago
parent
commit
7b108f7ddc
2 changed files with 15 additions and 15 deletions
  1. +10
    -10
      Forums/DB_Connection/db_connection.py
  2. +5
    -5
      MarketPlaces/DB_Connection/db_connection.py

+ 10
- 10
Forums/DB_Connection/db_connection.py View File

@ -607,10 +607,10 @@ def create_image(cur, base64Image, date):
imageId = verifyImage(cur, decImage)
if not imageId:
imageId = int(getLastImage(cur) + 1)
newImage = True
imageId = int(getLastImage(cur) + 1)
newImage = True
else:
newImage = False
newImage = False
if newImage:
@ -660,8 +660,8 @@ def create_database(cur, con):
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, " \
"constraint forum_images_pk primary key (image_id))"
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(" \
"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(1000) null, " \
"interest_user character varying(10000) null, signature_user character varying(10000) null, " \
"image_user integer null, dateinserted_user timestamp(6) with time zone NOT NULL, " \
"constraint users_pk primary key (user_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, " \
"name_user character varying(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(1000) null, image_user integer null, " \
"reputation_user character varying(255) null, interest_user character varying(10000) null, " \
"signature_user character varying(10000) null, image_user integer null, " \
"dateinserted_user timestamp(6) with time zone NOT NULL, " \
"constraint users_history_pk primary key (user_id, version_user), " \
"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)
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, " \
"dateinserted_post timestamp(6) with time zone NOT NULL, " \
"constraint posts_pk primary key (post_id), " \
@ -744,7 +744,7 @@ def create_database(cur, con):
cur.execute(sql)
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, " \
"dateinserted_post timestamp(6) with time zone NOT NULL, " \
"constraint posts_history_pk primary key (post_id, version_post), " \


+ 5
- 5
MarketPlaces/DB_Connection/db_connection.py View File

@ -313,10 +313,10 @@ def create_items(cur, row, marketId, vendorId):
itemId = verifyItem(cur, marketId, hrefItem)
if not itemId:
itemId = int(getLastItem(cur) + 1)
newItem = True
itemId = int(getLastItem(cur) + 1)
newItem = True
else:
newItem = False
newItem = False
if newItem:
@ -554,8 +554,8 @@ def create_database(cur, con):
try:
sql = "create table market_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 market_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, " \
"constraint market_images_pk primary key (image_id))"
cur.execute(sql)


Loading…
Cancel
Save