Giter Site home page Giter Site logo

Comments (4)

faisaltheparttimecoder avatar faisaltheparttimecoder commented on June 14, 2024 1

Hello @gegonzalez07 ,

Please pass the DDL for Category and Worker table.

Thanks

from mock-data.

faisaltheparttimecoder avatar faisaltheparttimecoder commented on June 14, 2024 1

Hello @gegonzalez07

This seems to be a bug, i.e your DDL have CamelCase columns and I guess somewhere we dont honor the camelcase.

If you look at the below debug

 % ./mock-darwin-amd64-v3.0 d -f -u testme -a localhost -q -v
DEBU[2023-10-31 10:28:57] Checking the version of the database          file="sql.go:67" 
INFO[2023-10-31 10:28:57] Version of the database: PostgreSQL 12.14 on x86_64-apple-darwin21.6.0, compiled by Apple clang version 14.0.0 (clang-1400.0.29.202), 64-bit  file="sql.go:82"
DEBU[2023-10-31 10:28:57] Checking if this a greenplum or postgres DB   file="sql.go:88"
INFO[2023-10-31 10:28:57] The flavour of postgres is: postgres          file="sql.go:97"
INFO[2023-10-31 10:28:57] The database that will be used by mock program is: postgres  file="cmd.go:82"
INFO[2023-10-31 10:28:57] Starting the program to mock full database    file="database.go:53"
INFO[2023-10-31 10:28:57] Extracting the tables in the database: postgres  file="database.go:60"
DEBU[2023-10-31 10:28:57] Extracting the tables info from the postgres database  file="sql.go:102"
DEBU[2023-10-31 10:28:57] Total number of tables to mock: 1             file="worker.go:28"
INFO[2023-10-31 10:28:57] Beginning the mocking process for the tables  file="worker.go:40"
INFO[2023-10-31 10:28:57] Extracting the columns and data type information  file="worker.go:63"
DEBU[2023-10-31 10:28:57] Extracting the column information from postgres database for table: "public"."Category"  file="sql.go:184"
INFO[2023-10-31 10:28:57] Saving all the backup files to the path: /Users/testme/mock/20231031102857  file="constraintsBackup.go:21"
DEBU[2023-10-31 10:28:57] Backing up all the constraints from the database: postgres  file="constraintsBackup.go:31"
DEBU[2023-10-31 10:28:57] Extracting the DDL of the p constraints       file="sql.go:264"
DEBU[2023-10-31 10:28:57] Extracting the DDL of the f constraints       file="sql.go:264"
DEBU[2023-10-31 10:28:57] Extracting the DDL of the u constraints       file="sql.go:264"
DEBU[2023-10-31 10:28:57] Extracting the DDL of the c constraints       file="sql.go:264"
DEBU[2023-10-31 10:28:57] Backing up all the unique indexes from the database: postgres  file="constraintsBackup.go:53"
DEBU[2023-10-31 10:28:57] Extracting the unique indexes                 file="sql.go:298"
INFO[2023-10-31 10:28:57] Total numbers of tables to mock: 1            file="worker.go:109"
DEBU[2023-10-31 10:28:57] Removing constraints for table: "public"."Category"  file="constraintsBackup.go:96"
DEBU[2023-10-31 10:28:57] Extracting constraint info for table: "public"."Category"  file="sql.go:333"
DEBU[2023-10-31 10:28:57] Building and loading mock data to the table "public"."Category"  file="worker.go:134"
INFO[2023-10-31 10:28:57] Completed loading mock data to 1 tables       file="worker.go:125"
INFO[2023-10-31 10:28:57] Found 1 violation of primary keys, if found any attempting to fix them  file="constraintsRestore.go:28"
DEBU[2023-10-31 10:28:57] Fixing the Primary / Unique Key for table "public"."Category"  file="constraintsRestore.go:51"
DEBU[2023-10-31 10:28:57] query: SELECT COUNT(*) FROM ( SELECT "id" FROM "public"."Category" GROUP BY "id" HAVING COUNT(*) > 1 ) a  file="sql.go:436"
ERRO[2023-10-31 10:28:57] Error when executing the query to extract pk violators: ERROR #42703 column "id" does not exist  file="sql.go:437"
INFO[2023-10-31 10:28:57] Found 2 violation of unique keys, if found any attempting to fix them  file="constraintsRestore.go:28"
DEBU[2023-10-31 10:28:57] Fixing the Primary / Unique Key for table "public"."Category"  file="constraintsRestore.go:51"
DEBU[2023-10-31 10:28:57] query: SELECT COUNT(*) FROM ( SELECT "id" FROM "public"."Category" GROUP BY "id" HAVING COUNT(*) > 1 ) a  file="sql.go:436"
ERRO[2023-10-31 10:28:57] Error when executing the query to extract pk violators: ERROR #42703 column "id" does not exist  file="sql.go:437"
DEBU[2023-10-31 10:28:57] Fixing the Primary / Unique Key for table "public"."Category"  file="constraintsRestore.go:51"
DEBU[2023-10-31 10:28:57] query: SELECT COUNT(*) FROM ( SELECT "id" FROM "public"."Category" GROUP BY "id" HAVING COUNT(*) > 1 ) a  file="sql.go:436"
ERRO[2023-10-31 10:28:57] Error when executing the query to extract pk violators: ERROR #42703 column "id" does not exist  file="sql.go:437"
INFO[2023-10-31 10:28:57] Found 1 violation of foreign keys, if found any attempting to fix them  file="constraintsRestore.go:28"
DEBU[2023-10-31 10:28:57] Checking / Fixing FOREIGN KEY Violation table: "public"."Category", column: "CategoryParentId", reference: "Category"("Id")  file="constraintsRestore.go:112"
DEBU[2023-10-31 10:28:58] Extracting the foreign violations for table "public"."Category" and column "Category"  file="sql.go:543"
INFO[2023-10-31 10:28:58] Attempting to recreating all the constraints  file="constraintsRestore.go:182"
INFO[2023-10-31 10:28:58] Successfully completed running the database sub command  file="cmd.go:102"
 %

The query executed is all lowercase.

query: SELECT COUNT(*) FROM ( SELECT "id" FROM "public"."Category" GROUP BY "id" HAVING COUNT(*) > 1 ) a  file="sql.go:436"

Changing the DDL id column to lower case, seems to work.

-- ----------------------------
-- Table structure for Category
-- ----------------------------
DROP TABLE IF EXISTS "public"."Category";
CREATE TABLE "public"."Category" (
  Id int8 NOT NULL GENERATED BY DEFAULT AS IDENTITY (
INCREMENT 1
MINVALUE  1
MAXVALUE 9223372036854775807
START 1
),
  "Name" text COLLATE "pg_catalog"."default" NOT NULL,
  "CategoryParentId" int8,
  "Created" timestamptz(6) NOT NULL,
  "LastModified" timestamptz(6),
  "StatusBaseEntity" int4 NOT NULL
)
;

-- ----------------------------
-- Indexes structure for table Category
-- ----------------------------
CREATE INDEX "IX_Category_CategoryParentId" ON "public"."Category" USING btree (
  "CategoryParentId" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "PK_Category" ON "public"."Category" USING btree (
  Id "pg_catalog"."int8_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table Category
-- ----------------------------
ALTER TABLE "public"."Category" ADD CONSTRAINT "pk_category" PRIMARY KEY ("Id");

-- ----------------------------
-- Foreign Keys structure for table Category
-- ----------------------------
ALTER TABLE "public"."Category" ADD CONSTRAINT "fk_category_category_categoryparentid" FOREIGN KEY ("CategoryParentId") REFERENCES "public"."Category" (Id) ON DELETE NO ACTION ON UPDATE NO ACTION;


-- ----------------------------
-- Table structure for Worker
-- ----------------------------
DROP TABLE IF EXISTS "public"."Worker";
CREATE TABLE "public"."Worker" (
  Id int8 NOT NULL GENERATED BY DEFAULT AS IDENTITY (
INCREMENT 1
MINVALUE  1
MAXVALUE 9223372036854775807
START 1
),
  "Name" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "StartDate" timestamptz(6) NOT NULL,
  "FinishDate" timestamptz(6) NOT NULL,
  "PublishingDate" timestamptz(6) NOT NULL,
  "ShortDescription" varchar(250) COLLATE "pg_catalog"."default" NOT NULL,
  "LongDescription" varchar(500) COLLATE "pg_catalog"."default" NOT NULL,
  "Price" float8 NOT NULL DEFAULT 0.0,
  "OrderPriority" int4 NOT NULL DEFAULT 1,
  "NeedId" bool NOT NULL DEFAULT false,
  "NeedSnack" bool NOT NULL DEFAULT false,
  "Payment" varchar(20) COLLATE "pg_catalog"."default" NOT NULL,
  "CategoryId" int8 NOT NULL,
  "Created" timestamptz(6) NOT NULL,
  "LastModified" timestamptz(6),
  "StatusBaseEntity" int4 NOT NULL
)
;

-- ----------------------------
-- Indexes structure for table Worker
-- ----------------------------
CREATE INDEX "IX_Worker_CategoryId" ON "public"."Worker" USING btree (
  "CategoryId" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "PK_Worker" ON "public"."Worker" USING btree (
  Id "pg_catalog"."int8_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table Worker
-- ----------------------------
ALTER TABLE "public"."Worker" ADD CONSTRAINT "pk_Worker" PRIMARY KEY (Id);

-- ----------------------------
-- Foreign Keys structure for table Worker
-- ----------------------------
ALTER TABLE "public"."Worker" ADD CONSTRAINT "fk_Worker_category_categoryid" FOREIGN KEY ("CategoryId") REFERENCES "public"."Category" (Id) ON DELETE CASCADE ON UPDATE NO ACTION;




 % ./mock-darwin-amd64-v3.0 d -f -u testme-a localhost -q
INFO[2023-10-31 10:43:31] Version of the database: PostgreSQL 12.14 on x86_64-apple-darwin21.6.0, compiled by Apple clang version 14.0.0 (clang-1400.0.29.202), 64-bit
INFO[2023-10-31 10:43:31] The flavour of postgres is: postgres
INFO[2023-10-31 10:43:31] The database that will be used by mock program is: postgres
INFO[2023-10-31 10:43:31] Starting the program to mock full database
INFO[2023-10-31 10:43:31] Extracting the tables in the database: postgres
INFO[2023-10-31 10:43:31] Beginning the mocking process for the tables
INFO[2023-10-31 10:43:31] Extracting the columns and data type information
Extracting column information from tables 100% [==================================================] (2/2)
INFO[2023-10-31 10:43:31] Saving all the backup files to the path: /Users/testme/mock/20231031104331
INFO[2023-10-31 10:43:31] Total numbers of tables to mock: 2
Mocking Table "public"."Worker" 100% [==================================================] (10/10)
Mocking Table "public"."Category" 100% [==================================================] (10/10)
INFO[2023-10-31 10:43:31] Completed loading mock data to 2 tables
INFO[2023-10-31 10:43:31] Found 1 violation of primary keys, if found any attempting to fix them
Fixing primary keys violation 100% [==================================================] (1/1)
INFO[2023-10-31 10:43:31] Found 4 violation of unique keys, if found any attempting to fix them
Fixing unique keys violation 100% [==================================================] (4/4)
INFO[2023-10-31 10:43:31] Found 0 violation of foreign keys, if found any attempting to fix them
INFO[2023-10-31 10:43:31] Attempting to recreating all the constraints
Recreating the constraint type "p" 100% [==================================================] (1/1)
Recreating the constraint type "u" 100% [==================================================] (4/4)
INFO[2023-10-31 10:43:32] Successfully completed running the database sub command
%

I will get that fixed. Thanks for reporting the bug

from mock-data.

gegonzalez07 avatar gegonzalez07 commented on June 14, 2024

Hello @gegonzalez07 ,

Please pass the DDL for Category and Worker table.

Thanks

Thank you for responding so quickly

Category table

-- ----------------------------
-- Table structure for Category
-- ----------------------------
DROP TABLE IF EXISTS "public"."Category";
CREATE TABLE "public"."Category" (
  "Id" int8 NOT NULL GENERATED BY DEFAULT AS IDENTITY (
INCREMENT 1
MINVALUE  1
MAXVALUE 9223372036854775807
START 1
),
  "Name" text COLLATE "pg_catalog"."default" NOT NULL,
  "CategoryParentId" int8,
  "Created" timestamptz(6) NOT NULL,
  "LastModified" timestamptz(6),
  "StatusBaseEntity" int4 NOT NULL
)
;

-- ----------------------------
-- Indexes structure for table Category
-- ----------------------------
CREATE INDEX "IX_Category_CategoryParentId" ON "public"."Category" USING btree (
  "CategoryParentId" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "PK_Category" ON "public"."Category" USING btree (
  "Id" "pg_catalog"."int8_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table Category
-- ----------------------------
ALTER TABLE "public"."Category" ADD CONSTRAINT "pk_category" PRIMARY KEY ("Id");

-- ----------------------------
-- Foreign Keys structure for table Category
-- ----------------------------
ALTER TABLE "public"."Category" ADD CONSTRAINT "fk_category_category_categoryparentid" FOREIGN KEY ("CategoryParentId") REFERENCES "public"."Category" ("Id") ON DELETE NO ACTION ON UPDATE NO ACTION;

Worker table

-- ----------------------------
-- Table structure for Worker
-- ----------------------------
DROP TABLE IF EXISTS "public"."Worker";
CREATE TABLE "public"."Worker" (
  "Id" int8 NOT NULL GENERATED BY DEFAULT AS IDENTITY (
INCREMENT 1
MINVALUE  1
MAXVALUE 9223372036854775807
START 1
),
  "Name" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "StartDate" timestamptz(6) NOT NULL,
  "FinishDate" timestamptz(6) NOT NULL,
  "PublishingDate" timestamptz(6) NOT NULL,
  "ShortDescription" varchar(250) COLLATE "pg_catalog"."default" NOT NULL,
  "LongDescription" varchar(500) COLLATE "pg_catalog"."default" NOT NULL,
  "Price" float8 NOT NULL DEFAULT 0.0,
  "OrderPriority" int4 NOT NULL DEFAULT 1,
  "NeedId" bool NOT NULL DEFAULT false,
  "NeedSnack" bool NOT NULL DEFAULT false,
  "Payment" varchar(20) COLLATE "pg_catalog"."default" NOT NULL,
  "CategoryId" int8 NOT NULL,
  "Created" timestamptz(6) NOT NULL,
  "LastModified" timestamptz(6),
  "StatusBaseEntity" int4 NOT NULL
)
;

-- ----------------------------
-- Indexes structure for table Worker
-- ----------------------------
CREATE INDEX "IX_Worker_CategoryId" ON "public"."Worker" USING btree (
  "CategoryId" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "PK_Worker" ON "public"."Worker" USING btree (
  "Id" "pg_catalog"."int8_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table Worker
-- ----------------------------
ALTER TABLE "public"."Worker" ADD CONSTRAINT "pk_Worker" PRIMARY KEY ("Id");

-- ----------------------------
-- Foreign Keys structure for table Worker
-- ----------------------------
ALTER TABLE "public"."Worker" ADD CONSTRAINT "fk_Worker_category_categoryid" FOREIGN KEY ("CategoryId") REFERENCES "public"."Category" ("Id") ON DELETE CASCADE ON UPDATE NO ACTION;

from mock-data.

gegonzalez07 avatar gegonzalez07 commented on June 14, 2024

Hello @gegonzalez07

This seems to be a bug, i.e your DDL have CamelCase columns and I guess somewhere we dont honor the camelcase.

If you look at the below debug

 % ./mock-darwin-amd64-v3.0 d -f -u testme -a localhost -q -v
DEBU[2023-10-31 10:28:57] Checking the version of the database          file="sql.go:67" 
INFO[2023-10-31 10:28:57] Version of the database: PostgreSQL 12.14 on x86_64-apple-darwin21.6.0, compiled by Apple clang version 14.0.0 (clang-1400.0.29.202), 64-bit  file="sql.go:82"
DEBU[2023-10-31 10:28:57] Checking if this a greenplum or postgres DB   file="sql.go:88"
INFO[2023-10-31 10:28:57] The flavour of postgres is: postgres          file="sql.go:97"
INFO[2023-10-31 10:28:57] The database that will be used by mock program is: postgres  file="cmd.go:82"
INFO[2023-10-31 10:28:57] Starting the program to mock full database    file="database.go:53"
INFO[2023-10-31 10:28:57] Extracting the tables in the database: postgres  file="database.go:60"
DEBU[2023-10-31 10:28:57] Extracting the tables info from the postgres database  file="sql.go:102"
DEBU[2023-10-31 10:28:57] Total number of tables to mock: 1             file="worker.go:28"
INFO[2023-10-31 10:28:57] Beginning the mocking process for the tables  file="worker.go:40"
INFO[2023-10-31 10:28:57] Extracting the columns and data type information  file="worker.go:63"
DEBU[2023-10-31 10:28:57] Extracting the column information from postgres database for table: "public"."Category"  file="sql.go:184"
INFO[2023-10-31 10:28:57] Saving all the backup files to the path: /Users/testme/mock/20231031102857  file="constraintsBackup.go:21"
DEBU[2023-10-31 10:28:57] Backing up all the constraints from the database: postgres  file="constraintsBackup.go:31"
DEBU[2023-10-31 10:28:57] Extracting the DDL of the p constraints       file="sql.go:264"
DEBU[2023-10-31 10:28:57] Extracting the DDL of the f constraints       file="sql.go:264"
DEBU[2023-10-31 10:28:57] Extracting the DDL of the u constraints       file="sql.go:264"
DEBU[2023-10-31 10:28:57] Extracting the DDL of the c constraints       file="sql.go:264"
DEBU[2023-10-31 10:28:57] Backing up all the unique indexes from the database: postgres  file="constraintsBackup.go:53"
DEBU[2023-10-31 10:28:57] Extracting the unique indexes                 file="sql.go:298"
INFO[2023-10-31 10:28:57] Total numbers of tables to mock: 1            file="worker.go:109"
DEBU[2023-10-31 10:28:57] Removing constraints for table: "public"."Category"  file="constraintsBackup.go:96"
DEBU[2023-10-31 10:28:57] Extracting constraint info for table: "public"."Category"  file="sql.go:333"
DEBU[2023-10-31 10:28:57] Building and loading mock data to the table "public"."Category"  file="worker.go:134"
INFO[2023-10-31 10:28:57] Completed loading mock data to 1 tables       file="worker.go:125"
INFO[2023-10-31 10:28:57] Found 1 violation of primary keys, if found any attempting to fix them  file="constraintsRestore.go:28"
DEBU[2023-10-31 10:28:57] Fixing the Primary / Unique Key for table "public"."Category"  file="constraintsRestore.go:51"
DEBU[2023-10-31 10:28:57] query: SELECT COUNT(*) FROM ( SELECT "id" FROM "public"."Category" GROUP BY "id" HAVING COUNT(*) > 1 ) a  file="sql.go:436"
ERRO[2023-10-31 10:28:57] Error when executing the query to extract pk violators: ERROR #42703 column "id" does not exist  file="sql.go:437"
INFO[2023-10-31 10:28:57] Found 2 violation of unique keys, if found any attempting to fix them  file="constraintsRestore.go:28"
DEBU[2023-10-31 10:28:57] Fixing the Primary / Unique Key for table "public"."Category"  file="constraintsRestore.go:51"
DEBU[2023-10-31 10:28:57] query: SELECT COUNT(*) FROM ( SELECT "id" FROM "public"."Category" GROUP BY "id" HAVING COUNT(*) > 1 ) a  file="sql.go:436"
ERRO[2023-10-31 10:28:57] Error when executing the query to extract pk violators: ERROR #42703 column "id" does not exist  file="sql.go:437"
DEBU[2023-10-31 10:28:57] Fixing the Primary / Unique Key for table "public"."Category"  file="constraintsRestore.go:51"
DEBU[2023-10-31 10:28:57] query: SELECT COUNT(*) FROM ( SELECT "id" FROM "public"."Category" GROUP BY "id" HAVING COUNT(*) > 1 ) a  file="sql.go:436"
ERRO[2023-10-31 10:28:57] Error when executing the query to extract pk violators: ERROR #42703 column "id" does not exist  file="sql.go:437"
INFO[2023-10-31 10:28:57] Found 1 violation of foreign keys, if found any attempting to fix them  file="constraintsRestore.go:28"
DEBU[2023-10-31 10:28:57] Checking / Fixing FOREIGN KEY Violation table: "public"."Category", column: "CategoryParentId", reference: "Category"("Id")  file="constraintsRestore.go:112"
DEBU[2023-10-31 10:28:58] Extracting the foreign violations for table "public"."Category" and column "Category"  file="sql.go:543"
INFO[2023-10-31 10:28:58] Attempting to recreating all the constraints  file="constraintsRestore.go:182"
INFO[2023-10-31 10:28:58] Successfully completed running the database sub command  file="cmd.go:102"
 %

The query executed is all lowercase.

query: SELECT COUNT(*) FROM ( SELECT "id" FROM "public"."Category" GROUP BY "id" HAVING COUNT(*) > 1 ) a  file="sql.go:436"

Changing the DDL id column to lower case, seems to work.

-- ----------------------------
-- Table structure for Category
-- ----------------------------
DROP TABLE IF EXISTS "public"."Category";
CREATE TABLE "public"."Category" (
  Id int8 NOT NULL GENERATED BY DEFAULT AS IDENTITY (
INCREMENT 1
MINVALUE  1
MAXVALUE 9223372036854775807
START 1
),
  "Name" text COLLATE "pg_catalog"."default" NOT NULL,
  "CategoryParentId" int8,
  "Created" timestamptz(6) NOT NULL,
  "LastModified" timestamptz(6),
  "StatusBaseEntity" int4 NOT NULL
)
;

-- ----------------------------
-- Indexes structure for table Category
-- ----------------------------
CREATE INDEX "IX_Category_CategoryParentId" ON "public"."Category" USING btree (
  "CategoryParentId" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "PK_Category" ON "public"."Category" USING btree (
  Id "pg_catalog"."int8_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table Category
-- ----------------------------
ALTER TABLE "public"."Category" ADD CONSTRAINT "pk_category" PRIMARY KEY ("Id");

-- ----------------------------
-- Foreign Keys structure for table Category
-- ----------------------------
ALTER TABLE "public"."Category" ADD CONSTRAINT "fk_category_category_categoryparentid" FOREIGN KEY ("CategoryParentId") REFERENCES "public"."Category" (Id) ON DELETE NO ACTION ON UPDATE NO ACTION;


-- ----------------------------
-- Table structure for Worker
-- ----------------------------
DROP TABLE IF EXISTS "public"."Worker";
CREATE TABLE "public"."Worker" (
  Id int8 NOT NULL GENERATED BY DEFAULT AS IDENTITY (
INCREMENT 1
MINVALUE  1
MAXVALUE 9223372036854775807
START 1
),
  "Name" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "StartDate" timestamptz(6) NOT NULL,
  "FinishDate" timestamptz(6) NOT NULL,
  "PublishingDate" timestamptz(6) NOT NULL,
  "ShortDescription" varchar(250) COLLATE "pg_catalog"."default" NOT NULL,
  "LongDescription" varchar(500) COLLATE "pg_catalog"."default" NOT NULL,
  "Price" float8 NOT NULL DEFAULT 0.0,
  "OrderPriority" int4 NOT NULL DEFAULT 1,
  "NeedId" bool NOT NULL DEFAULT false,
  "NeedSnack" bool NOT NULL DEFAULT false,
  "Payment" varchar(20) COLLATE "pg_catalog"."default" NOT NULL,
  "CategoryId" int8 NOT NULL,
  "Created" timestamptz(6) NOT NULL,
  "LastModified" timestamptz(6),
  "StatusBaseEntity" int4 NOT NULL
)
;

-- ----------------------------
-- Indexes structure for table Worker
-- ----------------------------
CREATE INDEX "IX_Worker_CategoryId" ON "public"."Worker" USING btree (
  "CategoryId" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "PK_Worker" ON "public"."Worker" USING btree (
  Id "pg_catalog"."int8_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table Worker
-- ----------------------------
ALTER TABLE "public"."Worker" ADD CONSTRAINT "pk_Worker" PRIMARY KEY (Id);

-- ----------------------------
-- Foreign Keys structure for table Worker
-- ----------------------------
ALTER TABLE "public"."Worker" ADD CONSTRAINT "fk_Worker_category_categoryid" FOREIGN KEY ("CategoryId") REFERENCES "public"."Category" (Id) ON DELETE CASCADE ON UPDATE NO ACTION;




 % ./mock-darwin-amd64-v3.0 d -f -u testme-a localhost -q
INFO[2023-10-31 10:43:31] Version of the database: PostgreSQL 12.14 on x86_64-apple-darwin21.6.0, compiled by Apple clang version 14.0.0 (clang-1400.0.29.202), 64-bit
INFO[2023-10-31 10:43:31] The flavour of postgres is: postgres
INFO[2023-10-31 10:43:31] The database that will be used by mock program is: postgres
INFO[2023-10-31 10:43:31] Starting the program to mock full database
INFO[2023-10-31 10:43:31] Extracting the tables in the database: postgres
INFO[2023-10-31 10:43:31] Beginning the mocking process for the tables
INFO[2023-10-31 10:43:31] Extracting the columns and data type information
Extracting column information from tables 100% [==================================================] (2/2)
INFO[2023-10-31 10:43:31] Saving all the backup files to the path: /Users/testme/mock/20231031104331
INFO[2023-10-31 10:43:31] Total numbers of tables to mock: 2
Mocking Table "public"."Worker" 100% [==================================================] (10/10)
Mocking Table "public"."Category" 100% [==================================================] (10/10)
INFO[2023-10-31 10:43:31] Completed loading mock data to 2 tables
INFO[2023-10-31 10:43:31] Found 1 violation of primary keys, if found any attempting to fix them
Fixing primary keys violation 100% [==================================================] (1/1)
INFO[2023-10-31 10:43:31] Found 4 violation of unique keys, if found any attempting to fix them
Fixing unique keys violation 100% [==================================================] (4/4)
INFO[2023-10-31 10:43:31] Found 0 violation of foreign keys, if found any attempting to fix them
INFO[2023-10-31 10:43:31] Attempting to recreating all the constraints
Recreating the constraint type "p" 100% [==================================================] (1/1)
Recreating the constraint type "u" 100% [==================================================] (4/4)
INFO[2023-10-31 10:43:32] Successfully completed running the database sub command
%

I will get that fixed. Thanks for reporting the bug

Thanks a loot for your answer.

from mock-data.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.