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()
|
||||
except:
|
||||
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))
|
||||
|
||||
|
@ -9,7 +9,8 @@ CREATE TABLE "public"."ADDROBJ" (
|
||||
"parentguid" UUID,
|
||||
"actstatus" BIT(1),
|
||||
"currstatus" INT2,
|
||||
PRIMARY KEY ("id", "aoid")
|
||||
CONSTRAINT "aoid" UNIQUE ("aoid"),
|
||||
CONSTRAINT "id" PRIMARY KEY ("id")
|
||||
)
|
||||
WITH (OIDS =FALSE
|
||||
);
|
||||
|
@ -26,7 +26,7 @@ def main():
|
||||
help="Create/update DB from source. Value: \"http\" or absolute path to folder")
|
||||
options, arguments = p.parse_args()
|
||||
|
||||
if options.database and options.source:
|
||||
if options.database:
|
||||
# create new database
|
||||
if options.database == "create":
|
||||
create_base(options.source)
|
||||
|
Loading…
x
Reference in New Issue
Block a user