faisaltheparttimecoder/mock-data

Loop for "Fixing the Primary / Unique Key"

janpio opened this issue · 2 comments

https://github.com/prisma/database-schema-examples/blob/master/postgres/basic-blog/schema.sql

Get this output:

mock-windows-amd64-v2.3.exe database -a localhost -w foo -f -v -d basic-blog
...
time="2020-02-28 14:22:07" level=info msg="Found 3 violation of PRIMARY KEYS, attempting to fix them" file="constraintsRestore.go:26"
time="2020-02-28 14:22:07" level=debug msg="Fixing the Primary / Unique Key" file="constraintsRestore.go:50"
time="2020-02-28 14:22:07" level=debug msg="Extracting constraint column data type info for table: \"public\".\"authors\"" file="sql.go:371"
time="2020-02-28 14:22:08" level=debug msg="Extracting the unique violations for table \"public\".\"authors\" and column id" file="sql.go:424"
time="2020-02-28 14:22:11" level=debug msg="Extracting constraint column data type info for table: \"public\".\"authors\"" file="sql.go:371"
time="2020-02-28 14:22:11" level=debug msg="Extracting the unique violations for table \"public\".\"authors\" and column id" file="sql.go:424"
time="2020-02-28 14:22:12" level=debug msg="Extracting constraint column data type info for table: \"public\".\"authors\"" file="sql.go:371"
time="2020-02-28 14:22:12" level=debug msg="Extracting the unique violations for table \"public\".\"authors\" and column id" file="sql.go:424"
time="2020-02-28 14:22:13" level=debug msg="Extracting constraint column data type info for table: \"public\".\"authors\"" file="sql.go:371"
time="2020-02-28 14:22:13" level=debug msg="Extracting the unique violations for table \"public\".\"authors\" and column id" file="sql.go:424"
time="2020-02-28 14:22:13" level=debug msg="Extracting constraint column data type info for table: \"public\".\"authors\"" file="sql.go:371"
time="2020-02-28 14:22:14" level=debug msg="Extracting the unique violations for table \"public\".\"authors\" and column id" file="sql.go:424"
time="2020-02-28 14:22:14" level=debug msg="Extracting constraint column data type info for table: \"public\".\"authors\"" file="sql.go:371"
time="2020-02-28 14:22:14" level=debug msg="Extracting the unique violations for table \"public\".\"authors\" and column id" file="sql.go:424"
time="2020-02-28 14:22:15" level=debug msg="Extracting constraint column data type info for table: \"public\".\"authors\"" file="sql.go:371"
time="2020-02-28 14:22:15" level=debug msg="Extracting the unique violations for table \"public\".\"authors\" and column id" file="sql.go:424"
time="2020-02-28 14:22:16" level=debug msg="Extracting constraint column data type info for table: \"public\".\"authors\"" file="sql.go:371"
time="2020-02-28 14:22:16" level=debug msg="Extracting the unique violations for table \"public\".\"authors\" and column id" file="sql.go:424"
time="2020-02-28 14:22:16" level=debug msg="Extracting constraint column data type info for table: \"public\".\"authors\"" file="sql.go:371"
time="2020-02-28 14:22:17" level=debug msg="Extracting the unique violations for table \"public\".\"authors\" and column id" file="sql.go:424"
...

This has been going on for multiple minutes now, so I would say there is some way this could go into a loop that never ends.

Seems like you found a bug, the table author has a primary key on the serial datatype, I skip the serial datatype from randomising, since its anyways a sequence. So my best guess is related to that, I will have a test done later in the evening.