· 5 years ago · Nov 06, 2020, 02:34 PM
1root@dev-homolog:/digivox/docker-data# docker logs -f dcs-admin-api
2:: Loading data from Docker variables
3:: Starting DCS Admin API. Port 3333
4query: SELECT * FROM "information_schema"."tables" WHERE "table_schema" = current_schema() AND "table_name" = 'migrations'
5query: CREATE TABLE "migrations" ("id" SERIAL NOT NULL, "timestamp" bigint NOT NULL, "name" character varying NOT NULL, CONSTRAINT "PK_8c82d7f526340ab734260ea46be" PRIMARY KEY ("id"))
6query: SELECT * FROM "migrations" "migrations" ORDER BY "id" DESC
70 migrations are already loaded in the database.
813 migrations were found in the source code.
913 migrations are new migrations that needs to be executed.
10query: START TRANSACTION
11query: CREATE TABLE "clients" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "name" varchar NOT NULL, "email" varchar NOT NULL, "enabled" boolean NOT NULL DEFAULT true, "url_callback" varchar, "phone" varchar, "token" varchar, "created_at" timestamp NOT NULL DEFAULT now(), "updated_at" timestamp NOT NULL DEFAULT now(), CONSTRAINT "UQ_b48860677afe62cd96e12659482" UNIQUE ("email"), CONSTRAINT "PK_f1ab7cf3a5714dbc6bb4e1c28a4" PRIMARY KEY ("id"))
12query: INSERT INTO "migrations"("timestamp", "name") VALUES ($1, $2) -- PARAMETERS: [1599480911102,"CreateClients1599480911102"]
13Migration CreateClients1599480911102 has been executed successfully.
14query: CREATE TABLE "users" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "name" varchar NOT NULL, "email" varchar NOT NULL, "password" varchar NOT NULL, "blocked" boolean NOT NULL DEFAULT false, "root" boolean NOT NULL DEFAULT false, "note" text, "client_id" uuid, "created_at" timestamp NOT NULL DEFAULT now(), "updated_at" timestamp NOT NULL DEFAULT now(), CONSTRAINT "UQ_97672ac88f789774dd47f7c8be3" UNIQUE ("email"), CONSTRAINT "PK_a3ffb1c0c8416b9fc6f907b7433" PRIMARY KEY ("id"))
15query: SELECT * FROM current_schema()
16query: SELECT * FROM "information_schema"."tables" WHERE ("table_schema" = 'public' AND "table_name" = 'users')
17query: SELECT *, ('"' || "udt_schema" || '"."' || "udt_name" || '"')::"regtype" AS "regtype" FROM "information_schema"."columns" WHERE ("table_schema" = 'public' AND "table_name" = 'users')
18query: SELECT "ns"."nspname" AS "table_schema", "t"."relname" AS "table_name", "cnst"."conname" AS "constraint_name", pg_get_constraintdef("cnst"."oid") AS "expression", CASE "cnst"."contype" WHEN 'p' THEN 'PRIMARY' WHEN 'u' THEN 'UNIQUE' WHEN 'c' THEN 'CHECK' WHEN 'x' THEN 'EXCLUDE' END AS "constraint_type", "a"."attname" AS "column_name" FROM "pg_constraint" "cnst" INNER JOIN "pg_class" "t" ON "t"."oid" = "cnst"."conrelid" INNER JOIN "pg_namespace" "ns" ON "ns"."oid" = "cnst"."connamespace" LEFT JOIN "pg_attribute" "a" ON "a"."attrelid" = "cnst"."conrelid" AND "a"."attnum" = ANY ("cnst"."conkey") WHERE "t"."relkind" = 'r' AND (("ns"."nspname" = 'public' AND "t"."relname" = 'users'))
19query: SELECT "ns"."nspname" AS "table_schema", "t"."relname" AS "table_name", "i"."relname" AS "constraint_name", "a"."attname" AS "column_name", CASE "ix"."indisunique" WHEN 't' THEN 'TRUE' ELSE'FALSE' END AS "is_unique", pg_get_expr("ix"."indpred", "ix"."indrelid") AS "condition", "types"."typname" AS "type_name" FROM "pg_class" "t" INNER JOIN "pg_index" "ix" ON "ix"."indrelid" = "t"."oid" INNER JOIN "pg_attribute" "a" ON "a"."attrelid" = "t"."oid" AND "a"."attnum" = ANY ("ix"."indkey") INNER JOIN "pg_namespace" "ns" ON "ns"."oid" = "t"."relnamespace" INNER JOIN "pg_class" "i" ON "i"."oid" = "ix"."indexrelid" INNER JOIN "pg_type" "types" ON "types"."oid" = "a"."atttypid" LEFT JOIN "pg_constraint" "cnst" ON "cnst"."conname" = "i"."relname" WHERE "t"."relkind" = 'r' AND "cnst"."contype" IS NULL AND (("ns"."nspname" = 'public' AND "t"."relname" = 'users'))
20query: SELECT "con"."conname" AS "constraint_name", "con"."nspname" AS "table_schema", "con"."relname" AS "table_name", "att2"."attname" AS "column_name", "ns"."nspname" AS "referenced_table_schema", "cl"."relname" AS "referenced_table_name", "att"."attname" AS "referenced_column_name", "con"."confdeltype" AS "on_delete", "con"."confupdtype" AS "on_update", "con"."condeferrable" AS "deferrable", "con"."condeferred" AS "deferred" FROM ( SELECT UNNEST ("con1"."conkey") AS "parent", UNNEST ("con1"."confkey") AS "child", "con1"."confrelid", "con1"."conrelid", "con1"."conname", "con1"."contype", "ns"."nspname", "cl"."relname", "con1"."condeferrable", CASE WHEN "con1"."condeferred" THEN 'INITIALLY DEFERRED' ELSE 'INITIALLY IMMEDIATE' END as condeferred, CASE "con1"."confdeltype" WHEN 'a' THEN 'NO ACTION' WHEN 'r' THEN 'RESTRICT' WHEN 'c' THEN 'CASCADE' WHEN 'n' THEN 'SET NULL' WHEN 'd' THEN 'SET DEFAULT' END as "confdeltype", CASE "con1"."confupdtype" WHEN 'a' THEN 'NO ACTION' WHEN 'r' THEN 'RESTRICT' WHEN 'c' THEN 'CASCADE' WHEN 'n' THEN 'SET NULL' WHEN 'd' THEN 'SET DEFAULT' END as "confupdtype" FROM "pg_class" "cl" INNER JOIN "pg_namespace" "ns" ON "cl"."relnamespace" = "ns"."oid" INNER JOIN "pg_constraint" "con1" ON "con1"."conrelid" = "cl"."oid" WHERE "con1"."contype" = 'f' AND (("ns"."nspname" = 'public' AND "cl"."relname" = 'users')) ) "con" INNER JOIN "pg_attribute" "att" ON "att"."attrelid" = "con"."confrelid" AND "att"."attnum" = "con"."child" INNER JOIN "pg_class" "cl" ON "cl"."oid" = "con"."confrelid" INNER JOIN "pg_namespace" "ns" ON "cl"."relnamespace" = "ns"."oid" INNER JOIN "pg_attribute" "att2" ON "att2"."attrelid" = "con"."conrelid" AND "att2"."attnum" = "con"."parent"
21query: ALTER TABLE "users" ADD CONSTRAINT "UserClient" FOREIGN KEY ("client_id") REFERENCES "clients"("id") ON DELETE CASCADE ON UPDATE CASCADE
22query: INSERT INTO "migrations"("timestamp", "name") VALUES ($1, $2) -- PARAMETERS: [1599488421038,"CreateUsers1599488421038"]
23Migration CreateUsers1599488421038 has been executed successfully.
24query: CREATE TABLE "integration_config" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "media_name" varchar NOT NULL, "broker" varchar NOT NULL, "config" varchar NOT NULL, CONSTRAINT "PK_842e21f6fbb00008d9b0c9dc18e" PRIMARY KEY ("id"))
25query: INSERT INTO "migrations"("timestamp", "name") VALUES ($1, $2) -- PARAMETERS: [1602812982792,"CreateIntegrationConfig1602812982792"]
26Migration CreateIntegrationConfig1602812982792 has been executed successfully.
27query: CREATE TABLE "integrations" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "name" varchar NOT NULL, "media_name" varchar NOT NULL, "broker" varchar NOT NULL, "credentials" varchar NOT NULL, "global" boolean NOT NULL DEFAULT false, "created_at" timestamp NOT NULL DEFAULT now(), "updated_at" timestamp NOT NULL DEFAULT now(), CONSTRAINT "PK_9adcdc6d6f3922535361ce641e8" PRIMARY KEY ("id"))
28query: INSERT INTO "migrations"("timestamp", "name") VALUES ($1, $2) -- PARAMETERS: [1602863619728,"CreateIntegration1602863619728"]
29Migration CreateIntegration1602863619728 has been executed successfully.
30query: CREATE TABLE "log_license" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "integration_id" uuid NOT NULL, "client_id" uuid NOT NULL, "start_period" timestamp NOT NULL DEFAULT now(), "end_period" timestamp, "available_quantity" integer NOT NULL, "quantity_used" integer DEFAULT 0, "renewal_day" integer NOT NULL, "created_at" timestamp NOT NULL DEFAULT now(), "updated_at" timestamp NOT NULL DEFAULT now(), CONSTRAINT "PK_fca403dc856545a904045e2b534" PRIMARY KEY ("id"))
31query: SELECT * FROM current_schema()
32query: SELECT * FROM "information_schema"."tables" WHERE ("table_schema" = 'public' AND "table_name" = 'log_license')
33query: SELECT *, ('"' || "udt_schema" || '"."' || "udt_name" || '"')::"regtype" AS "regtype" FROM "information_schema"."columns" WHERE ("table_schema" = 'public' AND "table_name" = 'log_license')
34query: SELECT "ns"."nspname" AS "table_schema", "t"."relname" AS "table_name", "cnst"."conname" AS "constraint_name", pg_get_constraintdef("cnst"."oid") AS "expression", CASE "cnst"."contype" WHEN 'p' THEN 'PRIMARY' WHEN 'u' THEN 'UNIQUE' WHEN 'c' THEN 'CHECK' WHEN 'x' THEN 'EXCLUDE' END AS "constraint_type", "a"."attname" AS "column_name" FROM "pg_constraint" "cnst" INNER JOIN "pg_class" "t" ON "t"."oid" = "cnst"."conrelid" INNER JOIN "pg_namespace" "ns" ON "ns"."oid" = "cnst"."connamespace" LEFT JOIN "pg_attribute" "a" ON "a"."attrelid" = "cnst"."conrelid" AND "a"."attnum" = ANY ("cnst"."conkey") WHERE "t"."relkind" = 'r' AND (("ns"."nspname" = 'public' AND "t"."relname" = 'log_license'))
35query: SELECT "ns"."nspname" AS "table_schema", "t"."relname" AS "table_name", "i"."relname" AS "constraint_name", "a"."attname" AS "column_name", CASE "ix"."indisunique" WHEN 't' THEN 'TRUE' ELSE'FALSE' END AS "is_unique", pg_get_expr("ix"."indpred", "ix"."indrelid") AS "condition", "types"."typname" AS "type_name" FROM "pg_class" "t" INNER JOIN "pg_index" "ix" ON "ix"."indrelid" = "t"."oid" INNER JOIN "pg_attribute" "a" ON "a"."attrelid" = "t"."oid" AND "a"."attnum" = ANY ("ix"."indkey") INNER JOIN "pg_namespace" "ns" ON "ns"."oid" = "t"."relnamespace" INNER JOIN "pg_class" "i" ON "i"."oid" = "ix"."indexrelid" INNER JOIN "pg_type" "types" ON "types"."oid" = "a"."atttypid" LEFT JOIN "pg_constraint" "cnst" ON "cnst"."conname" = "i"."relname" WHERE "t"."relkind" = 'r' AND "cnst"."contype" IS NULL AND (("ns"."nspname" = 'public' AND "t"."relname" = 'log_license'))
36query: SELECT "con"."conname" AS "constraint_name", "con"."nspname" AS "table_schema", "con"."relname" AS "table_name", "att2"."attname" AS "column_name", "ns"."nspname" AS "referenced_table_schema", "cl"."relname" AS "referenced_table_name", "att"."attname" AS "referenced_column_name", "con"."confdeltype" AS "on_delete", "con"."confupdtype" AS "on_update", "con"."condeferrable" AS "deferrable", "con"."condeferred" AS "deferred" FROM ( SELECT UNNEST ("con1"."conkey") AS "parent", UNNEST ("con1"."confkey") AS "child", "con1"."confrelid", "con1"."conrelid", "con1"."conname", "con1"."contype", "ns"."nspname", "cl"."relname", "con1"."condeferrable", CASE WHEN "con1"."condeferred" THEN 'INITIALLY DEFERRED' ELSE 'INITIALLY IMMEDIATE' END as condeferred, CASE "con1"."confdeltype" WHEN 'a' THEN 'NO ACTION' WHEN 'r' THEN 'RESTRICT' WHEN 'c' THEN 'CASCADE' WHEN 'n' THEN 'SET NULL' WHEN 'd' THEN 'SET DEFAULT' END as "confdeltype", CASE "con1"."confupdtype" WHEN 'a' THEN 'NO ACTION' WHEN 'r' THEN 'RESTRICT' WHEN 'c' THEN 'CASCADE' WHEN 'n' THEN 'SET NULL' WHEN 'd' THEN 'SET DEFAULT' END as "confupdtype" FROM "pg_class" "cl" INNER JOIN "pg_namespace" "ns" ON "cl"."relnamespace" = "ns"."oid" INNER JOIN "pg_constraint" "con1" ON "con1"."conrelid" = "cl"."oid" WHERE "con1"."contype" = 'f' AND (("ns"."nspname" = 'public' AND "cl"."relname" = 'log_license')) ) "con" INNER JOIN "pg_attribute" "att" ON "att"."attrelid" = "con"."confrelid" AND "att"."attnum" = "con"."child" INNER JOIN "pg_class" "cl" ON "cl"."oid" = "con"."confrelid" INNER JOIN "pg_namespace" "ns" ON "cl"."relnamespace" = "ns"."oid" INNER JOIN "pg_attribute" "att2" ON "att2"."attrelid" = "con"."conrelid" AND "att2"."attnum" = "con"."parent"
37query: ALTER TABLE "log_license" ADD CONSTRAINT "LogLicenseClient" FOREIGN KEY ("client_id") REFERENCES "clients"("id") ON DELETE SET NULL ON UPDATE CASCADE
38query: ALTER TABLE "log_license" ADD CONSTRAINT "LogLicenseIntegration" FOREIGN KEY ("integration_id") REFERENCES "integrations"("id") ON DELETE SET NULL ON UPDATE CASCADE
39query: INSERT INTO "migrations"("timestamp", "name") VALUES ($1, $2) -- PARAMETERS: [1603107288231,"CreateLogLicense1603107288231"]
40Migration CreateLogLicense1603107288231 has been executed successfully.
41query: CREATE TABLE "licenses" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "integration_id" uuid NOT NULL, "client_id" uuid NOT NULL, "available_quantity" integer NOT NULL, "renewal_day" integer NOT NULL, "created_at" timestamp NOT NULL DEFAULT now(), "updated_at" timestamp NOT NULL DEFAULT now(), CONSTRAINT "PK_da5021501ce80efa03de6f40086" PRIMARY KEY ("id"))
42query: SELECT * FROM current_schema()
43query: SELECT * FROM "information_schema"."tables" WHERE ("table_schema" = 'public' AND "table_name" = 'licenses')
44query: SELECT *, ('"' || "udt_schema" || '"."' || "udt_name" || '"')::"regtype" AS "regtype" FROM "information_schema"."columns" WHERE ("table_schema" = 'public' AND "table_name" = 'licenses')
45query: SELECT "ns"."nspname" AS "table_schema", "t"."relname" AS "table_name", "cnst"."conname" AS "constraint_name", pg_get_constraintdef("cnst"."oid") AS "expression", CASE "cnst"."contype" WHEN 'p' THEN 'PRIMARY' WHEN 'u' THEN 'UNIQUE' WHEN 'c' THEN 'CHECK' WHEN 'x' THEN 'EXCLUDE' END AS "constraint_type", "a"."attname" AS "column_name" FROM "pg_constraint" "cnst" INNER JOIN "pg_class" "t" ON "t"."oid" = "cnst"."conrelid" INNER JOIN "pg_namespace" "ns" ON "ns"."oid" = "cnst"."connamespace" LEFT JOIN "pg_attribute" "a" ON "a"."attrelid" = "cnst"."conrelid" AND "a"."attnum" = ANY ("cnst"."conkey") WHERE "t"."relkind" = 'r' AND (("ns"."nspname" = 'public' AND "t"."relname" = 'licenses'))
46query: SELECT "ns"."nspname" AS "table_schema", "t"."relname" AS "table_name", "i"."relname" AS "constraint_name", "a"."attname" AS "column_name", CASE "ix"."indisunique" WHEN 't' THEN 'TRUE' ELSE'FALSE' END AS "is_unique", pg_get_expr("ix"."indpred", "ix"."indrelid") AS "condition", "types"."typname" AS "type_name" FROM "pg_class" "t" INNER JOIN "pg_index" "ix" ON "ix"."indrelid" = "t"."oid" INNER JOIN "pg_attribute" "a" ON "a"."attrelid" = "t"."oid" AND "a"."attnum" = ANY ("ix"."indkey") INNER JOIN "pg_namespace" "ns" ON "ns"."oid" = "t"."relnamespace" INNER JOIN "pg_class" "i" ON "i"."oid" = "ix"."indexrelid" INNER JOIN "pg_type" "types" ON "types"."oid" = "a"."atttypid" LEFT JOIN "pg_constraint" "cnst" ON "cnst"."conname" = "i"."relname" WHERE "t"."relkind" = 'r' AND "cnst"."contype" IS NULL AND (("ns"."nspname" = 'public' AND "t"."relname" = 'licenses'))
47query: SELECT "con"."conname" AS "constraint_name", "con"."nspname" AS "table_schema", "con"."relname" AS "table_name", "att2"."attname" AS "column_name", "ns"."nspname" AS "referenced_table_schema", "cl"."relname" AS "referenced_table_name", "att"."attname" AS "referenced_column_name", "con"."confdeltype" AS "on_delete", "con"."confupdtype" AS "on_update", "con"."condeferrable" AS "deferrable", "con"."condeferred" AS "deferred" FROM ( SELECT UNNEST ("con1"."conkey") AS "parent", UNNEST ("con1"."confkey") AS "child", "con1"."confrelid", "con1"."conrelid", "con1"."conname", "con1"."contype", "ns"."nspname", "cl"."relname", "con1"."condeferrable", CASE WHEN "con1"."condeferred" THEN 'INITIALLY DEFERRED' ELSE 'INITIALLY IMMEDIATE' END as condeferred, CASE "con1"."confdeltype" WHEN 'a' THEN 'NO ACTION' WHEN 'r' THEN 'RESTRICT' WHEN 'c' THEN 'CASCADE' WHEN 'n' THEN 'SET NULL' WHEN 'd' THEN 'SET DEFAULT' END as "confdeltype", CASE "con1"."confupdtype" WHEN 'a' THEN 'NO ACTION' WHEN 'r' THEN 'RESTRICT' WHEN 'c' THEN 'CASCADE' WHEN 'n' THEN 'SET NULL' WHEN 'd' THEN 'SET DEFAULT' END as "confupdtype" FROM "pg_class" "cl" INNER JOIN "pg_namespace" "ns" ON "cl"."relnamespace" = "ns"."oid" INNER JOIN "pg_constraint" "con1" ON "con1"."conrelid" = "cl"."oid" WHERE "con1"."contype" = 'f' AND (("ns"."nspname" = 'public' AND "cl"."relname" = 'licenses')) ) "con" INNER JOIN "pg_attribute" "att" ON "att"."attrelid" = "con"."confrelid" AND "att"."attnum" = "con"."child" INNER JOIN "pg_class" "cl" ON "cl"."oid" = "con"."confrelid" INNER JOIN "pg_namespace" "ns" ON "cl"."relnamespace" = "ns"."oid" INNER JOIN "pg_attribute" "att2" ON "att2"."attrelid" = "con"."conrelid" AND "att2"."attnum" = "con"."parent"
48query: ALTER TABLE "licenses" ADD CONSTRAINT "LicenseClient" FOREIGN KEY ("client_id") REFERENCES "clients"("id") ON DELETE SET NULL ON UPDATE CASCADE
49query: ALTER TABLE "licenses" ADD CONSTRAINT "LicenseIntegration" FOREIGN KEY ("integration_id") REFERENCES "integrations"("id") ON DELETE SET NULL ON UPDATE CASCADE
50query: INSERT INTO "migrations"("timestamp", "name") VALUES ($1, $2) -- PARAMETERS: [1603108219518,"CreateLicense1603108219518"]
51Migration CreateLicense1603108219518 has been executed successfully.
52query: SELECT * FROM current_schema()
53query: SELECT * FROM "information_schema"."tables" WHERE ("table_schema" = 'public' AND "table_name" = 'clients')
54query: SELECT *, ('"' || "udt_schema" || '"."' || "udt_name" || '"')::"regtype" AS "regtype" FROM "information_schema"."columns" WHERE ("table_schema" = 'public' AND "table_name" = 'clients')
55query: SELECT "ns"."nspname" AS "table_schema", "t"."relname" AS "table_name", "cnst"."conname" AS "constraint_name", pg_get_constraintdef("cnst"."oid") AS "expression", CASE "cnst"."contype" WHEN 'p' THEN 'PRIMARY' WHEN 'u' THEN 'UNIQUE' WHEN 'c' THEN 'CHECK' WHEN 'x' THEN 'EXCLUDE' END AS "constraint_type", "a"."attname" AS "column_name" FROM "pg_constraint" "cnst" INNER JOIN "pg_class" "t" ON "t"."oid" = "cnst"."conrelid" INNER JOIN "pg_namespace" "ns" ON "ns"."oid" = "cnst"."connamespace" LEFT JOIN "pg_attribute" "a" ON "a"."attrelid" = "cnst"."conrelid" AND "a"."attnum" = ANY ("cnst"."conkey") WHERE "t"."relkind" = 'r' AND (("ns"."nspname" = 'public' AND "t"."relname" = 'clients'))
56query: SELECT "ns"."nspname" AS "table_schema", "t"."relname" AS "table_name", "i"."relname" AS "constraint_name", "a"."attname" AS "column_name", CASE "ix"."indisunique" WHEN 't' THEN 'TRUE' ELSE'FALSE' END AS "is_unique", pg_get_expr("ix"."indpred", "ix"."indrelid") AS "condition", "types"."typname" AS "type_name" FROM "pg_class" "t" INNER JOIN "pg_index" "ix" ON "ix"."indrelid" = "t"."oid" INNER JOIN "pg_attribute" "a" ON "a"."attrelid" = "t"."oid" AND "a"."attnum" = ANY ("ix"."indkey") INNER JOIN "pg_namespace" "ns" ON "ns"."oid" = "t"."relnamespace" INNER JOIN "pg_class" "i" ON "i"."oid" = "ix"."indexrelid" INNER JOIN "pg_type" "types" ON "types"."oid" = "a"."atttypid" LEFT JOIN "pg_constraint" "cnst" ON "cnst"."conname" = "i"."relname" WHERE "t"."relkind" = 'r' AND "cnst"."contype" IS NULL AND (("ns"."nspname" = 'public' AND "t"."relname" = 'clients'))
57query: SELECT "con"."conname" AS "constraint_name", "con"."nspname" AS "table_schema", "con"."relname" AS "table_name", "att2"."attname" AS "column_name", "ns"."nspname" AS "referenced_table_schema", "cl"."relname" AS "referenced_table_name", "att"."attname" AS "referenced_column_name", "con"."confdeltype" AS "on_delete", "con"."confupdtype" AS "on_update", "con"."condeferrable" AS "deferrable", "con"."condeferred" AS "deferred" FROM ( SELECT UNNEST ("con1"."conkey") AS "parent", UNNEST ("con1"."confkey") AS "child", "con1"."confrelid", "con1"."conrelid", "con1"."conname", "con1"."contype", "ns"."nspname", "cl"."relname", "con1"."condeferrable", CASE WHEN "con1"."condeferred" THEN 'INITIALLY DEFERRED' ELSE 'INITIALLY IMMEDIATE' END as condeferred, CASE "con1"."confdeltype" WHEN 'a' THEN 'NO ACTION' WHEN 'r' THEN 'RESTRICT' WHEN 'c' THEN 'CASCADE' WHEN 'n' THEN 'SET NULL' WHEN 'd' THEN 'SET DEFAULT' END as "confdeltype", CASE "con1"."confupdtype" WHEN 'a' THEN 'NO ACTION' WHEN 'r' THEN 'RESTRICT' WHEN 'c' THEN 'CASCADE' WHEN 'n' THEN 'SET NULL' WHEN 'd' THEN 'SET DEFAULT' END as "confupdtype" FROM "pg_class" "cl" INNER JOIN "pg_namespace" "ns" ON "cl"."relnamespace" = "ns"."oid" INNER JOIN "pg_constraint" "con1" ON "con1"."conrelid" = "cl"."oid" WHERE "con1"."contype" = 'f' AND (("ns"."nspname" = 'public' AND "cl"."relname" = 'clients')) ) "con" INNER JOIN "pg_attribute" "att" ON "att"."attrelid" = "con"."confrelid" AND "att"."attnum" = "con"."child" INNER JOIN "pg_class" "cl" ON "cl"."oid" = "con"."confrelid" INNER JOIN "pg_namespace" "ns" ON "cl"."relnamespace" = "ns"."oid" INNER JOIN "pg_attribute" "att2" ON "att2"."attrelid" = "con"."conrelid" AND "att2"."attnum" = "con"."parent"
58query: ALTER TABLE "clients" ADD "citruscx_default_callback_msg" varchar
59query: ALTER TABLE "clients" ADD "citruscx_callback_created" varchar
60query: INSERT INTO "migrations"("timestamp", "name") VALUES ($1, $2) -- PARAMETERS: [1603136411700,"AddCitrusColumnsInClint1603136411700"]
61Migration AddCitrusColumnsInClint1603136411700 has been executed successfully.
62query: CREATE TABLE "log_interaction" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "status" text NOT NULL, "media_name" text NOT NULL, "broker" text NOT NULL, "client_id" uuid NOT NULL, "integration_id" uuid NOT NULL, "credentials" text, "callback_url" text, "sender_id" text, "sender_description" text, "thread_id" text, "request_id" uuid NOT NULL, "request_type" text, "request_sent_at" TIMESTAMP WITH TIME ZONE NOT NULL, "request_payload" text NOT NULL, "request_processed_at" TIMESTAMP WITH TIME ZONE, "response_received_at" TIMESTAMP WITH TIME ZONE, "response_success" boolean NOT NULL DEFAULT false, "response" text, "webhook_id" text, "webhook_status" text, "webhook_last_update" TIMESTAMP WITH TIME ZONE, "status_id" text, "broker_status" text, "status_last_update" TIMESTAMP WITH TIME ZONE, "callback_response" text, "query_text" text, CONSTRAINT "LogIteractionClient" FOREIGN KEY ("client_id") REFERENCES "clients" ("id") ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT "LogIteractionIntegration" FOREIGN KEY ("integration_id") REFERENCES "integrations" ("id") ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT "PK_2bd8c54d19eb4da7f3c97ecd49b" PRIMARY KEY ("id"))
63query failed: CREATE TABLE "log_interaction" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "status" text NOT NULL, "media_name" text NOT NULL, "broker" text NOT NULL, "client_id" uuid NOT NULL, "integration_id" uuid NOT NULL, "credentials" text, "callback_url" text, "sender_id" text, "sender_description" text, "thread_id" text, "request_id" uuid NOT NULL, "request_type" text, "request_sent_at" TIMESTAMP WITH TIME ZONE NOT NULL, "request_payload" text NOT NULL, "request_processed_at" TIMESTAMP WITH TIME ZONE, "response_received_at" TIMESTAMP WITH TIME ZONE, "response_success" boolean NOT NULL DEFAULT false, "response" text, "webhook_id" text, "webhook_status" text, "webhook_last_update" TIMESTAMP WITH TIME ZONE, "status_id" text, "broker_status" text, "status_last_update" TIMESTAMP WITH TIME ZONE, "callback_response" text, "query_text" text, CONSTRAINT "LogIteractionClient" FOREIGN KEY ("client_id") REFERENCES "clients" ("id") ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT "LogIteractionIntegration" FOREIGN KEY ("integration_id") REFERENCES "integrations" ("id") ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT "PK_2bd8c54d19eb4da7f3c97ecd49b" PRIMARY KEY ("id"))
64error: error: relation "log_interaction" already exists
65 at Parser.parseErrorMessage (/app/node_modules/pg-protocol/dist/parser.js:278:15)
66 at Parser.handlePacket (/app/node_modules/pg-protocol/dist/parser.js:126:29)
67 at Parser.parse (/app/node_modules/pg-protocol/dist/parser.js:39:38)
68 at Socket.<anonymous> (/app/node_modules/pg-protocol/dist/index.js:8:42)
69 at Socket.emit (events.js:315:20)
70 at addChunk (_stream_readable.js:295:12)
71 at readableAddChunk (_stream_readable.js:271:9)
72 at Socket.Readable.push (_stream_readable.js:212:10)
73 at TCP.onStreamRead (internal/stream_base_commons.js:186:23) {
74 length: 109,
75 severity: 'ERROR',
76 code: '42P07',
77 detail: undefined,
78 hint: undefined,
79 position: undefined,
80 internalPosition: undefined,
81 internalQuery: undefined,
82 where: undefined,
83 schema: undefined,
84 table: undefined,
85 column: undefined,
86 dataType: undefined,
87 constraint: undefined,
88 file: 'heap.c',
89 line: '1153',
90 routine: 'heap_create_with_catalog'
91}
92query: ROLLBACK
93Error during migration run:
94QueryFailedError: relation "log_interaction" already exists
95 at new QueryFailedError (/app/node_modules/typeorm/error/QueryFailedError.js:11:28)
96 at Query.callback (/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:176:38)
97 at Query.handleError (/app/node_modules/pg/lib/query.js:139:19)
98 at Client._handleErrorMessage (/app/node_modules/pg/lib/client.js:326:17)
99 at Connection.emit (events.js:315:20)
100 at /app/node_modules/pg/lib/connection.js:109:12
101 at Parser.parse (/app/node_modules/pg-protocol/dist/parser.js:40:17)
102 at Socket.<anonymous> (/app/node_modules/pg-protocol/dist/index.js:8:42)
103 at Socket.emit (events.js:315:20)
104 at addChunk (_stream_readable.js:295:12) {
105 length: 109,
106 severity: 'ERROR',
107 code: '42P07',
108 detail: undefined,
109 hint: undefined,
110 position: undefined,
111 internalPosition: undefined,
112 internalQuery: undefined,
113 where: undefined,
114 schema: undefined,
115 table: undefined,
116 column: undefined,
117 dataType: undefined,
118 constraint: undefined,
119 file: 'heap.c',
120 line: '1153',
121 routine: 'heap_create_with_catalog',
122 query: 'CREATE TABLE "log_interaction" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "status" text NOT NULL, "media_name" text NOT NULL, "broker" text NOT NULL, "client_id" uuid NOT NULL, "integration_id" uuid NOT NULL, "credentials" text, "callback_url" text, "sender_id" text, "sender_description" text, "thread_id" text, "request_id" uuid NOT NULL, "request_type" text, "request_sent_at" TIMESTAMP WITH TIME ZONE NOT NULL, "request_payload" text NOT NULL, "request_processed_at" TIMESTAMP WITH TIME ZONE, "response_received_at" TIMESTAMP WITH TIME ZONE, "response_success" boolean NOT NULL DEFAULT false, "response" text, "webhook_id" text, "webhook_status" text, "webhook_last_update" TIMESTAMP WITH TIME ZONE, "status_id" text, "broker_status" text, "status_last_update" TIMESTAMP WITH TIME ZONE, "callback_response" text, "query_text" text, CONSTRAINT "LogIteractionClient" FOREIGN KEY ("client_id") REFERENCES "clients" ("id") ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT "LogIteractionIntegration" FOREIGN KEY ("integration_id") REFERENCES "integrations" ("id") ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT "PK_2bd8c54d19eb4da7f3c97ecd49b" PRIMARY KEY ("id"))',
123 parameters: []
124}
125:: Loading data from Docker variables
126:: Starting DCS Admin API. Port 3333
127query: SELECT * FROM "information_schema"."tables" WHERE "table_schema" = current_schema() AND "table_name" = 'migrations'
128query: SELECT * FROM "migrations" "migrations" ORDER BY "id" DESC
1290 migrations are already loaded in the database.
13013 migrations were found in the source code.
13113 migrations are new migrations that needs to be executed.
132query: START TRANSACTION
133query: CREATE TABLE "clients" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "name" varchar NOT NULL, "email" varchar NOT NULL, "enabled" boolean NOT NULL DEFAULT true, "url_callback" varchar, "phone" varchar, "token" varchar, "created_at" timestamp NOT NULL DEFAULT now(), "updated_at" timestamp NOT NULL DEFAULT now(), CONSTRAINT "UQ_b48860677afe62cd96e12659482" UNIQUE ("email"), CONSTRAINT "PK_f1ab7cf3a5714dbc6bb4e1c28a4" PRIMARY KEY ("id"))
134query: INSERT INTO "migrations"("timestamp", "name") VALUES ($1, $2) -- PARAMETERS: [1599480911102,"CreateClients1599480911102"]
135Migration CreateClients1599480911102 has been executed successfully.
136query: CREATE TABLE "users" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "name" varchar NOT NULL, "email" varchar NOT NULL, "password" varchar NOT NULL, "blocked" boolean NOT NULL DEFAULT false, "root" boolean NOT NULL DEFAULT false, "note" text, "client_id" uuid, "created_at" timestamp NOT NULL DEFAULT now(), "updated_at" timestamp NOT NULL DEFAULT now(), CONSTRAINT "UQ_97672ac88f789774dd47f7c8be3" UNIQUE ("email"), CONSTRAINT "PK_a3ffb1c0c8416b9fc6f907b7433" PRIMARY KEY ("id"))
137query: SELECT * FROM current_schema()
138query: SELECT * FROM "information_schema"."tables" WHERE ("table_schema" = 'public' AND "table_name" = 'users')
139query: SELECT *, ('"' || "udt_schema" || '"."' || "udt_name" || '"')::"regtype" AS "regtype" FROM "information_schema"."columns" WHERE ("table_schema" = 'public' AND "table_name" = 'users')
140query: SELECT "ns"."nspname" AS "table_schema", "t"."relname" AS "table_name", "cnst"."conname" AS "constraint_name", pg_get_constraintdef("cnst"."oid") AS "expression", CASE "cnst"."contype" WHEN 'p' THEN 'PRIMARY' WHEN 'u' THEN 'UNIQUE' WHEN 'c' THEN 'CHECK' WHEN 'x' THEN 'EXCLUDE' END AS "constraint_type", "a"."attname" AS "column_name" FROM "pg_constraint" "cnst" INNER JOIN "pg_class" "t" ON "t"."oid" = "cnst"."conrelid" INNER JOIN "pg_namespace" "ns" ON "ns"."oid" = "cnst"."connamespace" LEFT JOIN "pg_attribute" "a" ON "a"."attrelid" = "cnst"."conrelid" AND "a"."attnum" = ANY ("cnst"."conkey") WHERE "t"."relkind" = 'r' AND (("ns"."nspname" = 'public' AND "t"."relname" = 'users'))
141query: SELECT "ns"."nspname" AS "table_schema", "t"."relname" AS "table_name", "i"."relname" AS "constraint_name", "a"."attname" AS "column_name", CASE "ix"."indisunique" WHEN 't' THEN 'TRUE' ELSE'FALSE' END AS "is_unique", pg_get_expr("ix"."indpred", "ix"."indrelid") AS "condition", "types"."typname" AS "type_name" FROM "pg_class" "t" INNER JOIN "pg_index" "ix" ON "ix"."indrelid" = "t"."oid" INNER JOIN "pg_attribute" "a" ON "a"."attrelid" = "t"."oid" AND "a"."attnum" = ANY ("ix"."indkey") INNER JOIN "pg_namespace" "ns" ON "ns"."oid" = "t"."relnamespace" INNER JOIN "pg_class" "i" ON "i"."oid" = "ix"."indexrelid" INNER JOIN "pg_type" "types" ON "types"."oid" = "a"."atttypid" LEFT JOIN "pg_constraint" "cnst" ON "cnst"."conname" = "i"."relname" WHERE "t"."relkind" = 'r' AND "cnst"."contype" IS NULL AND (("ns"."nspname" = 'public' AND "t"."relname" = 'users'))
142query: SELECT "con"."conname" AS "constraint_name", "con"."nspname" AS "table_schema", "con"."relname" AS "table_name", "att2"."attname" AS "column_name", "ns"."nspname" AS "referenced_table_schema", "cl"."relname" AS "referenced_table_name", "att"."attname" AS "referenced_column_name", "con"."confdeltype" AS "on_delete", "con"."confupdtype" AS "on_update", "con"."condeferrable" AS "deferrable", "con"."condeferred" AS "deferred" FROM ( SELECT UNNEST ("con1"."conkey") AS "parent", UNNEST ("con1"."confkey") AS "child", "con1"."confrelid", "con1"."conrelid", "con1"."conname", "con1"."contype", "ns"."nspname", "cl"."relname", "con1"."condeferrable", CASE WHEN "con1"."condeferred" THEN 'INITIALLY DEFERRED' ELSE 'INITIALLY IMMEDIATE' END as condeferred, CASE "con1"."confdeltype" WHEN 'a' THEN 'NO ACTION' WHEN 'r' THEN 'RESTRICT' WHEN 'c' THEN 'CASCADE' WHEN 'n' THEN 'SET NULL' WHEN 'd' THEN 'SET DEFAULT' END as "confdeltype", CASE "con1"."confupdtype" WHEN 'a' THEN 'NO ACTION' WHEN 'r' THEN 'RESTRICT' WHEN 'c' THEN 'CASCADE' WHEN 'n' THEN 'SET NULL' WHEN 'd' THEN 'SET DEFAULT' END as "confupdtype" FROM "pg_class" "cl" INNER JOIN "pg_namespace" "ns" ON "cl"."relnamespace" = "ns"."oid" INNER JOIN "pg_constraint" "con1" ON "con1"."conrelid" = "cl"."oid" WHERE "con1"."contype" = 'f' AND (("ns"."nspname" = 'public' AND "cl"."relname" = 'users')) ) "con" INNER JOIN "pg_attribute" "att" ON "att"."attrelid" = "con"."confrelid" AND "att"."attnum" = "con"."child" INNER JOIN "pg_class" "cl" ON "cl"."oid" = "con"."confrelid" INNER JOIN "pg_namespace" "ns" ON "cl"."relnamespace" = "ns"."oid" INNER JOIN "pg_attribute" "att2" ON "att2"."attrelid" = "con"."conrelid" AND "att2"."attnum" = "con"."parent"
143query: ALTER TABLE "users" ADD CONSTRAINT "UserClient" FOREIGN KEY ("client_id") REFERENCES "clients"("id") ON DELETE CASCADE ON UPDATE CASCADE
144query: INSERT INTO "migrations"("timestamp", "name") VALUES ($1, $2) -- PARAMETERS: [1599488421038,"CreateUsers1599488421038"]
145Migration CreateUsers1599488421038 has been executed successfully.
146query: CREATE TABLE "integration_config" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "media_name" varchar NOT NULL, "broker" varchar NOT NULL, "config" varchar NOT NULL, CONSTRAINT "PK_842e21f6fbb00008d9b0c9dc18e" PRIMARY KEY ("id"))
147query: INSERT INTO "migrations"("timestamp", "name") VALUES ($1, $2) -- PARAMETERS: [1602812982792,"CreateIntegrationConfig1602812982792"]
148Migration CreateIntegrationConfig1602812982792 has been executed successfully.
149query: CREATE TABLE "integrations" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "name" varchar NOT NULL, "media_name" varchar NOT NULL, "broker" varchar NOT NULL, "credentials" varchar NOT NULL, "global" boolean NOT NULL DEFAULT false, "created_at" timestamp NOT NULL DEFAULT now(), "updated_at" timestamp NOT NULL DEFAULT now(), CONSTRAINT "PK_9adcdc6d6f3922535361ce641e8" PRIMARY KEY ("id"))
150query: INSERT INTO "migrations"("timestamp", "name") VALUES ($1, $2) -- PARAMETERS: [1602863619728,"CreateIntegration1602863619728"]
151Migration CreateIntegration1602863619728 has been executed successfully.
152query: CREATE TABLE "log_license" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "integration_id" uuid NOT NULL, "client_id" uuid NOT NULL, "start_period" timestamp NOT NULL DEFAULT now(), "end_period" timestamp, "available_quantity" integer NOT NULL, "quantity_used" integer DEFAULT 0, "renewal_day" integer NOT NULL, "created_at" timestamp NOT NULL DEFAULT now(), "updated_at" timestamp NOT NULL DEFAULT now(), CONSTRAINT "PK_fca403dc856545a904045e2b534" PRIMARY KEY ("id"))
153query: SELECT * FROM current_schema()
154query: SELECT * FROM "information_schema"."tables" WHERE ("table_schema" = 'public' AND "table_name" = 'log_license')
155query: SELECT *, ('"' || "udt_schema" || '"."' || "udt_name" || '"')::"regtype" AS "regtype" FROM "information_schema"."columns" WHERE ("table_schema" = 'public' AND "table_name" = 'log_license')
156query: SELECT "ns"."nspname" AS "table_schema", "t"."relname" AS "table_name", "cnst"."conname" AS "constraint_name", pg_get_constraintdef("cnst"."oid") AS "expression", CASE "cnst"."contype" WHEN 'p' THEN 'PRIMARY' WHEN 'u' THEN 'UNIQUE' WHEN 'c' THEN 'CHECK' WHEN 'x' THEN 'EXCLUDE' END AS "constraint_type", "a"."attname" AS "column_name" FROM "pg_constraint" "cnst" INNER JOIN "pg_class" "t" ON "t"."oid" = "cnst"."conrelid" INNER JOIN "pg_namespace" "ns" ON "ns"."oid" = "cnst"."connamespace" LEFT JOIN "pg_attribute" "a" ON "a"."attrelid" = "cnst"."conrelid" AND "a"."attnum" = ANY ("cnst"."conkey") WHERE "t"."relkind" = 'r' AND (("ns"."nspname" = 'public' AND "t"."relname" = 'log_license'))
157query: SELECT "ns"."nspname" AS "table_schema", "t"."relname" AS "table_name", "i"."relname" AS "constraint_name", "a"."attname" AS "column_name", CASE "ix"."indisunique" WHEN 't' THEN 'TRUE' ELSE'FALSE' END AS "is_unique", pg_get_expr("ix"."indpred", "ix"."indrelid") AS "condition", "types"."typname" AS "type_name" FROM "pg_class" "t" INNER JOIN "pg_index" "ix" ON "ix"."indrelid" = "t"."oid" INNER JOIN "pg_attribute" "a" ON "a"."attrelid" = "t"."oid" AND "a"."attnum" = ANY ("ix"."indkey") INNER JOIN "pg_namespace" "ns" ON "ns"."oid" = "t"."relnamespace" INNER JOIN "pg_class" "i" ON "i"."oid" = "ix"."indexrelid" INNER JOIN "pg_type" "types" ON "types"."oid" = "a"."atttypid" LEFT JOIN "pg_constraint" "cnst" ON "cnst"."conname" = "i"."relname" WHERE "t"."relkind" = 'r' AND "cnst"."contype" IS NULL AND (("ns"."nspname" = 'public' AND "t"."relname" = 'log_license'))
158query: SELECT "con"."conname" AS "constraint_name", "con"."nspname" AS "table_schema", "con"."relname" AS "table_name", "att2"."attname" AS "column_name", "ns"."nspname" AS "referenced_table_schema", "cl"."relname" AS "referenced_table_name", "att"."attname" AS "referenced_column_name", "con"."confdeltype" AS "on_delete", "con"."confupdtype" AS "on_update", "con"."condeferrable" AS "deferrable", "con"."condeferred" AS "deferred" FROM ( SELECT UNNEST ("con1"."conkey") AS "parent", UNNEST ("con1"."confkey") AS "child", "con1"."confrelid", "con1"."conrelid", "con1"."conname", "con1"."contype", "ns"."nspname", "cl"."relname", "con1"."condeferrable", CASE WHEN "con1"."condeferred" THEN 'INITIALLY DEFERRED' ELSE 'INITIALLY IMMEDIATE' END as condeferred, CASE "con1"."confdeltype" WHEN 'a' THEN 'NO ACTION' WHEN 'r' THEN 'RESTRICT' WHEN 'c' THEN 'CASCADE' WHEN 'n' THEN 'SET NULL' WHEN 'd' THEN 'SET DEFAULT' END as "confdeltype", CASE "con1"."confupdtype" WHEN 'a' THEN 'NO ACTION' WHEN 'r' THEN 'RESTRICT' WHEN 'c' THEN 'CASCADE' WHEN 'n' THEN 'SET NULL' WHEN 'd' THEN 'SET DEFAULT' END as "confupdtype" FROM "pg_class" "cl" INNER JOIN "pg_namespace" "ns" ON "cl"."relnamespace" = "ns"."oid" INNER JOIN "pg_constraint" "con1" ON "con1"."conrelid" = "cl"."oid" WHERE "con1"."contype" = 'f' AND (("ns"."nspname" = 'public' AND "cl"."relname" = 'log_license')) ) "con" INNER JOIN "pg_attribute" "att" ON "att"."attrelid" = "con"."confrelid" AND "att"."attnum" = "con"."child" INNER JOIN "pg_class" "cl" ON "cl"."oid" = "con"."confrelid" INNER JOIN "pg_namespace" "ns" ON "cl"."relnamespace" = "ns"."oid" INNER JOIN "pg_attribute" "att2" ON "att2"."attrelid" = "con"."conrelid" AND "att2"."attnum" = "con"."parent"
159query: ALTER TABLE "log_license" ADD CONSTRAINT "LogLicenseClient" FOREIGN KEY ("client_id") REFERENCES "clients"("id") ON DELETE SET NULL ON UPDATE CASCADE
160query: ALTER TABLE "log_license" ADD CONSTRAINT "LogLicenseIntegration" FOREIGN KEY ("integration_id") REFERENCES "integrations"("id") ON DELETE SET NULL ON UPDATE CASCADE
161query: INSERT INTO "migrations"("timestamp", "name") VALUES ($1, $2) -- PARAMETERS: [1603107288231,"CreateLogLicense1603107288231"]
162Migration CreateLogLicense1603107288231 has been executed successfully.
163query: CREATE TABLE "licenses" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "integration_id" uuid NOT NULL, "client_id" uuid NOT NULL, "available_quantity" integer NOT NULL, "renewal_day" integer NOT NULL, "created_at" timestamp NOT NULL DEFAULT now(), "updated_at" timestamp NOT NULL DEFAULT now(), CONSTRAINT "PK_da5021501ce80efa03de6f40086" PRIMARY KEY ("id"))
164query: SELECT * FROM current_schema()
165query: SELECT * FROM "information_schema"."tables" WHERE ("table_schema" = 'public' AND "table_name" = 'licenses')
166query: SELECT *, ('"' || "udt_schema" || '"."' || "udt_name" || '"')::"regtype" AS "regtype" FROM "information_schema"."columns" WHERE ("table_schema" = 'public' AND "table_name" = 'licenses')
167query: SELECT "ns"."nspname" AS "table_schema", "t"."relname" AS "table_name", "cnst"."conname" AS "constraint_name", pg_get_constraintdef("cnst"."oid") AS "expression", CASE "cnst"."contype" WHEN 'p' THEN 'PRIMARY' WHEN 'u' THEN 'UNIQUE' WHEN 'c' THEN 'CHECK' WHEN 'x' THEN 'EXCLUDE' END AS "constraint_type", "a"."attname" AS "column_name" FROM "pg_constraint" "cnst" INNER JOIN "pg_class" "t" ON "t"."oid" = "cnst"."conrelid" INNER JOIN "pg_namespace" "ns" ON "ns"."oid" = "cnst"."connamespace" LEFT JOIN "pg_attribute" "a" ON "a"."attrelid" = "cnst"."conrelid" AND "a"."attnum" = ANY ("cnst"."conkey") WHERE "t"."relkind" = 'r' AND (("ns"."nspname" = 'public' AND "t"."relname" = 'licenses'))
168query: SELECT "ns"."nspname" AS "table_schema", "t"."relname" AS "table_name", "i"."relname" AS "constraint_name", "a"."attname" AS "column_name", CASE "ix"."indisunique" WHEN 't' THEN 'TRUE' ELSE'FALSE' END AS "is_unique", pg_get_expr("ix"."indpred", "ix"."indrelid") AS "condition", "types"."typname" AS "type_name" FROM "pg_class" "t" INNER JOIN "pg_index" "ix" ON "ix"."indrelid" = "t"."oid" INNER JOIN "pg_attribute" "a" ON "a"."attrelid" = "t"."oid" AND "a"."attnum" = ANY ("ix"."indkey") INNER JOIN "pg_namespace" "ns" ON "ns"."oid" = "t"."relnamespace" INNER JOIN "pg_class" "i" ON "i"."oid" = "ix"."indexrelid" INNER JOIN "pg_type" "types" ON "types"."oid" = "a"."atttypid" LEFT JOIN "pg_constraint" "cnst" ON "cnst"."conname" = "i"."relname" WHERE "t"."relkind" = 'r' AND "cnst"."contype" IS NULL AND (("ns"."nspname" = 'public' AND "t"."relname" = 'licenses'))
169query: SELECT "con"."conname" AS "constraint_name", "con"."nspname" AS "table_schema", "con"."relname" AS "table_name", "att2"."attname" AS "column_name", "ns"."nspname" AS "referenced_table_schema", "cl"."relname" AS "referenced_table_name", "att"."attname" AS "referenced_column_name", "con"."confdeltype" AS "on_delete", "con"."confupdtype" AS "on_update", "con"."condeferrable" AS "deferrable", "con"."condeferred" AS "deferred" FROM ( SELECT UNNEST ("con1"."conkey") AS "parent", UNNEST ("con1"."confkey") AS "child", "con1"."confrelid", "con1"."conrelid", "con1"."conname", "con1"."contype", "ns"."nspname", "cl"."relname", "con1"."condeferrable", CASE WHEN "con1"."condeferred" THEN 'INITIALLY DEFERRED' ELSE 'INITIALLY IMMEDIATE' END as condeferred, CASE "con1"."confdeltype" WHEN 'a' THEN 'NO ACTION' WHEN 'r' THEN 'RESTRICT' WHEN 'c' THEN 'CASCADE' WHEN 'n' THEN 'SET NULL' WHEN 'd' THEN 'SET DEFAULT' END as "confdeltype", CASE "con1"."confupdtype" WHEN 'a' THEN 'NO ACTION' WHEN 'r' THEN 'RESTRICT' WHEN 'c' THEN 'CASCADE' WHEN 'n' THEN 'SET NULL' WHEN 'd' THEN 'SET DEFAULT' END as "confupdtype" FROM "pg_class" "cl" INNER JOIN "pg_namespace" "ns" ON "cl"."relnamespace" = "ns"."oid" INNER JOIN "pg_constraint" "con1" ON "con1"."conrelid" = "cl"."oid" WHERE "con1"."contype" = 'f' AND (("ns"."nspname" = 'public' AND "cl"."relname" = 'licenses')) ) "con" INNER JOIN "pg_attribute" "att" ON "att"."attrelid" = "con"."confrelid" AND "att"."attnum" = "con"."child" INNER JOIN "pg_class" "cl" ON "cl"."oid" = "con"."confrelid" INNER JOIN "pg_namespace" "ns" ON "cl"."relnamespace" = "ns"."oid" INNER JOIN "pg_attribute" "att2" ON "att2"."attrelid" = "con"."conrelid" AND "att2"."attnum" = "con"."parent"
170query: ALTER TABLE "licenses" ADD CONSTRAINT "LicenseClient" FOREIGN KEY ("client_id") REFERENCES "clients"("id") ON DELETE SET NULL ON UPDATE CASCADE
171query: ALTER TABLE "licenses" ADD CONSTRAINT "LicenseIntegration" FOREIGN KEY ("integration_id") REFERENCES "integrations"("id") ON DELETE SET NULL ON UPDATE CASCADE
172query: INSERT INTO "migrations"("timestamp", "name") VALUES ($1, $2) -- PARAMETERS: [1603108219518,"CreateLicense1603108219518"]
173Migration CreateLicense1603108219518 has been executed successfully.
174query: SELECT * FROM current_schema()
175query: SELECT * FROM "information_schema"."tables" WHERE ("table_schema" = 'public' AND "table_name" = 'clients')
176query: SELECT *, ('"' || "udt_schema" || '"."' || "udt_name" || '"')::"regtype" AS "regtype" FROM "information_schema"."columns" WHERE ("table_schema" = 'public' AND "table_name" = 'clients')
177query: SELECT "ns"."nspname" AS "table_schema", "t"."relname" AS "table_name", "cnst"."conname" AS "constraint_name", pg_get_constraintdef("cnst"."oid") AS "expression", CASE "cnst"."contype" WHEN 'p' THEN 'PRIMARY' WHEN 'u' THEN 'UNIQUE' WHEN 'c' THEN 'CHECK' WHEN 'x' THEN 'EXCLUDE' END AS "constraint_type", "a"."attname" AS "column_name" FROM "pg_constraint" "cnst" INNER JOIN "pg_class" "t" ON "t"."oid" = "cnst"."conrelid" INNER JOIN "pg_namespace" "ns" ON "ns"."oid" = "cnst"."connamespace" LEFT JOIN "pg_attribute" "a" ON "a"."attrelid" = "cnst"."conrelid" AND "a"."attnum" = ANY ("cnst"."conkey") WHERE "t"."relkind" = 'r' AND (("ns"."nspname" = 'public' AND "t"."relname" = 'clients'))
178query: SELECT "ns"."nspname" AS "table_schema", "t"."relname" AS "table_name", "i"."relname" AS "constraint_name", "a"."attname" AS "column_name", CASE "ix"."indisunique" WHEN 't' THEN 'TRUE' ELSE'FALSE' END AS "is_unique", pg_get_expr("ix"."indpred", "ix"."indrelid") AS "condition", "types"."typname" AS "type_name" FROM "pg_class" "t" INNER JOIN "pg_index" "ix" ON "ix"."indrelid" = "t"."oid" INNER JOIN "pg_attribute" "a" ON "a"."attrelid" = "t"."oid" AND "a"."attnum" = ANY ("ix"."indkey") INNER JOIN "pg_namespace" "ns" ON "ns"."oid" = "t"."relnamespace" INNER JOIN "pg_class" "i" ON "i"."oid" = "ix"."indexrelid" INNER JOIN "pg_type" "types" ON "types"."oid" = "a"."atttypid" LEFT JOIN "pg_constraint" "cnst" ON "cnst"."conname" = "i"."relname" WHERE "t"."relkind" = 'r' AND "cnst"."contype" IS NULL AND (("ns"."nspname" = 'public' AND "t"."relname" = 'clients'))
179query: SELECT "con"."conname" AS "constraint_name", "con"."nspname" AS "table_schema", "con"."relname" AS "table_name", "att2"."attname" AS "column_name", "ns"."nspname" AS "referenced_table_schema", "cl"."relname" AS "referenced_table_name", "att"."attname" AS "referenced_column_name", "con"."confdeltype" AS "on_delete", "con"."confupdtype" AS "on_update", "con"."condeferrable" AS "deferrable", "con"."condeferred" AS "deferred" FROM ( SELECT UNNEST ("con1"."conkey") AS "parent", UNNEST ("con1"."confkey") AS "child", "con1"."confrelid", "con1"."conrelid", "con1"."conname", "con1"."contype", "ns"."nspname", "cl"."relname", "con1"."condeferrable", CASE WHEN "con1"."condeferred" THEN 'INITIALLY DEFERRED' ELSE 'INITIALLY IMMEDIATE' END as condeferred, CASE "con1"."confdeltype" WHEN 'a' THEN 'NO ACTION' WHEN 'r' THEN 'RESTRICT' WHEN 'c' THEN 'CASCADE' WHEN 'n' THEN 'SET NULL' WHEN 'd' THEN 'SET DEFAULT' END as "confdeltype", CASE "con1"."confupdtype" WHEN 'a' THEN 'NO ACTION' WHEN 'r' THEN 'RESTRICT' WHEN 'c' THEN 'CASCADE' WHEN 'n' THEN 'SET NULL' WHEN 'd' THEN 'SET DEFAULT' END as "confupdtype" FROM "pg_class" "cl" INNER JOIN "pg_namespace" "ns" ON "cl"."relnamespace" = "ns"."oid" INNER JOIN "pg_constraint" "con1" ON "con1"."conrelid" = "cl"."oid" WHERE "con1"."contype" = 'f' AND (("ns"."nspname" = 'public' AND "cl"."relname" = 'clients')) ) "con" INNER JOIN "pg_attribute" "att" ON "att"."attrelid" = "con"."confrelid" AND "att"."attnum" = "con"."child" INNER JOIN "pg_class" "cl" ON "cl"."oid" = "con"."confrelid" INNER JOIN "pg_namespace" "ns" ON "cl"."relnamespace" = "ns"."oid" INNER JOIN "pg_attribute" "att2" ON "att2"."attrelid" = "con"."conrelid" AND "att2"."attnum" = "con"."parent"
180query: ALTER TABLE "clients" ADD "citruscx_default_callback_msg" varchar
181query: ALTER TABLE "clients" ADD "citruscx_callback_created" varchar
182query: INSERT INTO "migrations"("timestamp", "name") VALUES ($1, $2) -- PARAMETERS: [1603136411700,"AddCitrusColumnsInClint1603136411700"]
183Migration AddCitrusColumnsInClint1603136411700 has been executed successfully.
184query: CREATE TABLE "log_interaction" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "status" text NOT NULL, "media_name" text NOT NULL, "broker" text NOT NULL, "client_id" uuid NOT NULL, "integration_id" uuid NOT NULL, "credentials" text, "callback_url" text, "sender_id" text, "sender_description" text, "thread_id" text, "request_id" uuid NOT NULL, "request_type" text, "request_sent_at" TIMESTAMP WITH TIME ZONE NOT NULL, "request_payload" text NOT NULL, "request_processed_at" TIMESTAMP WITH TIME ZONE, "response_received_at" TIMESTAMP WITH TIME ZONE, "response_success" boolean NOT NULL DEFAULT false, "response" text, "webhook_id" text, "webhook_status" text, "webhook_last_update" TIMESTAMP WITH TIME ZONE, "status_id" text, "broker_status" text, "status_last_update" TIMESTAMP WITH TIME ZONE, "callback_response" text, "query_text" text, CONSTRAINT "LogIteractionClient" FOREIGN KEY ("client_id") REFERENCES "clients" ("id") ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT "LogIteractionIntegration" FOREIGN KEY ("integration_id") REFERENCES "integrations" ("id") ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT "PK_2bd8c54d19eb4da7f3c97ecd49b" PRIMARY KEY ("id"))
185query failed: CREATE TABLE "log_interaction" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "status" text NOT NULL, "media_name" text NOT NULL, "broker" text NOT NULL, "client_id" uuid NOT NULL, "integration_id" uuid NOT NULL, "credentials" text, "callback_url" text, "sender_id" text, "sender_description" text, "thread_id" text, "request_id" uuid NOT NULL, "request_type" text, "request_sent_at" TIMESTAMP WITH TIME ZONE NOT NULL, "request_payload" text NOT NULL, "request_processed_at" TIMESTAMP WITH TIME ZONE, "response_received_at" TIMESTAMP WITH TIME ZONE, "response_success" boolean NOT NULL DEFAULT false, "response" text, "webhook_id" text, "webhook_status" text, "webhook_last_update" TIMESTAMP WITH TIME ZONE, "status_id" text, "broker_status" text, "status_last_update" TIMESTAMP WITH TIME ZONE, "callback_response" text, "query_text" text, CONSTRAINT "LogIteractionClient" FOREIGN KEY ("client_id") REFERENCES "clients" ("id") ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT "LogIteractionIntegration" FOREIGN KEY ("integration_id") REFERENCES "integrations" ("id") ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT "PK_2bd8c54d19eb4da7f3c97ecd49b" PRIMARY KEY ("id"))
186error: error: relation "log_interaction" already exists
187 at Parser.parseErrorMessage (/app/node_modules/pg-protocol/dist/parser.js:278:15)
188 at Parser.handlePacket (/app/node_modules/pg-protocol/dist/parser.js:126:29)
189 at Parser.parse (/app/node_modules/pg-protocol/dist/parser.js:39:38)
190 at Socket.<anonymous> (/app/node_modules/pg-protocol/dist/index.js:8:42)
191 at Socket.emit (events.js:315:20)
192 at addChunk (_stream_readable.js:295:12)
193 at readableAddChunk (_stream_readable.js:271:9)
194 at Socket.Readable.push (_stream_readable.js:212:10)
195 at TCP.onStreamRead (internal/stream_base_commons.js:186:23) {
196 length: 109,
197 severity: 'ERROR',
198 code: '42P07',
199 detail: undefined,
200 hint: undefined,
201 position: undefined,
202 internalPosition: undefined,
203 internalQuery: undefined,
204 where: undefined,
205 schema: undefined,
206 table: undefined,
207 column: undefined,
208 dataType: undefined,
209 constraint: undefined,
210 file: 'heap.c',
211 line: '1153',
212 routine: 'heap_create_with_catalog'
213}
214query: ROLLBACK
215Error during migration run:
216QueryFailedError: relation "log_interaction" already exists
217 at new QueryFailedError (/app/node_modules/typeorm/error/QueryFailedError.js:11:28)
218 at Query.callback (/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:176:38)
219 at Query.handleError (/app/node_modules/pg/lib/query.js:139:19)
220 at Client._handleErrorMessage (/app/node_modules/pg/lib/client.js:326:17)
221 at Connection.emit (events.js:315:20)
222 at /app/node_modules/pg/lib/connection.js:109:12
223 at Parser.parse (/app/node_modules/pg-protocol/dist/parser.js:40:17)
224 at Socket.<anonymous> (/app/node_modules/pg-protocol/dist/index.js:8:42)
225 at Socket.emit (events.js:315:20)
226 at addChunk (_stream_readable.js:295:12) {
227 length: 109,
228 severity: 'ERROR',
229 code: '42P07',
230 detail: undefined,
231 hint: undefined,
232 position: undefined,
233 internalPosition: undefined,
234 internalQuery: undefined,
235 where: undefined,
236 schema: undefined,
237 table: undefined,
238 column: undefined,
239 dataType: undefined,
240 constraint: undefined,
241 file: 'heap.c',
242 line: '1153',
243 routine: 'heap_create_with_catalog',
244 query: 'CREATE TABLE "log_interaction" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "status" text NOT NULL, "media_name" text NOT NULL, "broker" text NOT NULL, "client_id" uuid NOT NULL, "integration_id" uuid NOT NULL, "credentials" text, "callback_url" text, "sender_id" text, "sender_description" text, "thread_id" text, "request_id" uuid NOT NULL, "request_type" text, "request_sent_at" TIMESTAMP WITH TIME ZONE NOT NULL, "request_payload" text NOT NULL, "request_processed_at" TIMESTAMP WITH TIME ZONE, "response_received_at" TIMESTAMP WITH TIME ZONE, "response_success" boolean NOT NULL DEFAULT false, "response" text, "webhook_id" text, "webhook_status" text, "webhook_last_update" TIMESTAMP WITH TIME ZONE, "status_id" text, "broker_status" text, "status_last_update" TIMESTAMP WITH TIME ZONE, "callback_response" text, "query_text" text, CONSTRAINT "LogIteractionClient" FOREIGN KEY ("client_id") REFERENCES "clients" ("id") ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT "LogIteractionIntegration" FOREIGN KEY ("integration_id") REFERENCES "integrations" ("id") ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT "PK_2bd8c54d19eb4da7f3c97ecd49b" PRIMARY KEY ("id"))',
245 parameters: []
246}
247QueryFailedError: relation "users" does not exist
248 at new QueryFailedError (/app/node_modules/typeorm/error/QueryFailedError.js:11:28)
249 at Query.callback (/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:176:38)
250 at Query.handleError (/app/node_modules/pg/lib/query.js:139:19)
251 at Client._handleErrorMessage (/app/node_modules/pg/lib/client.js:326:17)
252 at Connection.emit (events.js:315:20)
253 at /app/node_modules/pg/lib/connection.js:109:12
254 at Parser.parse (/app/node_modules/pg-protocol/dist/parser.js:40:17)
255 at Socket.<anonymous> (/app/node_modules/pg-protocol/dist/index.js:8:42)
256 at Socket.emit (events.js:315:20)
257 at addChunk (_stream_readable.js:295:12) {
258 length: 105,
259 severity: 'ERROR',
260 code: '42P01',
261 detail: undefined,
262 hint: undefined,
263 position: '166',
264 internalPosition: undefined,
265 internalQuery: undefined,
266 where: undefined,
267 schema: undefined,
268 table: undefined,
269 column: undefined,
270 dataType: undefined,
271 constraint: undefined,
272 file: 'parse_relation.c',
273 line: '1191',
274 routine: 'parserOpenTable',
275 query: 'SELECT "User"."id" AS "User_id", "User"."name" AS "User_name", "User"."email" AS "User_email", "User"."blocked" AS "User_blocked", "User"."root" AS "User_root" FROM "users" "User" ORDER BY "User"."name" ASC',
276 parameters: []
277}
278