Closed
Description
mock-windows-amd64-v2.4.exe database -a localhost -w foo -f -v -d discourse
...
Fixing PRIMARY KEYS violation 93% [=============================================> ] (123/131) [8s:0s]time="2020-03-08 16:43:17" level=debug msg="Fixing the Primary / Unique Key" file="constraintsRestore.go:50"
Fixing PRIMARY KEYS violation 94% [==============================================> ] (124/131) [8s:0s]time="2020-03-08 16:43:17" level=debug msg="Fixing the Primary / Unique Key" file="constraintsRestore.go:50"
Fixing PRIMARY KEYS violation 95% [==============================================> ] (125/131) [8s:0s]time="2020-03-08 16:43:17" level=debug msg="Fixing the Primary / Unique Key" file="constraintsRestore.go:50"
Fixing PRIMARY KEYS violation 96% [===============================================> ] (126/131) [8s:0s]time="2020-03-08 16:43:17" level=debug msg="Fixing the Primary / Unique Key" file="constraintsRestore.go:50"
Fixing PRIMARY KEYS violation 96% [===============================================> ] (127/131) [8s:0s]time="2020-03-08 16:43:17" level=debug msg="Fixing the Primary / Unique Key" file="constraintsRestore.go:50"
Fixing PRIMARY KEYS violation 97% [===============================================> ] (128/131) [8s:0s]time="2020-03-08 16:43:17" level=debug msg="Fixing the Primary / Unique Key" file="constraintsRestore.go:50"
Fixing PRIMARY KEYS violation 98% [================================================> ] (129/131) [8s:0s]time="2020-03-08 16:43:17" level=debug msg="Fixing the Primary / Unique Key" file="constraintsRestore.go:50"
Fixing PRIMARY KEYS violation 99% [================================================> ] (130/131) [8s:0s]time="2020-03-08 16:43:17" level=debug msg="Fixing the Primary / Unique Key" file="constraintsRestore.go:50"
Fixing PRIMARY KEYS violation 100% [==================================================] (131/131) [8s:0s]
time="2020-03-08 16:43:17" level=info msg="Found 238 violation of UNIQUE KEYS, attempting to fix them" file="constraintsRestore.go:26"
time="2020-03-08 16:43:17" level=debug msg="Fixing the Primary / Unique Key" file="constraintsRestore.go:50"
Fixing UNIQUE KEYS violation 0% [ ] (1/238) [0s:8s]time="2020-03-08 16:43:17" level=debug msg="Fixing the Primary / Unique Key" file="constraintsRestore.go:50"
Fixing UNIQUE KEYS violation 0% [ ] (2/238) [0s:10s]time="2020-03-08 16:43:18" level=debug msg="Fixing the Primary / Unique Key" file="constraintsRestore.go:50"
Fixing UNIQUE KEYS violation 1% [ ] (3/238) [0s:11s]time="2020-03-08 16:43:18" level=debug msg="Fixing the Primary / Unique Key" file="constraintsRestore.go:50"
Fixing UNIQUE KEYS violation 1% [ ] (4/238) [0s:11s]time="2020-03-08 16:43:18" level=debug msg="Fixing the Primary / Unique Key" file="constraintsRestore.go:50"
Fixing UNIQUE KEYS violation 2% [> ] (5/238) [0s:11s]time="2020-03-08 16:43:18" level=debug msg="Fixing the Primary / Unique Key" file="constraintsRestore.go:50"
Fixing UNIQUE KEYS violation 2% [> ] (6/238) [0s:11s]time="2020-03-08 16:43:18" level=debug msg="Fixing the Primary / Unique Key" file="constraintsRestore.go:50"
Fixing UNIQUE KEYS violation 2% [> ] (7/238) [0s:11s]time="2020-03-08 16:43:18" level=debug msg="Fixing the Primary / Unique Key" file="constraintsRestore.go:50"
time="2020-03-08 16:43:18" level=debug msg="Extracting constraint column data type info for table: \"public\".\"categories\"" file="sql.go:371"
time="2020-03-08 16:43:18" level=debug msg="Extracting the unique violations for table \"public\".\"categories\" and column email_in" file="sql.go:424"
Fixing UNIQUE KEYS violation 3% [> ] (8/238) [0s:16s]time="2020-03-08 16:43:18" level=debug msg="Fixing the Primary / Unique Key" file="constraintsRestore.go:50"
time="2020-03-08 16:43:18" level=debug msg="query: SELECT COUNT(*) FROM ( SELECT COALESCE(parent_category_id, '-1'::integer FROM \"public\".\"categories\" GROUP BY COALESCE(parent_category_id, '-1'::integer HAVING COUNT(*) > 1 ) a" file="sql.go:410"
time="2020-03-08 16:43:18" level=fatal msg="Error when execute the query to extract pk violators: ERROR #42601 syntax error at or near \"FROM\"" file="sql.go:411"
Schema is https://github.com/prisma/database-schema-examples/blob/master/postgres/discourse/schema.sql