Fix integrity error, add unique index and remove aoid from PK
This commit is contained in:
parent
3db2e6a75c
commit
3aeb00d82a
@ -27,7 +27,7 @@ class DbHandler:
|
|||||||
self.db.transaction_commit()
|
self.db.transaction_commit()
|
||||||
except:
|
except:
|
||||||
self.db.transaction_rollback()
|
self.db.transaction_rollback()
|
||||||
logging.error("Error updating sql. Reason : {}".format(format_exc()))
|
raise BaseException("Error updating sql. Reason : {}".format(format_exc()))
|
||||||
|
|
||||||
logging.warning("Inserted {} queries FROM {}".format(chunk_size, csv_file_name))
|
logging.warning("Inserted {} queries FROM {}".format(chunk_size, csv_file_name))
|
||||||
|
|
||||||
|
@ -9,7 +9,8 @@ CREATE TABLE "public"."ADDROBJ" (
|
|||||||
"parentguid" UUID,
|
"parentguid" UUID,
|
||||||
"actstatus" BIT(1),
|
"actstatus" BIT(1),
|
||||||
"currstatus" INT2,
|
"currstatus" INT2,
|
||||||
PRIMARY KEY ("id", "aoid")
|
CONSTRAINT "aoid" UNIQUE ("aoid"),
|
||||||
|
CONSTRAINT "id" PRIMARY KEY ("id")
|
||||||
)
|
)
|
||||||
WITH (OIDS =FALSE
|
WITH (OIDS =FALSE
|
||||||
);
|
);
|
||||||
|
@ -26,7 +26,7 @@ def main():
|
|||||||
help="Create/update DB from source. Value: \"http\" or absolute path to folder")
|
help="Create/update DB from source. Value: \"http\" or absolute path to folder")
|
||||||
options, arguments = p.parse_args()
|
options, arguments = p.parse_args()
|
||||||
|
|
||||||
if options.database and options.source:
|
if options.database:
|
||||||
# create new database
|
# create new database
|
||||||
if options.database == "create":
|
if options.database == "create":
|
||||||
create_base(options.source)
|
create_base(options.source)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user