- ```
  curl -s "http://csdra-s50.vicosrv.de:6001/api/product/page/name?pid=241&customerId=8&query&relevant=0&assignedCustomerProduct=0&shopCountryFilter&shopIdFilter&createdAtStart=2018-08-08T00:00:00Z&createdAtEnd=2018-08-08T23:59:59Z&additionalFieldUUIDs&loadTechnicalProperties=true&loadAssignedCustomerProducts=true&loadMinimalRelatedEntityProperties=true&size=2500&sort=creation_date,ASC&userId=17" | jq -r ".allEntities | map(select(.entityTypeId==\"fd7d4d2e-4254-4885-a088-891e7e69a19b\") | .id) | to_entries[] | .value"
  
  
  
  curl -s "http://csdra-s50.vicosrv.de:6001/api/product/page/name?pid=241&customerId=8&query&relevant=0&assignedCustomerProduct=0&shopCountryFilter&shopIdFilter&createdAtStart=2018-08-08T00:00:00Z&createdAtEnd=2018-08-08T23:59:59Z&additionalFieldUUIDs&loadTechnicalProperties=true&loadAssignedCustomerProducts=true&loadMinimalRelatedEntityProperties=true&size=2500&sort=creation_date,ASC&userId=17&page=1198" | jq -r ".allEntities | map(select(.entityTypeId==\"fd7d4d2e-4254-4885-a088-891e7e69a19b\") | .id) | to_entries[] | .value" | diff ppage10.txt -
  
  curl -s "http://csdra-s50.vicosrv.de:6001/api/product/page/name?pid=241&customerId=8&query&relevant=0&assignedCustomerProduct=0&shopCountryFilter&shopIdFilter&createdAtStart=2018-08-08T00:00:00Z&createdAtEnd=2018-08-08T23:59:59Z&additionalFieldUUIDs&loadTechnicalProperties=true&loadAssignedCustomerProducts=true&loadMinimalRelatedEntityProperties=true&size=2&sort=creation_date,ASC&userId=17&page=1497500" | jq -r ".allEntities | map(select(.entityTypeId==\"fd7d4d2e-4254-4885-a088-891e7e69a19b\") | .id) | to_entries[] | .value"
  
  
  curl -s "http://localhost:6001/api/product/page/name?pid=241&customerId=8&query&relevant=0&assignedCustomerProduct=0&shopCountryFilter&shopIdFilter&createdAtStart=2018-08-08T00:00:00Z&createdAtEnd=2018-08-08T23:59:59Z&additionalFieldUUIDs&loadTechnicalProperties=true&loadAssignedCustomerProducts=true&loadMinimalRelatedEntityProperties=true&size=2&sort=creation_date,ASC&sort=uuid,ASC&userId=17&page=1497500" | jq -r ".allEntities | map(select(.entityTypeId==\"fd7d4d2e-4254-4885-a088-891e7e69a19b\") | .id) | to_entries[] | .value"
  
  -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintHeapAtGC -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime -XX:+PrintPromotionFailure -XX:PrintFLSStatistics=1 -Xloggc:/usr/local/vicosoft/logs/gc_%t_%p.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -Dspring.profiles.active=prod -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=2204 -Dreadonly=false -Dservice.assignment.max-assigned-pp-for-cp=100
  
  MTQ5NzUwMA==
  
  ```
-
- #+BEGIN_QUOTE
  -	Stellenbeschreibung prüfen
  Grundlegendes Spektrum (keine Erwartungen wecken)
  
  Vertretungen nur bei speziellen Aufgaben, aufführen
  
  Stellenbeschreibung, Stellentitel kommen von HR 
  Überstellung fachlich und disziplinarisch 
  Unterstellung fachlich und disziplinarisch 
  
  Verantwortlichkeiten nicht zu detailliert, da eher abstrakt (keine konkrete Technologien)
  
  -	Ziele
  
  	Anforderungen an Developer
  	- Proaktivität (Aufwände, Qualität, Themen proaktiv weitertragen)
  		regelmässig die Stunden pflegen
  
  	- Bewusstsein von Beitrag (Nutzen von Beitrag verstehen)
  
  	(Qualtitätsbewusstsein, Nachhaltigkeit intrinsisch vorhanden)
  
  -	Vorbereitung Gespräche
  
  Personal Lead zusätzlich zur fachlichen Führung
  
  Welche Erwartungshaltung an mich
  Welche Ziele selber
  Was liegt am Herzen wo kann ich unterstützen
  Welche bisherigen Anforderungen wurden bisher nicht erfüllt
  Wie kann ich helfen
  
  Challengen auf organisatorischen Ebene? Was sind meine Erwartungshaltungen
  	Gib mir die Chance dir zu helfen bevor du es in dich herein frisst
  
  Einschätzung bzgl der Mitarbeiter
  
  
  Gibt es aktuelle Themen die dringend angesprochen werden müssen?
  
  
  Gibt es aktuelle Themen die dringend angesprochen werden müssen?
  
  * Andreas
  	Unsicheres Bild 
  	Chronisch überlastet. Unverzichtbar für Aufrechterhaltung der Themen.
  	Z.T. schon resigniert
  	Fokusierung/Zuverlässigkeit
  
  	Kann sich für Punkte begeistern
  
  	Stärken: Teamplayer, extrem gutes Gefühl wie andere Leute im Team drauf sind, innovativ (technologisch)
  
  	Themen mehr enablen, damit andere diese umsetzen können
  
  	Datapipe Thema neu aufrollen, Umsetzung um neue stabile Datapipe zu bekommen
  
  	Releaseprozesse
  
  	Gehaltsgespräch letztes Jahr (aktuell nicht auf dem Plan): 5167 E
  
  
  Gibt es aktuelle Themen die dringend angesprochen werden müssen?
  
  -	Stehen Gehaltsanpassungen an?
  
  
  
  #+END_QUOTE
- ``` SQL
  UPDATE ent_customerproduct SET ucid = c.ucid FROM ent_customer c WHERE c.pid=ent_customerproduct.pid AND c.cid=ent_customerproduct.cid AND ent_customerproduct.ucid IS NULL;
  
  ALTER TABLE tmp_ent_productpage_updated OWNER TO productstore;
  
  ALTER TABLE tmp_booking_speed_sc OWNER TO productstore;
  ALTER TABLE tmp_booking_speed_pp OWNER TO productstore;
  ALTER TABLE tmp_ignoring_customer_ids OWNER TO productstore;
  ALTER TABLE tmp_assigned_cp_ids OWNER TO productstore;
  ALTER TABLE tmp_assigning_customer_ids OWNER TO productstore;
  
  CREATE TABLE "bkcp_ent_productpage" (like "ent_productpage");
  INSERT INTO "bkcp_ent_productpage" 
  	SELECT * FROM ent_productpage;
  
  
  DROP TABLE IF EXISTS tmp_ent_productpage;
  CREATE TABLE "tmp_ent_productpage" (like "ent_productpage");
  INSERT INTO "tmp_ent_productpage" (
  	"uuid",	"creation_date",	"modification_date",	"creator_id",	"last_modifier_id",	"name",	"url",	"url_normalized",	"former_urls",	"crawl_date",	"language",	"country",	"breadcrumb",	"brand",	"image_url",	"current_price",	"number_of_replies",	"number_of_reviews",	"asin",	"asin_normalized",	"gtin",	"gtin_normalized",	"ean13",	"ean13_normalized",	"sku",	"sku_normalized",	"vib",	"vib_normalized",	"modelnumber",	"modelnumber_normalized",	"shopcategory_id",	"shop_id",	"shop_internal_id",	"meta_info")
  	SELECT "uuid",	"creation_date",	"modification_date",	"creator_id",	"last_modifier_id",	"name",	"url",	"url_normalized",	"former_urls",	"crawl_date",	"language",	"country",	"breadcrumb",	"brand",	"image_url",	"current_price",	"number_of_replies",	"number_of_reviews",	"asin",	"asin_normalized",	"gtin",	"gtin_normalized",	"ean13",	"ean13_normalized",	"sku",	"sku_normalized",	"vib",	"vib_normalized",	"modelnumber",	"modelnumber_normalized",	"shopcategory_id",	"shop_id",	"shop_internal_id",	"meta_info" FROM ent_productpage;
  INSERT INTO "tmp_ent_productpage" 
  	SELECT * FROM ent_productpage;
  
  
  UPDATE tmp_ent_productpage SET booking_customer_ids = NULL, ignoring_customer_ids = NULL, assigned_cp_ids = NULL, assigning_customer_ids = NULL WHERE booking_customer_ids IS NULL OR ignoring_customer_ids IS NULL OR assigned_cp_ids IS NULL OR assigning_customer_ids IS NULL;
  
  UPDATE tmp_ent_productpage SET booking_customer_ids = NULL, ignoring_customer_ids = NULL, assigned_cp_ids = NULL, assigning_customer_ids = NULL WHERE booking_customer_ids IS NULL OR ignoring_customer_ids IS NULL OR assigned_cp_ids IS NULL OR assigning_customer_ids IS NULL;
  
  CREATE TABLE "tmp_ent_productpage_updated" (like "ent_productpage");
  INSERT INTO tmp_ent_productpage_updated
  SELECT p."uuid",	"creation_date",	"modification_date",	"creator_id",	"last_modifier_id",	"name",	"url",	"url_normalized",	"former_urls",	"crawl_date",	"language",	"country",	"breadcrumb",	"brand",	"image_url",	"current_price",	"number_of_replies",	"number_of_reviews",	"asin",	"asin_normalized",	"gtin",	"gtin_normalized",	"ean13",	"ean13_normalized",	"sku",	"sku_normalized",	"vib",	"vib_normalized",	"modelnumber",	"modelnumber_normalized",	"shopcategory_id",	"shop_id",	"shop_internal_id",	"meta_info", 
  	(ssc.speed || spp.speed || p.booking_customer_ids) AS booking_customer_ids, 
  	acp.speed, acid.speed, ici.speed 
   FROM ent_productpage p LEFT JOIN tmp_booking_speed_sc ssc ON p.uuid=ssc.uuid LEFT JOIN tmp_booking_speed_pp spp ON p.uuid=spp.uuid LEFT JOIN tmp_assigned_cp_ids acp ON p.uuid=acp.uuid LEFT JOIN tmp_assigning_customer_ids acid ON p.uuid=acid.uuid LEFT JOIN tmp_ignoring_customer_ids ici ON p.uuid=ici.uuid;
  
  
  TRUNCATE ent_productpage
  INSERT INTO ent_productpage
  SELECT p."uuid",	"creation_date",	"modification_date",	"creator_id",	"last_modifier_id",	"name",	"url",	"url_normalized",	"former_urls",	"crawl_date",	"language",	"country",	"breadcrumb",	"brand",	"image_url",	"current_price",	"number_of_replies",	"number_of_reviews",	"asin",	"asin_normalized",	"gtin",	"gtin_normalized",	"ean13",	"ean13_normalized",	"sku",	"sku_normalized",	"vib",	"vib_normalized",	"modelnumber",	"modelnumber_normalized",	"shopcategory_id",	"shop_id",	"shop_internal_id",	"meta_info", 
  	CASE WHEN ssc.speed IS NULL AND spp.speed IS NULL THEN NULL
  ELSE (COALESCE(ssc.speed,'') || COALESCE(spp.speed,'')) END AS booking_customer_ids, 
  	acp.speed, acid.speed, ici.speed 
   FROM bckp_ent_productpage_parallel p LEFT JOIN tmp_booking_speed_sc ssc ON p.uuid=ssc.uuid LEFT JOIN tmp_booking_speed_pp spp ON p.uuid=spp.uuid LEFT JOIN tmp_assigned_cp_ids acp ON p.uuid=acp.uuid LEFT JOIN tmp_assigning_customer_ids acid ON p.uuid=acid.uuid LEFT JOIN tmp_ignoring_customer_ids ici ON p.uuid=ici.uuid;
  
  
  
  -- create booking speed temp table
  DROP TABLE IF EXISTS tmp_booking_speed_sc;
  CREATE TABLE tmp_booking_speed_sc AS 
  SELECT hstore_sum(a.speed) AS speed , a.uuid FROM (
  SELECT i.source_uuid AS uuid, hstore(ARRAY[('sc_'||c.ucid)], ARRAY[b.target_uuid:: TEXT]) AS speed
  FROM ent_customer c, rel_hasbooked b, rel_isfrom i
  WHERE c.uuid=b.source_uuid AND b.target_uuid=i.target_uuid 
  ) a GROUP BY a.uuid;
  
  CREATE INDEX IF NOT EXISTS pp_uuid_idx1 ON tmp_booking_speed_sc(uuid);
  
  UPDATE tmp_ent_productpage p
  SET booking_customer_ids = COALESCE(booking_customer_ids, '') || s.speed
  FROM 
  	tmp_booking_speed_sc s
  WHERE s.uuid = p.uuid;
  DROP TABLE IF EXISTS tmp_booking_speed_sc;
  
  -- new RelationType(EDGE_LABEL_HAS_DIRECTLY_BOOKED, C, PP)
  DROP TABLE IF EXISTS tmp_booking_speed_pp;
  CREATE TABLE tmp_booking_speed_pp AS 
  SELECT hstore_sum(a.speed) AS speed, a.uuid FROM (
  SELECT b.target_uuid AS uuid, hstore(ARRAY[('d_'||c.ucid)], ARRAY[c.ucid::TEXT]) AS speed
  FROM ent_customer c, rel_hasdirectlybooked b
  WHERE c.uuid=b.source_uuid
  ) a GROUP BY a.uuid;
  
  CREATE INDEX IF NOT EXISTS pp_uuid_idx2 ON tmp_booking_speed_pp(uuid);
  
  UPDATE tmp_ent_productpage p
  SET booking_customer_ids = COALESCE(booking_customer_ids, '') || s.speed
  FROM 
  	tmp_booking_speed_pp s
  WHERE s.uuid = p.uuid;
  DROP TABLE IF EXISTS tmp_booking_speed_pp;
  
  --  new RelationType(EDGE_LABEL_IRRELEVANT, C, PP)
  DROP TABLE IF EXISTS tmp_ignoring_customer_ids;
  CREATE TABLE tmp_ignoring_customer_ids AS 
  SELECT hstore_sum(a.speed) AS speed , a.uuid FROM (
  SELECT i.target_uuid AS uuid, hstore(ARRAY[c.ucid:: TEXT], ARRAY[c.ucid:: TEXT]) AS speed
  FROM ent_customer c, rel_isirrelevant i
  WHERE c.uuid=i.source_uuid
  ) a GROUP BY a.uuid;
  
  CREATE INDEX IF NOT EXISTS pp_uuid_idx3 ON tmp_ignoring_customer_ids(uuid);
  
  UPDATE tmp_ent_productpage p
  SET ignoring_customer_ids = COALESCE(ignoring_customer_ids, '') || s.speed
  FROM 
  	tmp_ignoring_customer_ids s
  WHERE s.uuid = p.uuid;
  DROP TABLE IF EXISTS tmp_ignoring_customer_ids;
  
  --  new RelationType(EDGE_LABEL_CONTAINS, CP, PP)
  DROP TABLE IF EXISTS tmp_assigned_cp_ids;
  CREATE TABLE tmp_assigned_cp_ids AS 
  SELECT hstore_sum(a.speed) AS speed , a.uuid FROM (
  SELECT i.target_uuid AS uuid, hstore(ARRAY[c.uuid:: TEXT], ARRAY[c.ucid:: TEXT]) AS speed
  FROM ent_customerproduct c, rel_contains i
  WHERE c.uuid=i.source_uuid
  ) a GROUP BY a.uuid;
  
  CREATE INDEX IF NOT EXISTS pp_uuid_idx4 ON tmp_assigned_cp_ids(uuid);
  UPDATE tmp_ent_productpage p
  SET assigned_cp_ids = COALESCE(assigned_cp_ids, '') || s.speed
  FROM 
  	tmp_assigned_cp_ids s
  WHERE s.uuid = p.uuid;
  DROP TABLE IF EXISTS tmp_assigned_cp_ids;
  
  --  new RelationType(EDGE_LABEL_CONTAINS, CP, PP)
  DROP TABLE IF EXISTS tmp_assigning_customer_ids;
  CREATE TABLE tmp_assigning_customer_ids AS 
  SELECT hstore_sum(a.speed) AS speed , a.uuid FROM (
  SELECT i.target_uuid AS uuid, hstore(ARRAY[c.ucid:: TEXT], ARRAY[c.uuid:: TEXT]) AS speed
  FROM ent_customerproduct c, rel_contains i
  WHERE c.uuid=i.source_uuid
  ) a GROUP BY a.uuid;
  
  CREATE INDEX IF NOT EXISTS pp_uuid_idx5 ON tmp_assigning_customer_ids(uuid);
  UPDATE tmp_ent_productpage p
  SET assigning_customer_ids = COALESCE(assigning_customer_ids, '') || s.speed
  FROM 
  	tmp_assigning_customer_ids s
  WHERE s.uuid = p.uuid;
  DROP TABLE IF EXISTS tmp_assigning_customer_ids;
  
  
  
  
  copy tmp_dabe_isfrom (id, url, site_id, feed_ids) from '/nfs/export/PagesIsFrom/product_pages_categories_final_test.csv' delimiter E'\t' HEADER csv;
  
  CREATE TABLE "tmp_dabe_isfrom" (
  	"id" INTEGER NULL DEFAULT NULL,
  	"url" TEXT NULL DEFAULT NULL,
  	"site_id" INTEGER NULL DEFAULT NULL,
  	"feed_ids" INTEGER NULL DEFAULT NULL
  )
  ;
  
  create index on tmp_dabe_isfrom using BTREE (url);
  
  SELECT url, array_agg(feed_ids) FROM tmp_dabe_isfrom t GROUP BY url LIMIT 10
  
  SELECT url, array_agg(feed_ids) FROM tmp_dabe_isfrom t WHERE url = 'https://www.amazon.cn/dp/B00DAEYLQW/' GROUP BY url 
  
  CREATE TABLE tmp_dabe_isfrom_agg AS 
  SELECT url, array_agg(feed_ids) FROM tmp_dabe_isfrom t GROUP BY url;
  create index on tmp_dabe_isfrom_agg using BTREE (url);
  
  ALTER TABLE tmp_dabe_isfrom_agg OWNER TO productstore;
  
  
  UPDATE bkcp_ent_productpage bp SET NAME=pp.name FROM ent_productpage pp WHERE bp.uuid=pp.uuid AND bp.name IS null
  
  create table if not exists bckp_ent_productpage_parallel (
   uuid uuid,
   creation_date timestamptz,
   modification_date timestamptz,
   creator_id text,
   last_modifier_id text,
   name text,
   url text,
   url_normalized text,
   former_urls text[],
   crawl_date timestamptz,
   language bigint,
   country bigint,
   breadcrumb text,
   brand text[],
   image_url text,
   current_price numeric,
   number_of_replies bigint,
   number_of_reviews bigint,
   asin text[],
   asin_normalized text[],
   gtin text[],
   gtin_normalized text[],
   ean13 text[],
   ean13_normalized text[],
   sku text[],
   sku_normalized text[],
   vib text[],
   vib_normalized text[],
   modelnumber text,
   modelnumber_normalized text,
   shopcategory_id bigint[],
   shop_id bigint,
   shop_internal_id text,
   meta_info jsonb,
   booking_customer_ids hstore,
   assigned_cp_ids hstore,
   assigning_customer_ids hstore,
   ignoring_customer_ids hstore,
   CONSTRAINT _304d3bd1_13a8_4f02_842f_d011f92625fc UNIQUE(uuid),
   PRIMARY KEY (uuid)) PARTITION BY HASH (uuid);
  create table bckp_ent_productpage_parallel_0 partition of bckp_ent_productpage_parallel FOR VALUES WITH (MODULUS 8, REMAINDER 0);
  create table bckp_ent_productpage_parallel_1 partition of bckp_ent_productpage_parallel FOR VALUES WITH (MODULUS 8, REMAINDER 1);
  create table bckp_ent_productpage_parallel_2 partition of bckp_ent_productpage_parallel FOR VALUES WITH (MODULUS 8, REMAINDER 2);
  create table bckp_ent_productpage_parallel_3 partition of bckp_ent_productpage_parallel FOR VALUES WITH (MODULUS 8, REMAINDER 3);
  create table bckp_ent_productpage_parallel_4 partition of bckp_ent_productpage_parallel FOR VALUES WITH (MODULUS 8, REMAINDER 4);
  create table bckp_ent_productpage_parallel_5 partition of bckp_ent_productpage_parallel FOR VALUES WITH (MODULUS 8, REMAINDER 5);
  create table bckp_ent_productpage_parallel_6 partition of bckp_ent_productpage_parallel FOR VALUES WITH (MODULUS 8, REMAINDER 6);
  create table bckp_ent_productpage_parallel_7 partition of bckp_ent_productpage_parallel FOR VALUES WITH (MODULUS 8, REMAINDER 7);
  
  INSERT INTO bckp_ent_productpage_parallel SELECT * FROM bkcp_ent_productpage;
  
  create index on bckp_ent_productpage_parallel using BTREE (url);
  create index on bckp_ent_productpage_parallel using GIN (former_urls);
  
  
  UPDATE bckp_ent_productpage_parallel pp SET shopcategory_id=array_agg FROM tmp_dabe_isfrom_agg di WHERE di.url=pp.url OR di.url=ANY(pp.former_urls);
  
  
  productstore=# UPDATE bckp_ent_productpage_parallel pp SET shopcategory_id=array_agg FROM tmp_dabe_isfrom_agg di WHERE di.url=pp.url OR di.url=ANY(pp.former_urls);
  
  UPDATE 8856484
  Time: 700867.954 ms (11:40.868)
  
  
  
  TRUNCATE rel_isfrom;
  INSERT INTO rel_isfrom (uuid, creation_date, modification_date, source_uuid, target_uuid) SELECT uuidv3(a.uuid||'isFrom'||b.uuid),NOW(),NOW(), a.uuid, b.uuid FROM bckp_ent_productpage_parallel a inner join ent_shopcategory  b on b.dataretrieval_id = any(a.shopcategory_id);
  INSERT 0 21718375
  Time: 384528.971 ms (06:24.529)
  
  
  CREATE INDEX ON ent_productpage USING GIN (booking_customer_ids);
  
  create index on ent_productpage using gin (name gin_trgm_ops);
  
  CREATE INDEX ON ent_productpage USING GIN (ignoring_customer_ids);
  CREATE INDEX ON ent_productpage USING GIN (assigned_cp_ids);
  CREATE INDEX ON ent_productpage USING GIN (assigning_customer_ids);
  
  UPDATE ent_customerproduct SET pid=c.pid, cid=c.cid
  FROM ent_customer c
  WHERE ent_customerproduct.ucid=c.ucid AND (ent_customerproduct.pid IS NULL OR ent_customerproduct.cid IS NULL);
  
  
  
  CREATE TABLE tmp_ent_customerproduct_fixed_meta (like ent_customerproduct)
  
  COPY tmp_ent_customerproduct_fixed_meta(uuid,creation_date,modification_date,creator_id,last_modifier_id,brand,asin,asin_normalized,ean13,ean13_normalized,sku,sku_normalized,name,language,vib,vib_normalized,pid,cid,ucid,bigLabelUrls,import_date,eigenbrand,meta_info) FROM '/nfs/export/spark_nach_maintenance/CustomerProduct/customer_product.merged.json.csv' WITH  DELIMITER '|' QUOTE '^' HEADER CSV;
  
  COPY tmp_ent_customerproduct_fixed_meta(uuid,creation_date,modification_date,creator_id,last_modifier_id,brand,asin,asin_normalized,ean13,ean13_normalized,sku,sku_normalized,name,language,vib,vib_normalized,pid,cid,ucid,bigLabelUrls,import_date,eigenbrand,meta_info) FROM '/nfs/export/spark_nach_maintenance/CustomerProduct/customer_product.merged.jsondatefix.csv' WITH  DELIMITER '|' QUOTE '^' HEADER CSV;
  
  SELECT cp.uuid AS CP_UUID, cp.name AS CP_NAME, p.url AS PAGE_URL, p.uuid AS PAGE_UUID, array_length(akeys(p.assigned_cp_ids), 1) AS c FROM ent_customerproduct cp, ent_productpage p WHERE cp.uuid = ANY(akeys(p.assigned_cp_ids)::uuid[]) GROUP BY cp.uuid, p.uuid, p.url HAVING array_length(akeys(p.assigned_cp_ids), 1) > 1
  
  COPY (SELECT cp.uuid AS CP_UUID, cp.name AS CP_NAME, p.url AS PAGE_URL, p.uuid AS PAGE_UUID, array_length(akeys(p.assigned_cp_ids), 1) AS c FROM ent_customerproduct cp, ent_productpage p WHERE cp.uuid = ANY(akeys(p.assigned_cp_ids)::uuid[]) GROUP BY cp.uuid, p.uuid, p.url HAVING array_length(akeys(p.assigned_cp_ids), 1) > 1) to '/nfs/export/bsh_assigned_pages_more_than_one_cp.csv' WITH CSV;
  
  ```
- #+BEGIN_QUOTE
  Save translations
  
  pg_dump -a translationservice > translations2.sql
  
  pv -e translations.sql | psql translationservice
  
  #+END_QUOTE
- ``` 
  having(rollup(search(documents_241_8, q="guid:(50b75ee8-3461-30a0-a8d0-035d98c0f3fb 49dcbc10-9638-348f-88fb-d2cb29d1f3d7)", fl="guid, tags", sort="guid asc"),over="guid",count(tags)), gt(count(tags), 1))
  facet(documents_241_8, q="guid:(50b75ee8-3461-30a0-a8d0-035d98c0f3fb 49dcbc10-9638-348f-88fb-d2cb29d1f3d7)", buckets="guid, tags")
  
  
  facet(documents_241_8, q="guid:(50b75ee8-3461-30a0-a8d0-035d98c0f3fb 49dcbc10-9638-348f-88fb-d2cb29d1f3d7)", buckets="guid, tags")
  
  
  search(documents_241_8, q="guid:50b75ee8-3461-30a0-a8d0-035d98c0f3fb", fl="guid, superiors", sort="guid asc"),count(superiors))
  
  
  
  facet(documents_240_8, q="guid:(ee85a4ab-6c7a-3923-a479-63582f04a021 77a9b3de-7eb9-3ac4-943b-8715bb995c8b)", buckets="tags", rows=20)
  
  rollup(search(documents_240_8, q="guid:(ee85a4ab-6c7a-3923-a479-63582f04a021 77a9b3de-7eb9-3ac4-943b-8715bb995c8b)", fl="guid, tags", sort="guid asc"),over="guid",count(tags))
  
  
  
  
  having(facet(documents_240_8, q="guid:(ee85a4ab-6c7a-3923-a479-63582f04a021 77a9b3de-7eb9-3ac4-943b-8715bb995c8b)", buckets="guid, ppage#syndicate_s_mode_both"), gt(count(*), 1))
  
  
  
  having(rollup(facet(documents_240_8, q="guid:(ee85a4ab-6c7a-3923-a479-63582f04a021 77a9b3de-7eb9-3ac4-943b-8715bb995c8b)", buckets="guid,ppage#syndicate_s_mode_both", rows=50), over="guid", count(*)), gt(count(*), 1))
  
  
  
  reduce(select(having(rollup(facet(documents_240_8, q="ppage#syndicate_s_mode_both:*", buckets="guid,ppage#syndicate_s_mode_both", rows=50, bucketSorts="ppage#syndicate_s_mode_both desc"), over="guid", count(*)), gt(count(*), 0)),guid, count(*) as numpp), by="numpp", group(sort="numpp desc", n="100"))
  
  
  
  select(having(rollup(facet(documents_241_8, q="ppage#syndicate_s_mode_both:* AND pubDate:[2023-01-01T00:00:00Z TO 2023-04-01T00:00:00Z}", buckets="guid,ppage#syndicate_s_mode_both", rows=-1), over="guid", count(*)), gt(count(*), 1)),guid, count(*) as numpp)
  
  
  
  select(having(rollup(facet(documents_241_8, q="cproduct_s_mode_both:* AND pubDate:[2023-02-01T00:00:00Z TO 2023-02-15T00:00:00Z}", buckets="guid,cproduct_s_mode_both", rows=-1), over="guid", count(*)), gt(count(*), 1)),guid, count(*) as numcp)
  
  
  select(having(rollup(having(facet(documents_243_8, q="cproduct_s_mode_both:243#8#* AND pubDate:[2023-01-01T00:00:00Z TO 2023-02-01T00:00:00Z}", buckets="guid,cproduct_s_dv", rows=-1), and(gt(cproduct_s_dv, "243#8#0"), lt(cproduct_s_dv, "243#8#ffffffff-ffff-ffff-ffff-ffffffffffff"))), over="guid", count(*)), gt(count(*), 1)),guid, count(*) as numcp)
  
  
  having(select(facet(documents_240_8,q="guid:(ee85a4ab-6c7a-3923-a479-63582f04a021 77a9b3de-7eb9-3ac4-943b-8715bb995c8b)", buckets="guid,cproduct_s_mode_both", rows=-1), guid, cproduct_s_mode_both), and(gt(cproduct_s_mode_both, "240#12#0"), lt(cproduct_s_mode_both, "240#12#ffffffff-ffff-ffff-ffff-ffffffffffff")))
  
  
  
  
  
  update(documents_241_8_reviews,batchSize=500,search(documents_241_8, q="cproduct_s_mode_both:241#8#* AND pubDate:[2023-01-01T00:00:00Z TO 2023-02-01T00:00:00Z}",fl="guid,url,docType,pubDate,indexedDate,language,country,is_comment,is_share,sourceGuid,sourceType,authorGuid,authorType,cproduct_s_mode_both", sort="guid asc", rows=1000))
  update(documents_241_8_reviews,batchSize=500,
  select(search(documents_241_8, q="cproduct_s_mode_both:241#8#* AND guid:000008ff-7085-3843-8f83-89e88820baf8",fl="guid,docType,language,country,sourceGuid,sourceType,authorGuid,authorType,cproduct_s_dv", qt="/export", sort="guid asc"),
  guid,"" as url,docType, "" as pubDate, "" as indexedDate,language,country,"false" as is_comment, "false" as is_share", sourceGuid,sourceType,authorGuid,authorType,cproduct_s_dv as cproduct_s_mode_both
  ))
  
  
  update(documents_241_8_reviews,
          batchSize=500,
          search(collection1,
                 q=*:*,
                 qt="/export",
                 fl="id,a_s,a_i,a_f,s_multi,i_multi",
                 sort="a_f asc, a_i asc"))
  
  select(having(rollup(having(facet(documents_241_8, q="cproduct_s_mode_both:241#8#* AND pubDate:[2023-01-01T00:00:00Z TO 2023-02-01T00:00:00Z}", buckets="guid,cproduct_s_dv", rows=-1), and(gt(cproduct_s_dv, "241#8#0"), lt(cproduct_s_dv, "241#8#ffffffff-ffff-ffff-ffff-ffffffffffff"))), over="guid", count(*)), gt(count(*), 1)),guid, count(*) as numcp)
  ```
- ``` 
  GRANT EXECUTE, SELECT, SHOW VIEW, ALTER, ALTER ROUTINE, CREATE, CREATE ROUTINE, CREATE TEMPORARY TABLES, CREATE VIEW, DELETE, DROP, EVENT, INDEX, INSERT, REFERENCES, TRIGGER, UPDATE, LOCK TABLES  ON `hierarchyservice_broken`.* TO 'admin'@'%' WITH GRANT OPTION;
  Aiquai3b
  HBpqeZ6N5A
  Dara2#121016!
  
  ```
- ``` 
  "kafkaOffset#station/251/annotated#0_ls_mode_both":441209142,
  
  group-251-persister gestopped
  
  	datapool_data
  	86400
  	{'configset': 'document_vw', 'num_shards': 3, 'replication_factor': 2, 'max_shards_per_node': 2}
  
  
  
  /backup/solr-cloud-002/documents_251_8/backup_increment/documents_251_8
  
  
  http://solr-cloud-002.k8s-c1.vicosrv.de:8983/solr/admin/collections?action=LISTBACKUP&name=backup_increment&location=/backup/solr-cloud-002/documents_251_8
  
  http://solr-cloud-002.k8s-c1.vicosrv.de:8983/solr/admin/collections?action=RESTORE&name=backup_increment&location=/backup/solr-cloud-002/documents_251_8&collection=documents_251_8&backupId=260
  
  http://solr-cloud-002.k8s-c1.vicosrv.de:8983/solr/admin/collections?action=COLSTATUS&collection=documents_251_8
  
  
  
  {
    "date": "2023-03-16T08:31:22.737+0000",
    "minLogSize": 439527991,
    "logSize": 441418659,
    "numMessages": 1890668,
    "offset": 441407443,
    "lag": 11216,
    "owner": null
  }
  
  
  {
    "znode": {
      "path": "/overseer/async_ids/mn-92810c0e-fd6a-43ad-b537-24894ade0100",
      "prop": {
        "version": 0,
        "aversion": 0,
        "children_count": 0,
        "ctime": "Thu Mar 16 07:22:36 UTC 2023 (1678951356795)",
        "cversion": 0,
        "czxid": 94489539729,
        "ephemeralOwner": 0,
        "mtime": "Thu Mar 16 07:22:36 UTC 2023 (1678951356795)",
        "mzxid": 94489539729,
        "pzxid": 94489539729,
        "dataLength": 0
      },
      "data": ""
    },
    "tree": [
      {
        "text": "mn-92810c0e-fd6a-43ad-b537-24894ade0100",
        "a_attr": {
          "href": "admin/zookeeper?detail=true&path=%2Foverseer%2Fasync_ids%2Fmn-92810c0e-fd6a-43ad-b537-24894ade0100"
        }
      }
    ]
  }
  
  kafkaOffset#station/251/annotated#0_ls_mode_both desc
  441066159
  
  "numFound":129727185
  
  ```
- ``` 
  mysqldump -u vicoroot -f -p -n -t --skip-triggers --complete-insert -h station-dev-001.vicosrv.de --databases monitoring --tables alert alert_logging alexa api_key_mapping api_rate_limit_bucket_configuration author_review_metadata auto_reports_feeds_data auto_reports_hashtag_data auto_reports_tags_data base_hierarchy_id blacklist_author blacklist_channel blacklist_phrase blacklist_source blacklist_sourcename blacklist_url category configuration customer customer_metadata customer_productkpidata dashboard_channel dashboard_view dashboard_view_node dashboard_view_node_category dashboard_view_node_category_topic dashboard_view_node_channel dashboard_view_node_custom_query dashboard_view_node_customer_product dashboard_view_node_entity dashboard_view_node_product_category dashboard_view_node_query entry_editorial filter_alias filter_keywords filter_list group group_customer group_project indexer_parameters language list_author list_document list_source log_customer log_macro log_node log_product_category log_query log_report macro macro_category market_price_class node_sentiment_model node_sentimentquery oauth_access_token oauth_client_details pricing_customer_booking pricing_customer_price pricing_customer_volume pricing_feature pricing_feed_volume pricing_package pricing_package_feature product_reference_price rate_limit_configuration rights role role_grant_role role_rights scheduled_export_task searchterm_management_log sentiment_model_trials sentiment_models sentimentquery service_entry shared_clipboard source sourceset sourceset_subselection sourceset_types source_category station_annotator_errors statistics_user_action stopwords stored_searches synonym_tagcloud_tokens synonym_tagcloud_variants topic topicmodel topicmodel_node topicmodel_topic topicstopwords user_abo user_alert user_annotations user_filters user_group user_rights user_role user_settings users web_alert_addresses web_alerts web_alerts_stream web_alerts_stream_conds web_alerts_stream_config web_alerts_stream_config_params web_alerts_stream_incident web_archive_customer_configuration web_customer_export_template web_customer_image_upload web_customer_mail_templates web_dashboards web_download_file web_export_templates web_export_templates_customer web_export_templates_reports web_export_templates_text web_export_templates_text_value web_export_templates_texts web_export_templates_widgets web_filter_attribute_type_ids web_filter_authors web_filter_black_lists web_filter_categories web_filter_countries web_filter_crossed_topics web_filter_data_providers web_filter_doc_types web_filter_genders web_filter_languages web_filter_market_price_classes web_filter_named_entities web_filter_nodes web_filter_post_comment_state web_filter_product web_filter_product_category_ids web_filter_product_sub_category_ids web_filter_ratings web_filter_sentiments web_filter_sort_field web_filter_sort_fields web_filter_source_types web_filter_sources web_filter_tags web_filter_topics  web_filter_white_lists web_filters web_flags web_flagseries web_health_taskinfo web_kpi_customer_configuration web_label_nodes web_label_perspectives web_labels web_perspectives web_projects web_reply_templates web_reports web_reports_addresses web_reports_formats web_reports_widgets_filters web_shared_perspectives web_social_media_channel_token web_social_media_user_token web_themes web_user_annotation_context web_user_annotation_entry web_user_project web_webdashboard_containers web_webdashboard_links web_webdashboard_webdashboard_links web_webdashboards web_webpage_entry web_widget_color_settings web_widget_settings web_widget_settings_post_columns web_widget_settings_visible_columns web_widget_template_categories web_widget_template_categories_widgets web_widget_views web_widgets webpage_tracking_alerting webpage_tracking_category webpage_tracking_localization webpage_tracking_mailing webpage_tracking_permission webpage_tracking_request webpage_tracking_topic webpage_tracking_webpage webpage_tracking_webpage_content webpage_tracking_webpage_version > station-dev1_va.sql
  
  
  
  cat station-dev1_va.sql | mysql -u monitoring -p -f -h mariadb-001.va.k8s-c1.vicosrv.de monitoring_808
  
  
  mysqldump -u vicoroot -f -p -n -t --skip-triggers --complete-insert -h station-dev-001.vicosrv.de --databases monitoring --tables author > station-dev1_va_a.sql
  
  cat station-dev1_va_a.sql | mysql -u monitoring -p -f -h mariadb-001.va.k8s-c1.vicosrv.de monitoring_808
  
  mysqldump -u vicoroot -f -p -n -t --skip-triggers --complete-insert -h station-dev-001.vicosrv.de --databases monitoring --tables thread > station-dev1_va_t.sql
  
  cat station-dev1_va_t.sql | mysql -u monitoring -p -f -h mariadb-001.va.k8s-c1.vicosrv.de monitoring_808
  
  
  ```
- ``` SQL
  alter table author
      drop column is_vine_user,
      drop column is_hall_of_fame,
      drop column is_seller,
      drop column is_manufacturer,
      drop column is_top_reviewer;
  
  drop index FK7xjsawap37qpi3uaucvfllhn5 on author;
  
  
  alter table blacklist_url
      modify url varchar(250) not null;
  
  alter table blacklist_url
      add primary key (url);
  
  
  alter table customer
      add max_inactivity_days int default 0 not null after password_expiration_period;
  
  
  
  alter table dashboard_view_node
      drop column topic_feed;
  
  alter table dashboard_view_node
      drop column customer_id;
  
  
  
  alter table dashboard_view_node_customer_product
      drop key node_id_uuid;
  
  alter table dashboard_view_node_customer_product
      add constraint uniquekey1
          unique (node_id, uuid);
  
  
  
  alter table dashboard_view_node_query
      drop column searchtermservice_updated;
  
  
  
  alter table log_customer
      add id int AUTO_INCREMENT PRIMARY KEY first;
  alter table log_node
      add id int AUTO_INCREMENT PRIMARY KEY first;
  alter table log_product_category
      add id int AUTO_INCREMENT PRIMARY KEY first;
  alter table log_query
      add id int AUTO_INCREMENT PRIMARY KEY first;
  
  
  alter table log_macro
      add id int AUTO_INCREMENT PRIMARY KEY first;
  alter table market_price_class
      drop column created_at;
  alter table web_alerts_stream
      drop column customer_id;
  alter table web_dashboards
      drop column customer_id;
  alter table web_filters
      drop column customer_id,
      drop column ratingFrom,
      drop column ratingTo,
      drop column indexEnd,
      drop column indexStart,
      drop column rating_from,
      drop column rating_to,
     drop column max_indexed_date;
  
  
  alter table web_kpi_customer_configuration
      drop column shop_ids;
  
  alter table web_perspectives
      drop column show_as_new_in_webdashboard;
  
  alter table web_user_annotation_context
      drop column feedName,
      drop column feedPath;
  
  
  alter table web_widget_settings
      drop column `loop`;
  
  ```
- ``` SQL
  
  CREATE DATABASE `monitoring_814` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
  
  DROP TABLE IF EXISTS `alert`;
  CREATE TABLE `alert` (
    `id` int unsigned NOT NULL AUTO_INCREMENT,
    `alert_id` int unsigned NOT NULL,
    `volume` int NOT NULL DEFAULT 0,
    `sentiment` int NOT NULL DEFAULT 0,
    `datum` datetime NOT NULL,
    `sent` datetime DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `alert_logging`;
  CREATE TABLE `alert_logging` (
    `id` int unsigned NOT NULL AUTO_INCREMENT,
    `alert_id` int unsigned NOT NULL,
    `volume` int NOT NULL DEFAULT 0,
    `sentiment` int NOT NULL DEFAULT 0,
    `datum` datetime NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `alexa`;
  CREATE TABLE `alexa` (
    `sourceGuid` char(36) NOT NULL,
    `rank` bigint unsigned NOT NULL,
    `is_root_domain_rank` tinyint unsigned NOT NULL DEFAULT 0,
    `reach_per_million` float NOT NULL DEFAULT 0,
    `page_views_per_million` float NOT NULL DEFAULT 0,
    `links_in_count` bigint unsigned NOT NULL DEFAULT 0,
    UNIQUE KEY `sourceGuid` (`sourceGuid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `api_key_mapping`;
  CREATE TABLE `api_key_mapping` (
    `id` bigint unsigned NOT NULL AUTO_INCREMENT,
    `api_key` varchar(100) NOT NULL DEFAULT '',
    `user_id` int NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `unique_api_key_user_id` (`api_key`,`user_id`),
    KEY `index_api_key` (`api_key`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `api_rate_limit_bucket_configuration`;
  CREATE TABLE `api_rate_limit_bucket_configuration` (
    `id` int NOT NULL AUTO_INCREMENT,
    `client` varchar(50) NOT NULL,
    `customer_id` int NOT NULL,
    `user_id` int DEFAULT NULL,
    `bucket_group` varchar(50) NOT NULL,
    `upper_bucket_size` int NOT NULL,
    `upper_period_in_seconds` int NOT NULL,
    `lower_bucket_size` int DEFAULT NULL,
    `lower_period_in_seconds` int DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `author`;
  CREATE TABLE `author` (
    `guid` char(36) NOT NULL,
    `url` text NOT NULL,
    `name` text NOT NULL,
    `language_id` tinyint unsigned NOT NULL,
    `country_id` tinyint unsigned NOT NULL,
    `sourceguid` char(36) NOT NULL,
    `authortype_id` tinyint unsigned NOT NULL,
    `sourcetype_id` tinyint unsigned NOT NULL,
    `relevance` int unsigned NOT NULL DEFAULT 0,
    `profile` text DEFAULT NULL,
    `checking` tinyint unsigned NOT NULL DEFAULT 0,
    `followings` int NOT NULL DEFAULT 0,
    `followers` int NOT NULL DEFAULT 0,
    `registered_since` datetime DEFAULT NULL,
    `post_count` int NOT NULL DEFAULT 0,
    `total_views` int NOT NULL DEFAULT 0,
    `uploads_count` int NOT NULL DEFAULT 0,
    `img_url` text DEFAULT NULL,
    PRIMARY KEY (`guid`),
    KEY `sourcetype_id_checking` (`sourcetype_id`,`checking`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `author_review_metadata`;
  CREATE TABLE `author_review_metadata` (
    `guid` char(36) NOT NULL,
    `is_vine_user` tinyint DEFAULT NULL,
    `is_hall_of_fame` tinyint DEFAULT NULL,
    `is_seller` tinyint DEFAULT NULL,
    `is_manufacturer` tinyint DEFAULT NULL,
    `is_top_reviewer` tinyint DEFAULT NULL,
    PRIMARY KEY (`guid`) USING BTREE
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `auto_reports_feeds_data`;
  CREATE TABLE `auto_reports_feeds_data` (
    `day` date NOT NULL,
    `feed_identifier` varchar(12) NOT NULL,
    `volume` int DEFAULT NULL,
    `change_1d_absolute` int DEFAULT NULL,
    `change_1d_percent` float DEFAULT NULL,
    PRIMARY KEY (`day`,`feed_identifier`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `auto_reports_hashtag_data`;
  CREATE TABLE `auto_reports_hashtag_data` (
    `day` date NOT NULL,
    `hashtag` varchar(192) NOT NULL,
    `volume` int DEFAULT NULL,
    `change_1d_absolute` int DEFAULT NULL,
    `change_1d_percent` float DEFAULT NULL,
    PRIMARY KEY (`day`,`hashtag`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `auto_reports_tags_data`;
  CREATE TABLE `auto_reports_tags_data` (
    `day` date NOT NULL,
    `tag` varchar(192) NOT NULL,
    `volume` int DEFAULT NULL,
    `change_1d_absolute` int DEFAULT NULL,
    `change_1d_percent` float DEFAULT NULL,
    PRIMARY KEY (`day`,`tag`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `base_hierarchy_id`;
  CREATE TABLE `base_hierarchy_id` (
    `id` int NOT NULL AUTO_INCREMENT,
    `type` enum('BRAND','REGION','PRODUCT_GROUP','GENERIC_HIERARCHY_FILTER') NOT NULL,
    `hierarchy_id` int NOT NULL,
    `customer_id` int NOT NULL,
    `filter_name` varchar(256) DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `blacklist_author`;
  CREATE TABLE `blacklist_author` (
    `guid` char(36)  NOT NULL,
    `name` varchar(255) NOT NULL,
    `sourcetype_id` tinyint NOT NULL,
    PRIMARY KEY (`guid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `blacklist_channel`;
  CREATE TABLE `blacklist_channel` (
    `id` int NOT NULL AUTO_INCREMENT,
    `source_guid` char(36) NOT NULL,
    `sourcetype_id` tinyint NOT NULL,
    `channel_id` varchar(255) NOT NULL,
    `channel_name` varchar(255) DEFAULT NULL,
    `user_id` int DEFAULT NULL,
    `customer_id` int DEFAULT NULL,
    `date` timestamp NOT NULL DEFAULT current_timestamp(),
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `blacklist_phrase`;
  CREATE TABLE `blacklist_phrase` (
    `id` int unsigned NOT NULL AUTO_INCREMENT,
    `source_guid` char(36) NOT NULL,
    `phrase` varchar(100) NOT NULL,
    PRIMARY KEY (`id`) USING BTREE
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `blacklist_source`;
  CREATE TABLE `blacklist_source` (
    `guid` char(36) NOT NULL,
    `url` varchar(500) NOT NULL,
    `sourcetype_id` tinyint NOT NULL,
    `user_id` int DEFAULT 0,
    `date` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`guid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `blacklist_sourcename`;
  CREATE TABLE `blacklist_sourcename` (
    `name` varchar(100) NOT NULL,
    `url` varchar(100) NOT NULL,
    `sourcetype_id` tinyint NOT NULL,
    PRIMARY KEY (`name`,`url`,`sourcetype_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `blacklist_url`;
  # CREATE TABLE `blacklist_url` (
  #   `url` varchar(250) DEFAULT NULL,
  #   UNIQUE KEY `url_regex` (`url`)
  # ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  CREATE TABLE `blacklist_url` (
    `url` varchar(250) NOT NULL,
    PRIMARY KEY `url_regex` (`url`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `category`;
  CREATE TABLE `category` (
    `id` int unsigned NOT NULL AUTO_INCREMENT,
    `category_list_id` int unsigned NOT NULL,
    `name` varchar(255) NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `category_list_id_name` (`category_list_id`,`name`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `configuration`;
  CREATE TABLE `configuration` (
    `key` varchar(255) NOT NULL,
    `value` text NOT NULL,
    PRIMARY KEY (`key`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `customer`;
  CREATE TABLE `customer` (
    `id` int NOT NULL AUTO_INCREMENT,
    `name` varchar(255) DEFAULT NULL,
    `editorial` tinyint DEFAULT NULL,
    `token` varchar(45) DEFAULT NULL,
    `creation_date` datetime DEFAULT NULL,
    `update_date` datetime DEFAULT NULL,
    `password_expiration_period` int NOT NULL DEFAULT 90 COMMENT 'password expiration period in days',
    `max_inactivity_days` int NOT NULL DEFAULT 0,
    `automated_sentiment` tinyint DEFAULT 0,
    `created_by` int DEFAULT NULL,
    `automated_sentiment_type` int DEFAULT NULL,
    `inactive` tinyint DEFAULT NULL,
    `tagged_mode_default_value` tinyint DEFAULT NULL,
    `visibility_restriction_filter_id` int DEFAULT NULL,
    `hide_author_names` tinyint DEFAULT NULL,
    `basic_anonymization` tinyint DEFAULT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `uniquetoken` (`token`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `customer_metadata`;
  CREATE TABLE `customer_metadata` (
    `customer_id` int NOT NULL,
    `update_date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
    `startpage_update_date` datetime DEFAULT NULL,
    `startpage_sentiment_score` double DEFAULT 0,
    `startpage_text` mediumtext DEFAULT NULL,
    `contact_name` varchar(255) DEFAULT NULL,
    `contact_pos` varchar(255) DEFAULT NULL,
    `contact_tel` varchar(255) DEFAULT NULL,
    `contact_mail` varchar(255) DEFAULT NULL,
    `contact_html_text` mediumtext DEFAULT NULL,
    `manual_url` varchar(255) DEFAULT NULL,
    `theme_logo_url` varchar(255) DEFAULT NULL,
    `theme_logo` varbinary(50000) DEFAULT NULL,
    `theme_logo_analytics` blob DEFAULT NULL,
    `theme_logo_type` varchar(4) DEFAULT NULL,
    `theme_background_url` text DEFAULT NULL,
    `theme_background_color` char(8) DEFAULT NULL,
    `theme_main_color` char(8) DEFAULT '0x0084A8',
    `customer_reference_name` varchar(255) DEFAULT NULL,
    `customer_reference_mail` varchar(255) DEFAULT NULL,
    `vico_reference_name` varchar(255) DEFAULT NULL,
    `vico_reference_mail` varchar(255) DEFAULT NULL,
    `views_for_analysis` varchar(50) DEFAULT NULL,
    `sentiment_scale` text DEFAULT NULL,
    `sentiment_ranges` text DEFAULT NULL,
    `theme_id` bigint DEFAULT NULL,
    `pptx_template_id` bigint DEFAULT NULL,
    `docx_template_id` bigint DEFAULT NULL,
    `xlsx_template_id` bigint DEFAULT NULL,
    PRIMARY KEY (`customer_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `customer_productkpidata`;
  CREATE TABLE `customer_productkpidata` (
    `id` bigint NOT NULL AUTO_INCREMENT,
    `amz_rating` decimal(19,2) DEFAULT NULL,
    `amz_rating_prev` decimal(19,2) DEFAULT NULL,
    `asin` varchar(32) DEFAULT NULL,
    `cproductId_hi` bigint DEFAULT NULL,
    `cproductId_lo` bigint DEFAULT NULL,
    `customerId` int DEFAULT NULL,
    `ean` varchar(32) DEFAULT NULL,
    `language` int DEFAULT NULL,
    `lifetime_rating` decimal(19,2) DEFAULT NULL,
    `lifetime_rating_prev` decimal(19,2) DEFAULT NULL,
    `lifetime_volume` decimal(19,2) DEFAULT NULL,
    `name` longtext ,
    `price` decimal(19,2) DEFAULT NULL,
    `price_prev` decimal(19,2) DEFAULT NULL,
    `rating` decimal(19,2) DEFAULT NULL,
    `rating_1star` int DEFAULT NULL,
    `rating_2star` int DEFAULT NULL,
    `rating_3star` int DEFAULT NULL,
    `rating_4star` int DEFAULT NULL,
    `rating_5star` int DEFAULT NULL,
    `rating_prev` decimal(19,2) DEFAULT NULL,
    `shopId` int DEFAULT NULL,
    `version` int DEFAULT NULL,
    `volume` int DEFAULT NULL,
    `volume_prev` int DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `idx_prim` (`customerId`,`version`,`language`,`cproductId_hi`,`cproductId_lo`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `dashboard_channel`;
  CREATE TABLE `dashboard_channel` (
    `id` int NOT NULL AUTO_INCREMENT,
    `customer_id` int NOT NULL,
    `entity_guid` char(36) NOT NULL DEFAULT '',
    `sourcetype_id` tinyint unsigned NOT NULL DEFAULT 0,
    `channel_name` varchar(255) DEFAULT NULL,
    `url` varchar(255) DEFAULT NULL,
    `display_name` varchar(255) DEFAULT NULL,
    `source_guid` char(36) DEFAULT NULL,
    `channel_id` varchar(255) DEFAULT NULL,
    `country` tinyint NOT NULL DEFAULT 0,
    `language` tinyint NOT NULL DEFAULT 0,
    `authentication_token` varchar(200) DEFAULT NULL,
    `marked_as_owned` tinyint DEFAULT 0,
    `token_id` int DEFAULT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `customer_id_source_guid_channel_id` (`customer_id`,`source_guid`,`channel_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `dashboard_view`;
  CREATE TABLE `dashboard_view` (
    `id` int NOT NULL AUTO_INCREMENT,
    `name` varchar(45) NOT NULL,
    `comment` varchar(255) DEFAULT NULL,
    `user_id` int NOT NULL DEFAULT 0,
    `role_id` int NOT NULL DEFAULT 0,
    `group_id` int NOT NULL DEFAULT 0,
    `is_default` int NOT NULL DEFAULT 0,
    `keywords` text DEFAULT NULL,
    `sortorder` int DEFAULT NULL,
    `root_id` int NOT NULL,
    `visible` tinyint unsigned NOT NULL DEFAULT 1,
    `customer_id` int DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `dashboard_view_node`;
  CREATE TABLE `dashboard_view_node` (
    `id` int NOT NULL AUTO_INCREMENT,
    `identifier` varchar(50) NOT NULL DEFAULT '',
    `parent_id` int NOT NULL,
    `name` varchar(100) NOT NULL,
    `checked` tinyint NOT NULL,
    `type` tinyint NOT NULL,
    `sortorder` int unsigned NOT NULL DEFAULT 0,
    `entry_count_30` int unsigned NOT NULL DEFAULT 0,
    `is_topic` tinyint unsigned NOT NULL DEFAULT 0,
    `top_topic` tinyint unsigned NOT NULL DEFAULT 0,
    `editorial` tinyint DEFAULT 0,
    `restricting_subnode` tinyint DEFAULT 0,
    `spssname` varchar(100) NOT NULL DEFAULT '',
    `sentiment_parent_id` int NOT NULL DEFAULT 0,
    `topics` varchar(255) DEFAULT NULL,
    `token` varchar(45) DEFAULT NULL,
    `multitagging` tinyint DEFAULT NULL,
    `creation_user_id` int DEFAULT NULL,
    `creation_date` datetime DEFAULT NULL,
    `update_date` datetime DEFAULT NULL,
    `update_user_id` int DEFAULT NULL,
    `node_custom_color` char(8) DEFAULT NULL,
    `sentiment_type` tinyint unsigned NOT NULL DEFAULT 1,
    `external_export` tinyint DEFAULT 0,
    `forces_sentiment` tinyint DEFAULT 0,
    `multiple_validation` tinyint DEFAULT 0,
    `inactive` tinyint DEFAULT 0,
    `volumeexceeded` tinyint DEFAULT 0,
    `auto_sentiment` tinyint DEFAULT 1,
    `complement` tinyint unsigned DEFAULT NULL,
    `linked_to_id` int DEFAULT NULL,
    `tagged` tinyint DEFAULT 0,
    `structural` tinyint DEFAULT 0,
    `channels_inherited` tinyint unsigned DEFAULT 0,
    `social_metric` tinyint unsigned DEFAULT 0,
    `social_metric_channel_id` int DEFAULT NULL,
    `retrieve_amazon_comments` tinyint unsigned NOT NULL DEFAULT 0,
    `retrieve_amazon_qa` tinyint unsigned NOT NULL DEFAULT 0,
    `retrieve_prices` tinyint unsigned NOT NULL DEFAULT 0,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `dashboard_view_node_category`;
  CREATE TABLE `dashboard_view_node_category` (
    `id` int NOT NULL AUTO_INCREMENT,
    `name` varchar(255) NOT NULL,
    `node_id` int DEFAULT NULL,
    `creation_date` datetime DEFAULT NULL,
    `update_date` datetime DEFAULT NULL,
    `customer_id` int DEFAULT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `namenode` (`name`,`node_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `dashboard_view_node_category_topic`;
  CREATE TABLE `dashboard_view_node_category_topic` (
    `id` int NOT NULL AUTO_INCREMENT,
    `name` varchar(255) DEFAULT NULL,
    `category_id` int DEFAULT NULL,
    `creation_date` datetime DEFAULT NULL,
    `update_date` datetime DEFAULT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `namecategory` (`name`,`category_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `dashboard_view_node_channel`;
  CREATE TABLE `dashboard_view_node_channel` (
    `node_id` int NOT NULL,
    `channel_id` int NOT NULL,
    UNIQUE KEY `UniqueRow` (`node_id`,`channel_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `dashboard_view_node_custom_query`;
  CREATE TABLE `dashboard_view_node_custom_query` (
    `id` int NOT NULL AUTO_INCREMENT,
    `query` text NOT NULL,
    `node_id` int NOT NULL,
    `description` text DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `dashboard_view_node_customer_product`;
  CREATE TABLE `dashboard_view_node_customer_product` (
    `node_id` int NOT NULL,
    `uuid` varchar(36) NOT NULL,
    UNIQUE KEY `uniquekey1` (`node_id`,`uuid`) USING BTREE
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `dashboard_view_node_entity`;
  CREATE TABLE `dashboard_view_node_entity` (
    `node_id` int NOT NULL DEFAULT 0,
    `entity_guid` char(36) NOT NULL DEFAULT '',
    `sourcetype_id` tinyint unsigned NOT NULL DEFAULT 0,
    `source_guid` char(36) DEFAULT NULL,
    `channel_id` varchar(255) DEFAULT NULL,
    `channel_name` varchar(255) DEFAULT NULL,
    `url` varchar(255) DEFAULT NULL,
    `display_name` varchar(255) DEFAULT NULL,
    `country` tinyint NOT NULL DEFAULT 0,
    `language` tinyint NOT NULL DEFAULT 0,
    PRIMARY KEY (`node_id`,`entity_guid`),
    UNIQUE KEY `node_id_source_guid_channel_id` (`node_id`,`source_guid`,`channel_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `dashboard_view_node_product_category`;
  CREATE TABLE `dashboard_view_node_product_category` (
    `node_id` int NOT NULL,
    `product_category_identifier` varchar(36) NOT NULL,
    UNIQUE KEY `node_id_product_category_identifier` (`node_id`,`product_category_identifier`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `dashboard_view_node_query`;
  CREATE TABLE `dashboard_view_node_query` (
    `id` int NOT NULL AUTO_INCREMENT,
    `node_id` int NOT NULL,
    `query` text NOT NULL,
    `language_id` int NOT NULL,
    `sourceset_id` int DEFAULT NULL,
    `pos_in_node` int DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `entry_editorial`;
  # InnoDB change: Added primary key
  CREATE TABLE `entry_editorial` (
    `guid` char(36) NOT NULL,
    `node_id` int unsigned NOT NULL,
    `category_id` int unsigned NOT NULL,
    `topic_id` int unsigned NOT NULL,
    `sentiment` tinyint NOT NULL DEFAULT 0,
    KEY `guid` (`guid`),
    PRIMARY KEY (`guid`,`node_id`,`category_id`,`topic_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `filter_alias`;
  CREATE TABLE `filter_alias` (
    `id` int NOT NULL AUTO_INCREMENT,
    `customer_id` int NOT NULL,
    `filter_id` int NOT NULL,
    `filter_alias` varchar(100) NOT NULL,
    `locale` varchar(100) DEFAULT NULL,
    `is_hierarchy` tinyint NOT NULL DEFAULT 0,
    PRIMARY KEY (`id`),
    UNIQUE KEY `filter_alias_UN` (`customer_id`,`filter_id`,`locale`,`is_hierarchy`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `filter_keywords`;
  # InnoDB change: Added primary key
  CREATE TABLE `filter_keywords` (
    `keyword` mediumtext NOT NULL,
    `id` int NOT NULL,
    `language_id` tinyint unsigned NOT NULL,
    PRIMARY KEY (`id`,`language_id`, `keyword`(255))
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `filter_list`;
  CREATE TABLE `filter_list` (
    `id` int NOT NULL AUTO_INCREMENT,
    `name` varchar(45) DEFAULT NULL,
    `user_id` int DEFAULT NULL,
    `global` tinyint DEFAULT NULL,
    `creation_date` datetime DEFAULT NULL,
    `update_date` datetime DEFAULT NULL,
    `customer_id` int DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `group`;
  CREATE TABLE `group` (
    `id` int NOT NULL AUTO_INCREMENT,
    `name` varchar(45) DEFAULT NULL,
    `parent_id` int DEFAULT NULL,
    `creation_date` datetime DEFAULT NULL,
    `update_date` datetime DEFAULT NULL,
    `cust_id` int DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `group_customer`;
  CREATE TABLE `group_customer` (
    `group_id` int NOT NULL,
    `customer_id` int NOT NULL,
    PRIMARY KEY (`group_id`,`customer_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `group_project`;
  CREATE TABLE `group_project` (
    `group_id` int NOT NULL,
    `project_id` bigint NOT NULL,
    PRIMARY KEY (`group_id`,`project_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `indexer_parameters`;
  CREATE TABLE `indexer_parameters` (
    `date` datetime NOT NULL,
    `sourceType` int unsigned NOT NULL,
    `schema` varchar(255) NOT NULL,
    `dbm` varchar(50) NOT NULL,
    `mode` enum('ID','DATE') NOT NULL DEFAULT 'DATE',
    `maxid` int unsigned NOT NULL DEFAULT 0,
    `maxidOld` int unsigned NOT NULL DEFAULT 0,
    `exception` text DEFAULT NULL,
    `numExceptions` int NOT NULL DEFAULT 0,
    PRIMARY KEY (`sourceType`,`schema`,`dbm`,`mode`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `language`;
  CREATE TABLE `language` (
    `id` int NOT NULL,
    `language` varchar(45) NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `list_author`;
  CREATE TABLE `list_author` (
    `list_id` int NOT NULL,
    `author_guid` varchar(45) NOT NULL,
    `tagged` tinyint unsigned NOT NULL DEFAULT 1,
    PRIMARY KEY (`list_id`,`author_guid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `list_document`;
  CREATE TABLE `list_document` (
    `list_id` int NOT NULL,
    `document_guid` varchar(45) NOT NULL,
    PRIMARY KEY (`list_id`,`document_guid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `list_source`;
  CREATE TABLE `list_source` (
    `list_id` int NOT NULL,
    `source_guid` varchar(45) NOT NULL,
    `tagged` tinyint unsigned NOT NULL DEFAULT 1,
    PRIMARY KEY (`list_id`,`source_guid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `log_customer`;
  # InnoDB change: Added id
  CREATE TABLE `log_customer` (
    `id` int NOT NULL AUTO_INCREMENT,
    `date` datetime NOT NULL,
    `customer_id` int DEFAULT NULL,
    `name` varchar(255) DEFAULT NULL,
    `action` int DEFAULT NULL,
    `user_id` int DEFAULT NULL,
     PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `log_macro`;
  # InnoDB change: Added id
  CREATE TABLE `log_macro` (
    `id` int NOT NULL AUTO_INCREMENT,
    `date` datetime NOT NULL,
    `macro_id` int DEFAULT NULL,
    `query` text DEFAULT NULL,
    `user_id` int DEFAULT NULL,
    `action` int DEFAULT NULL,
    `description` text DEFAULT NULL,
     PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `log_node`;
  # InnoDB change: Added id
  CREATE TABLE `log_node` (
    `id` int NOT NULL AUTO_INCREMENT,
    `date` datetime NOT NULL,
    `node_id` int DEFAULT NULL,
    `view_id` int DEFAULT NULL,
    `name` varchar(255) DEFAULT NULL,
    `action` int DEFAULT NULL,
    `user_id` int DEFAULT NULL,
    `restricting_subnode` tinyint DEFAULT NULL,
    `parent_id` int DEFAULT NULL,
     PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `log_product_category`;
  # InnoDB change: Added id
  CREATE TABLE `log_product_category` (
    `id` int NOT NULL AUTO_INCREMENT,
    `hierarchy_id` int NOT NULL,
    `category_id` int NOT NULL COMMENT 'in case of creating and deleting hierarchies set this to 0',
    `customer_product_id` varchar(36) DEFAULT NULL,
    `linked_feed_id` int DEFAULT NULL,
    `user_id` int NOT NULL,
    `customer_id` int NOT NULL,
    `action` enum('ADD_PRODUCT','REMOVE_PRODUCT','ADD_LINKED_FEED','REMOVE_LINKED_FEED','CREATE_HIERARCHY','DELETE_HIERARCHY','CREATE_CATEGORY','DELETE_CATEGORY','CHANGE_NAME','CHANGE_COLOR') COLLATE utf8mb4_unicode_ci NOT NULL,
    `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
     PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `log_query`;
  # InnoDB change: Added id
  CREATE TABLE `log_query` (
    `id` int NOT NULL AUTO_INCREMENT,
    `date` datetime NOT NULL,
    `query_id` int DEFAULT NULL,
    `query` text DEFAULT NULL,
    `node_id` int DEFAULT NULL,
    `language_id` int DEFAULT NULL,
    `sourceset_id` int DEFAULT NULL,
    `action` int DEFAULT NULL,
    `user_id` int DEFAULT NULL,
    `channels` text DEFAULT NULL,
    `pos_in_node` int DEFAULT NULL,
    `description` text DEFAULT NULL,
     PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `log_report`;
  CREATE TABLE `log_report` (
    `id` int NOT NULL AUTO_INCREMENT,
    `report_id` int DEFAULT NULL,
    `report_name` varchar(255) DEFAULT NULL,
    `status` enum('STARTED','FILE_PRODUCED','MAIL_SENT','FAILED') NOT NULL,
    `started_at` datetime DEFAULT NULL,
    `file_produced_at` datetime DEFAULT NULL,
    `mail_sent_at` datetime DEFAULT NULL,
    `failed_at` datetime DEFAULT NULL,
    `error_message` text DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `macro`;
  CREATE TABLE `macro` (
    `id` int NOT NULL AUTO_INCREMENT,
    `customer_id` int DEFAULT NULL,
    `category_id` int DEFAULT NULL,
    `name` varchar(50) DEFAULT NULL,
    `query` text DEFAULT NULL,
    `created` datetime DEFAULT NULL,
    `created_by` int DEFAULT NULL,
    `updated` datetime DEFAULT NULL,
    `updated_by` int DEFAULT NULL,
    `description` text DEFAULT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `customer_id_category_id_name` (`customer_id`,`category_id`,`name`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `macro_category`;
  CREATE TABLE `macro_category` (
    `id` int NOT NULL AUTO_INCREMENT,
    `customer_id` int DEFAULT NULL,
    `name` varchar(50) DEFAULT NULL,
    `created` datetime DEFAULT NULL,
    `created_by` int DEFAULT NULL,
    `updated` datetime DEFAULT NULL,
    `updated_by` int DEFAULT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `customer_name` (`name`,`customer_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `market_price_class`;
  CREATE TABLE `market_price_class` (
    `id` bigint NOT NULL AUTO_INCREMENT,
    `class_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `country_id` int DEFAULT NULL,
    `customer_id` int NOT NULL,
    `customer_product_category` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `max_price` decimal(8,2) DEFAULT NULL,
    `min_price` decimal(8,2) DEFAULT NULL,
    `valid_from` datetime NOT NULL,
    `valid_to` datetime NOT NULL,
    PRIMARY KEY (`id`) USING BTREE
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `node_sentiment_model`;
  CREATE TABLE `node_sentiment_model` (
    `node_id` int NOT NULL,
    `language_id` int NOT NULL,
    `model_id` int NOT NULL,
    PRIMARY KEY (`node_id`,`language_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `node_sentimentquery`;
  CREATE TABLE `node_sentimentquery` (
    `node_id` int NOT NULL,
    `sentimentquery_id` int NOT NULL,
    `language_id` int NOT NULL,
    `sentiment` int NOT NULL,
    UNIQUE KEY `Schlüssel 1` (`node_id`,`sentimentquery_id`,`language_id`,`sentiment`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `oauth_access_token`;
  CREATE TABLE `oauth_access_token` (
    `token_id` varchar(45) NOT NULL,
    `token` blob DEFAULT NULL,
    `authentication_id` varchar(45) DEFAULT NULL,
    `user_name` varchar(45) DEFAULT NULL,
    `client_id` varchar(45) DEFAULT NULL,
    `authentication` blob DEFAULT NULL,
    `refresh_token` varchar(45) DEFAULT NULL,
    PRIMARY KEY (`token_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `oauth_client_details`;
  CREATE TABLE `oauth_client_details` (
    `client_id` varchar(205) NOT NULL,
    `resource_ids` varchar(205) DEFAULT NULL,
    `client_secret` varchar(205) DEFAULT NULL,
    `scope` varchar(205) DEFAULT NULL,
    `authorized_grant_types` varchar(205) DEFAULT NULL,
    `web_server_redirect_uri` varchar(205) DEFAULT NULL,
    `authorities` varchar(205) DEFAULT NULL,
    `access_token_validity` int DEFAULT NULL,
    `refresh_token_validity` int DEFAULT NULL,
    `additional_information` varchar(220) DEFAULT NULL,
    `autoapprove` varchar(205) DEFAULT NULL,
    PRIMARY KEY (`client_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `pricing_customer_booking`;
  CREATE TABLE `pricing_customer_booking` (
    `id` int NOT NULL AUTO_INCREMENT,
    `pricing_type` int DEFAULT NULL,
    `reference_id` int DEFAULT NULL,
    `quantity` int DEFAULT NULL,
    `customer_id` float DEFAULT NULL,
    `date` datetime DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `pricing_customer_price`;
  # InnoDB change: Added primary key
  CREATE TABLE `pricing_customer_price` (
    `customer_id` int NOT NULL,
    `pricing_type` int NOT NULL,
    `reference_id` int NOT NULL,
    `price` float DEFAULT NULL,
    PRIMARY KEY (`customer_id`,`pricing_type`,`reference_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `pricing_customer_volume`;
  CREATE TABLE `pricing_customer_volume` (
    `customer_id` int NOT NULL DEFAULT 0,
    `date` date NOT NULL DEFAULT '1970-01-01',
    `volume` int DEFAULT NULL,
    `volume_exceeded` tinyint DEFAULT NULL,
    `volume_trend_exceeded` tinyint DEFAULT NULL,
    `volume_percent_exceeded` int DEFAULT NULL,
    `mail_sent_exceeded` datetime DEFAULT NULL,
    `mail_sent_trend_exceeded` datetime DEFAULT NULL,
    `mail_sent_percent_exceeded` datetime DEFAULT NULL,
    `mail_sent_110_percent_exceeded` datetime DEFAULT NULL,
    `mail_sent_150_percent_exceeded` datetime DEFAULT NULL,
    PRIMARY KEY (`customer_id`,`date`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `pricing_feature`;
  CREATE TABLE `pricing_feature` (
    `id` int NOT NULL AUTO_INCREMENT,
    `feature_type` int NOT NULL DEFAULT 0,
    `name` varchar(255) NOT NULL DEFAULT '0',
    `definition` text NOT NULL,
    `value` int NOT NULL DEFAULT 0,
    `price` float NOT NULL DEFAULT 0,
    `bookable` tinyint DEFAULT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `feature_type_name_bookable` (`feature_type`,`name`,`bookable`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `pricing_feed_volume`;
  CREATE TABLE `pricing_feed_volume` (
    `feed_id` int NOT NULL,
    `date` date NOT NULL,
    `volume` int DEFAULT NULL,
    `customer_id` int DEFAULT NULL,
    PRIMARY KEY (`feed_id`,`date`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `pricing_package`;
  CREATE TABLE `pricing_package` (
    `id` int NOT NULL AUTO_INCREMENT,
    `name` varchar(255) NOT NULL DEFAULT '0',
    `price` float NOT NULL DEFAULT 0,
    `required_package` int DEFAULT 0,
    `base_package` tinyint DEFAULT 0,
    `description` text DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `pricing_package_feature`;
  CREATE TABLE `pricing_package_feature` (
    `package_id` int NOT NULL,
    `feature_id` int NOT NULL,
    PRIMARY KEY (`package_id`,`feature_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `product_reference_price`;
  CREATE TABLE `product_reference_price` (
    `id` varchar(36) NOT NULL,
    `name` varchar(100) DEFAULT NULL,
    `price` decimal(10,2) NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `rate_limit_configuration`;
  CREATE TABLE `rate_limit_configuration` (
    `id` int NOT NULL AUTO_INCREMENT,
    `client` varchar(255) NOT NULL,
    `customer_id` int NOT NULL,
    `user_id` int DEFAULT NULL,
    `bucket_size` bigint NOT NULL,
    `period_in_seconds` bigint NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  
  # DROP TABLE IF EXISTS TABLE `reference_date`;
  # CREATE TABLE `reference_date` (
  #   `oldest` date DEFAULT NULL,
  #   `latest` date DEFAULT NULL
  # ) ENGINE=MyISAM DEFAULT CHARSET=utf8
  
  DROP TABLE IF EXISTS `rights`;
  CREATE TABLE `rights` (
    `id` int NOT NULL AUTO_INCREMENT,
    `name` varchar(45) DEFAULT NULL,
    `comment` varchar(255) DEFAULT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `name` (`name`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `role`;
  CREATE TABLE `role` (
    `id` int NOT NULL AUTO_INCREMENT,
    `name` varchar(255) DEFAULT NULL,
    `user_id` int DEFAULT NULL,
    `invisible` tinyint NOT NULL DEFAULT 0,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `role_grant_role`;
  CREATE TABLE `role_grant_role` (
    `granting_role_id` int NOT NULL,
    `granted_role_id` int NOT NULL,
    PRIMARY KEY (`granting_role_id`,`granted_role_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `role_rights`;
  CREATE TABLE `role_rights` (
    `role_id` int NOT NULL,
    `right_id` varchar(45) NOT NULL,
    `read` tinyint DEFAULT NULL,
    `write` tinyint DEFAULT NULL,
    PRIMARY KEY (`role_id`,`right_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `scheduled_export_task`;
  CREATE TABLE `scheduled_export_task` (
    `id` bigint NOT NULL AUTO_INCREMENT,
    `export_type` enum('DLW_LEGACY','DLW_FEEDBASED','DLW_CUSTOM_COLUMNS_LEGACY','DLW_CUSTOM_COLUMNS_FEEDBASED','DCW','PERSPECTIVE','DASHBOARD','PRODUCT_PRICE_LIST','PRODUCT_LIST','MARKET_PRICE_CLASS_LIST','DOCUMENT_LIST') COLLATE utf8mb4_unicode_ci NOT NULL,
    `commissioned_at` datetime DEFAULT NULL,
    `export_format` varchar(255) DEFAULT NULL,
    `file_name` varchar(255) DEFAULT NULL,
    `worker_id` varchar(256) NOT NULL,
    `dashboard_id` bigint DEFAULT NULL,
    `file_path` varchar(255) DEFAULT NULL,
    `filter` longblob DEFAULT NULL,
    `finished_at` datetime DEFAULT NULL,
    `started_at` datetime DEFAULT NULL,
    `status` varchar(255) DEFAULT NULL,
    `user` longblob DEFAULT NULL,
    `widget` longblob DEFAULT NULL,
    PRIMARY KEY (`id`) USING BTREE
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `searchterm_management_log`;
  CREATE TABLE `searchterm_management_log` (
    `id` int unsigned NOT NULL AUTO_INCREMENT,
    `started` datetime NOT NULL,
    `finished` datetime DEFAULT NULL,
    `action` mediumtext NOT NULL,
    `params` mediumtext DEFAULT NULL,
    `error` mediumtext DEFAULT NULL,
    `user_id` int unsigned NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `sentiment_model_trials`;
  # InnoDB change: Added primary key (correct?)
  CREATE TABLE `sentiment_model_trials` (
    `model_id` int NOT NULL,
    `sentiment` tinyint NOT NULL,
    `precision` decimal(4,3) DEFAULT NULL,
    `recall` decimal(4,3) DEFAULT NULL,
    `gold_size` int NOT NULL,
    `predicted_size` int NOT NULL,
    `est_ddiff` decimal(4,3) DEFAULT NULL,
    `trial_id` int NOT NULL,
    `series_id` int NOT NULL,
     PRIMARY KEY (`model_id`,`sentiment`,`trial_id`,`series_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `sentiment_models`;
  CREATE TABLE `sentiment_models` (
    `id` int NOT NULL AUTO_INCREMENT,
    `name` varchar(255) NOT NULL,
    `file_name` varchar(255) NOT NULL,
    `description` varchar(511) NOT NULL,
    `customer_id` int unsigned DEFAULT NULL,
    `language_id` int NOT NULL,
    `accuracy` decimal(5,2) NOT NULL,
    `comment` varchar(2000) NOT NULL,
    `is_default` tinyint NOT NULL DEFAULT 0,
    `last_update` datetime DEFAULT NULL,
    `last_annot_date` datetime DEFAULT NULL,
    `last_checked` datetime DEFAULT NULL,
    `has_trials` tinyint NOT NULL DEFAULT 0,
    `method` int NOT NULL DEFAULT 0,
    `is_global` int DEFAULT NULL,
    `global_for_customer` int NOT NULL DEFAULT 0,
    `is_multiple_validated` tinyint unsigned DEFAULT 0,
    `allow_simply_validated` tinyint unsigned DEFAULT 0,
    `is_strict` tinyint unsigned DEFAULT 1,
    `min_validation` smallint unsigned DEFAULT 0,
    `w2v_model_name` varchar(200) DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `sentimentquery`;
  CREATE TABLE `sentimentquery` (
    `id` int NOT NULL AUTO_INCREMENT,
    `name` tinytext NOT NULL,
    `query` text NOT NULL,
    `language_id` int NOT NULL DEFAULT 0,
    `customer_id` int NOT NULL DEFAULT 0,
    `sentiment` tinyint NOT NULL,
    `priority` int NOT NULL DEFAULT 0,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `service_entry`;
  CREATE TABLE `service_entry` (
    `guid` char(36) NOT NULL,
    `pub_date` datetime NOT NULL,
    `update_date` datetime NOT NULL,
    `document_type_id` tinyint unsigned NOT NULL,
    `url` varchar(400) NOT NULL,
    `title` text NOT NULL,
    `content` text NOT NULL,
    `sourcetype_id` tinyint unsigned NOT NULL,
    `sourceguid` char(36) NOT NULL,
    `language_id` tinyint unsigned NOT NULL,
    `country_id` tinyint unsigned NOT NULL,
    `author_name` varchar(255) NOT NULL,
    `author_url` varchar(400) NOT NULL,
    `author_picture_url` varchar(400) NOT NULL,
    `thread_name` varchar(255) NOT NULL,
    `thread_url` varchar(400) NOT NULL,
    `comment_count` int unsigned NOT NULL,
    `like_count` int unsigned NOT NULL,
    `dislike_count` int unsigned NOT NULL DEFAULT 0,
    `metadata` text NOT NULL,
    `author_is_channel` tinyint NOT NULL DEFAULT 0,
    `original_entry_id` varchar(200) NOT NULL,
    `original_conversation_id` varchar(200) NOT NULL,
    `in_reply_to_id` varchar(200) NOT NULL,
    PRIMARY KEY (`guid`),
    KEY `sourcetype_id` (`sourcetype_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  
  DROP TABLE IF EXISTS `shared_clipboard`;
  CREATE TABLE `shared_clipboard` (
    `id` int NOT NULL AUTO_INCREMENT,
    `owner_user_id` int NOT NULL,
    `shared_user_id` int NOT NULL,
    `customer_id` int NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `shared_clipboard_UN` (`shared_user_id`,`owner_user_id`,`customer_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `source`;
  CREATE TABLE `source` (
    `guid` char(36) NOT NULL,
    `url` text NOT NULL,
    `name` text NOT NULL,
    `language_id` int unsigned NOT NULL,
    `country_id` int unsigned NOT NULL,
    `sourcetype_id` int unsigned NOT NULL,
    `relevance` int unsigned NOT NULL DEFAULT 0,
    `category` int DEFAULT NULL,
    `token` char(5) NOT NULL DEFAULT 'YYYYY',
    `is_new` tinyint unsigned NOT NULL DEFAULT 1,
    `alexa_checked` tinyint unsigned NOT NULL DEFAULT 0,
    PRIMARY KEY (`guid`),
    KEY `alexa_checked` (`alexa_checked`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  
  DROP TABLE IF EXISTS `sourceset`;
  CREATE TABLE `sourceset` (
    `id` int unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(50) NOT NULL,
    `language_id` int unsigned NOT NULL,
    `read_only` tinyint unsigned NOT NULL DEFAULT 0,
    `customer_id` int DEFAULT NULL,
    `editor` int DEFAULT NULL,
    `edit_date` datetime DEFAULT NULL,
    `creator` int DEFAULT NULL,
    `creation_date` datetime DEFAULT NULL,
    `blacklist` tinyint DEFAULT NULL,
    `global` tinyint unsigned NOT NULL DEFAULT 0,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `sourceset_subselection`;
  # InnoDB change: Primary Key
  CREATE TABLE `sourceset_subselection` (
    `id` int unsigned NOT NULL,
    `source_guid` char(36) NOT NULL,
    KEY `id` (`id`),
    PRIMARY KEY (`id`, `source_guid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `sourceset_types`;
  CREATE TABLE `sourceset_types` (
    `sourceset_id` int unsigned NOT NULL,
    `sourcetype_id` int unsigned NOT NULL,
    `subselection_id` int unsigned DEFAULT NULL,
    `exclude` tinyint DEFAULT NULL,
    UNIQUE KEY `sourceset_id_source` (`sourceset_id`,`sourcetype_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  
  DROP TABLE IF EXISTS `station_annotator_errors`;
  CREATE TABLE `station_annotator_errors` (
    `incident_id` int NOT NULL AUTO_INCREMENT,
    `incident_date` datetime NOT NULL,
    `resolved` tinyint NOT NULL,
    `document_pubdate` datetime DEFAULT NULL,
    `document_guid` char(36) DEFAULT NULL,
    `document_url` varchar(1024) DEFAULT NULL,
    `kafka_topic` varchar(100) NOT NULL,
    `kafka_partition` int DEFAULT NULL,
    `kafka_offset` bigint NOT NULL,
    `context` varchar(100) DEFAULT NULL,
    `cause` mediumtext DEFAULT NULL,
    PRIMARY KEY (`incident_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `statistics_user_action`;
  CREATE TABLE `statistics_user_action` (
    `id` int NOT NULL AUTO_INCREMENT,
    `action` varchar(255) DEFAULT NULL,
    `action_date` datetime DEFAULT NULL,
    `customer_id` int DEFAULT NULL,
    `user_id` int DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `UK_hb9cx5iul3rcoe6f1oxr1pyp8` (`user_id`),
    KEY `UK_jotnkms79a9o7vgjic3gcdvel` (`customer_id`),
    KEY `UK_q2c6aey518l3mr69i6evj8u1n` (`action`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `stopwords`;
  # InnoDB change: Added primary key
  CREATE TABLE `stopwords` (
    `stopword` varchar(100) NOT NULL,
    `customer_id` int NOT NULL DEFAULT 0,
    `global` tinyint unsigned NOT NULL DEFAULT 0,
    PRIMARY KEY (`stopword`,`customer_id`, `global`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `stored_searches`;
  CREATE TABLE `stored_searches` (
    `id` int unsigned NOT NULL AUTO_INCREMENT,
    `search_str` mediumtext DEFAULT NULL,
    `name` varchar(255) DEFAULT NULL,
    `user_id` int unsigned DEFAULT NULL,
    `role_id` int unsigned DEFAULT NULL,
    `group_id` int unsigned DEFAULT NULL,
    `customer_id` int unsigned DEFAULT NULL,
    `global` tinyint unsigned NOT NULL DEFAULT 0,
    `created` datetime DEFAULT NULL,
    `updated_by` int DEFAULT NULL,
    `updated` datetime DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `synonym_tagcloud_tokens`;
  CREATE TABLE `synonym_tagcloud_tokens` (
    `id` int unsigned NOT NULL AUTO_INCREMENT,
    `canonical` varchar(255) NOT NULL,
    `pos` enum('a','n') NOT NULL,
    `language_id` tinyint unsigned NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `canonical_pos_language_id` (`canonical`,`pos`,`language_id`),
    KEY `language_id` (`language_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `synonym_tagcloud_variants`;
  CREATE TABLE `synonym_tagcloud_variants` (
    `token_id` int unsigned NOT NULL,
    `variant` varchar(255) NOT NULL,
    UNIQUE KEY `variant_token_id` (`variant`,`token_id`),
    KEY `token_id` (`token_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `thread`;
  CREATE TABLE `thread` (
    `guid` char(36) NOT NULL,
    `url` text NOT NULL,
    `name` text NOT NULL,
    `language_id` int unsigned NOT NULL,
    `country_id` int unsigned NOT NULL,
    `sourceguid` char(36) NOT NULL,
    `authorguid` char(36) DEFAULT NULL,
    `relevance` int unsigned NOT NULL DEFAULT 0,
    `sourcetype_id` int unsigned NOT NULL,
    `reach` int unsigned NOT NULL,
    `characteristic1` int unsigned NOT NULL,
    `characteristic2` int unsigned NOT NULL,
    `characteristic3` int unsigned NOT NULL,
    PRIMARY KEY (`guid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `topic`;
  CREATE TABLE `topic` (
    `id` int unsigned NOT NULL AUTO_INCREMENT,
    `modelid` int unsigned NOT NULL,
    `name` text NOT NULL,
    `keywords` text ,
    `hidden` tinyint unsigned NOT NULL DEFAULT '0',
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `topicmodel`;
  CREATE TABLE `topicmodel` (
    `id` int unsigned NOT NULL,
    `name` text NOT NULL,
    `file_name` text NOT NULL,
    `language_id` smallint unsigned NOT NULL,
    `last_update` datetime NOT NULL,
    `last_train_date` datetime NOT NULL,
    `last_checked` datetime NOT NULL,
    `topic_number` int unsigned NOT NULL,
    `upd_interval` bigint unsigned NOT NULL,
    `train_size` int unsigned NOT NULL,
    `min_train_size` int unsigned NOT NULL,
    `max_topics` int unsigned NOT NULL,
    `threshold` double NOT NULL,
    `est_threshold` double NOT NULL,
    `version` int unsigned NOT NULL,
    `window` int unsigned NOT NULL,
    `oldest` int unsigned NOT NULL,
    `sim_threshold` double NOT NULL,
    `customer_id` int unsigned DEFAULT '0',
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `topicmodel_node`;
  CREATE TABLE `topicmodel_node` (
    `node_id` int unsigned NOT NULL,
    `language_id` int unsigned NOT NULL,
    `model_id` int unsigned NOT NULL,
    UNIQUE KEY `model_id` (`model_id`,`node_id`,`language_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  # ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=FIXED
  
  DROP TABLE IF EXISTS `topicmodel_topic`;
  CREATE TABLE `topicmodel_topic` (
    `modelid` int unsigned NOT NULL,
    `indice` int unsigned NOT NULL,
    `version` int unsigned NOT NULL,
    `topicid` bigint unsigned NOT NULL,
    `enabled` tinyint unsigned NOT NULL,
    `raisedwords` text NOT NULL,
    UNIQUE KEY `Index 1` (`modelid`,`version`,`indice`,`topicid`),
    KEY `topicid` (`topicid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `topicstopwords`;
  # InnoDB change: Added primary key
  CREATE TABLE `topicstopwords` (
    `word` text NOT NULL,
    `languageid` smallint NOT NULL,
    `customerid` smallint NOT NULL DEFAULT '0',
     PRIMARY KEY (`word`(255),`languageid`,`customerid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `user_abo`;
  CREATE TABLE `user_abo` (
    `abo_id` int unsigned NOT NULL AUTO_INCREMENT,
    `user_id` int unsigned NOT NULL,
    `from` varchar(255) NOT NULL,
    `to` varchar(255) NOT NULL DEFAULT '',
    `cc` varchar(255) DEFAULT NULL,
    `bcc` varchar(255) DEFAULT NULL,
    `subject` tinytext NOT NULL,
    `comment` tinytext DEFAULT NULL,
    `mailingType` tinyint NOT NULL DEFAULT 0,
    `intervall` tinyint NOT NULL DEFAULT 0,
    `day` tinyint NOT NULL DEFAULT 0,
    `lastsent` datetime DEFAULT NULL,
    `countries` varchar(255) DEFAULT '',
    `languages` varchar(255) DEFAULT '',
    `sources` varchar(255) DEFAULT '',
    `nodes` varchar(255) DEFAULT '',
    `tagnames` varchar(255) DEFAULT '',
    `sentiment` varchar(255) DEFAULT '',
    `unit` varchar(255) DEFAULT '',
    `hotspot` varchar(255) DEFAULT '',
    `hotspottype` tinyint DEFAULT NULL,
    `timeframe` int unsigned DEFAULT NULL,
    `restrict` text DEFAULT NULL,
    `blacklist_id` int DEFAULT NULL,
    `whitelist_id` int DEFAULT NULL,
    PRIMARY KEY (`abo_id`,`user_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `user_alert`;
  CREATE TABLE `user_alert` (
    `id` int unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(100) NOT NULL,
    `user_id` int unsigned NOT NULL,
    `node_id` int unsigned NOT NULL DEFAULT 0,
    `volume_bound` int NOT NULL DEFAULT 0,
    `sentiment_bound` int NOT NULL DEFAULT 0,
    `to_addresses` text DEFAULT NULL,
    `comment` text DEFAULT NULL,
    `black_list` text DEFAULT NULL,
    `white_list` text DEFAULT NULL,
    `start_date` date DEFAULT NULL,
    `end_date` date DEFAULT NULL,
    `timespan` int unsigned DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `user_annotations`;
  CREATE TABLE `user_annotations` (
    `id` int NOT NULL AUTO_INCREMENT,
    `type` tinyint unsigned NOT NULL,
    `created` datetime NOT NULL,
    `user_id` int NOT NULL,
    `document_guid` char(36) NOT NULL,
    `language_id` tinyint unsigned NOT NULL DEFAULT 0,
    `params` text NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `user_filters`;
  CREATE TABLE `user_filters` (
    `user_id` int unsigned NOT NULL,
    `name` varchar(255) CHARACTER SET latin1 NOT NULL,
    `is_default` int unsigned DEFAULT NULL,
    `is_global` int unsigned DEFAULT NULL,
    `start_date` date DEFAULT '1970-01-01',
    `end_date` date DEFAULT '1970-01-01',
    `analysis_view` int unsigned DEFAULT NULL,
    `node_selection` varchar(255) DEFAULT NULL,
    `source_selection` varchar(255) DEFAULT NULL,
    `language_selection` varchar(255) DEFAULT NULL,
    `units` int unsigned DEFAULT NULL,
    `targetgroup_selection` varchar(255) DEFAULT NULL,
    `tag_selection` varchar(255) DEFAULT NULL,
    `hotspots_selection` varchar(255) DEFAULT NULL,
    `searchstring` varchar(255) DEFAULT NULL,
    `sentiment` int unsigned DEFAULT NULL,
    `tagcloud_size` int unsigned DEFAULT NULL,
    `hotspot_size` int unsigned DEFAULT NULL,
    `time_range` int unsigned DEFAULT NULL,
    `id` int unsigned NOT NULL AUTO_INCREMENT,
    `restrict_to` varchar(255) DEFAULT NULL,
    `country_selection` text DEFAULT NULL,
    `black_list` varchar(255) DEFAULT NULL,
    `white_list` varchar(255) DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `unique name` (`user_id`,`name`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `user_group`;
  CREATE TABLE `user_group` (
    `user_id` int NOT NULL,
    `group_id` int NOT NULL,
    PRIMARY KEY (`user_id`,`group_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `user_rights`;
  CREATE TABLE `user_rights` (
    `user_id` int NOT NULL,
    `right_id` varchar(45) NOT NULL,
    `read` tinyint DEFAULT NULL,
    `write` tinyint DEFAULT NULL,
    PRIMARY KEY (`user_id`,`right_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `user_role`;
  CREATE TABLE `user_role` (
    `user_id` int NOT NULL,
    `role_id` int NOT NULL,
    PRIMARY KEY (`user_id`,`role_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `user_settings`;
  CREATE TABLE `user_settings` (
    `user_id` int NOT NULL,
    `context` varchar(40) NOT NULL,
    `key` varchar(150) NOT NULL,
    `value` text NOT NULL,
    PRIMARY KEY (`user_id`,`context`,`key`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `users`;
  CREATE TABLE `users` (
    `id` int NOT NULL AUTO_INCREMENT,
    `username` varchar(45) NOT NULL,
    `password` varchar(80) NOT NULL,
    `password_updated_at` date DEFAULT NULL,
    `firstname` varchar(100) NOT NULL,
    `lastname` varchar(100) NOT NULL,
    `email` varchar(255) NOT NULL,
    `comment` varchar(255) DEFAULT NULL,
    `language_id` int NOT NULL DEFAULT 0,
    `role_id` int NOT NULL DEFAULT 0,
    `group_id` int NOT NULL DEFAULT 0,
    `noiprestriction` tinyint unsigned DEFAULT 0,
    `temporary` tinyint NOT NULL DEFAULT 0,
    `invisible` tinyint NOT NULL DEFAULT 0 COMMENT 'if enabled, account will only be visible to root.',
    `creationDate` datetime NOT NULL DEFAULT '1970-01-01 00:00:00',
    `expires` date NOT NULL DEFAULT '1970-01-01',
    `default_view` int NOT NULL DEFAULT 0,
    `customer_id` int DEFAULT NULL,
    `created_by` int DEFAULT NULL,
    `external_user_id` varchar(45) DEFAULT NULL,
    `client_id` varchar(45) DEFAULT NULL,
    `external_password` varchar(45) DEFAULT NULL,
    `wt_alerting_interval` enum('no_alerting','immediately','daily','weekly','monthly') NOT NULL DEFAULT 'daily',
    `user_language_id` tinyint unsigned NOT NULL DEFAULT 0,
    `user_country_id` tinyint unsigned NOT NULL DEFAULT 0,
    `inactive` tinyint NOT NULL DEFAULT 0,
    `failed_login_attempts` tinyint NOT NULL DEFAULT 0,
    `last_login_at` date DEFAULT NULL,
    `account_unlock_hash` varchar(256) DEFAULT NULL,
    `time_zone_id` varchar(50) NOT NULL DEFAULT 'Europe/Berlin',
    `deleted` tinyint NOT NULL DEFAULT 0,
    `expiration_email_sent` tinyint NOT NULL DEFAULT 0,
    PRIMARY KEY (`id`),
    UNIQUE KEY `UniqueUser` (`username`),
    KEY `fk_role_id` (`role_id`),
    KEY `fk_group_id` (`group_id`),
    KEY `fk_language_id` (`language_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_alert_addresses`;
  CREATE TABLE `web_alert_addresses` (
    `alert_id` int NOT NULL,
    `addresses_id` varchar(255) DEFAULT NULL,
    `pos` int NOT NULL,
    PRIMARY KEY (`alert_id`,`pos`),
    KEY `FK_jk3elndhs23jb1ssayrbt95rs` (`alert_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_alerts`;
  CREATE TABLE `web_alerts` (
    `id` int NOT NULL AUTO_INCREMENT,
    `alert_id` int DEFAULT NULL,
    `comment` varchar(255) DEFAULT NULL,
    `name` varchar(255) DEFAULT NULL,
    `seen_date` datetime DEFAULT NULL,
    `sent_date` datetime DEFAULT NULL,
    `sentiment` int DEFAULT NULL,
    `timespan` int DEFAULT NULL,
    `user_id` int DEFAULT NULL,
    `volume` int DEFAULT NULL,
    `filter_id` bigint DEFAULT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `UK_p4vhrott3eb00ruwx5bx8w0kn` (`alert_id`),
    KEY `FK_ocndji27hgx9l8wlwu1pcrhe3` (`filter_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  
  DROP TABLE IF EXISTS `web_alerts_stream`;
  CREATE TABLE `web_alerts_stream` (
    `id` int NOT NULL AUTO_INCREMENT,
    `comment` varchar(255) DEFAULT NULL,
    `duplicate_mode` int NOT NULL,
    `interval_ms` bigint NOT NULL,
    `priority` tinyint unsigned NOT NULL DEFAULT 0,
    `last_alert` datetime DEFAULT NULL,
    `name` varchar(255) DEFAULT NULL,
    `user_id` int NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_alerts_stream_conds`;
  CREATE TABLE `web_alerts_stream_conds` (
    `discriminator` varchar(4) NOT NULL,
    `id` bigint NOT NULL AUTO_INCREMENT,
    `description` varchar(255) DEFAULT NULL,
    `value` varchar(255) DEFAULT NULL,
    `inverted` tinyint unsigned NOT NULL DEFAULT 0,
    `alert_stream_id` int DEFAULT NULL,
    `pos` int DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `FK8m0p8mpta3c2l1wu9v7f5hfrg` (`alert_stream_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_alerts_stream_config`;
  CREATE TABLE `web_alerts_stream_config` (
    `id` int NOT NULL AUTO_INCREMENT,
    `type` varchar(255) DEFAULT NULL,
    `alert_stream_id` int DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `FK5uoa6o4i9ucntbwm8g5haiyw` (`alert_stream_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_alerts_stream_config_params`;
  CREATE TABLE `web_alerts_stream_config_params` (
    `alert_config_id` int NOT NULL,
    `params` varchar(255) DEFAULT NULL,
    `params_key` varchar(100) NOT NULL,
    PRIMARY KEY (`alert_config_id`,`params_key`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_alerts_stream_incident`;
  CREATE TABLE `web_alerts_stream_incident` (
    `incident_id` varchar(36) NOT NULL,
    `stream_id` int NOT NULL,
    `serialized_incident` longblob DEFAULT NULL,
    `triggered_at` datetime DEFAULT NULL,
    PRIMARY KEY (`incident_id`,`stream_id`),
    KEY `stream_id_triggered_at` (`stream_id`,`triggered_at`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_archive_customer_configuration`;
  CREATE TABLE `web_archive_customer_configuration` (
    `id` int NOT NULL AUTO_INCREMENT,
    `creation_date` datetime DEFAULT NULL,
    `customer_id` int DEFAULT NULL,
    `finished_date` datetime DEFAULT NULL,
    `state` int DEFAULT NULL,
    `user_id` int DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  # DROP TABLE IF EXISTS TABLE `web_block_the_edit`;
  # CREATE TABLE `web_block_the_edit` (
  #   `id` bigint NOT NULL AUTO_INCREMENT,
  #   `type` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  #   `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  #   `creator_id` bigint DEFAULT NULL,
  #   `customer_id` int DEFAULT NULL,
  #   `document_guid` varchar(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  #   PRIMARY KEY (`id`)
  # ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
  
  DROP TABLE IF EXISTS `web_customer_export_template`;
  CREATE TABLE `web_customer_export_template` (
    `id` bigint NOT NULL AUTO_INCREMENT,
    `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
    `creator_id` bigint DEFAULT NULL,
    `description` varchar(255) DEFAULT NULL,
    `name` varchar(255) DEFAULT NULL,
    `posted_at` datetime DEFAULT NULL,
    `customer_id` int DEFAULT NULL,
    `template` longblob NOT NULL,
    `template_name` varchar(255) DEFAULT NULL,
    `type` varchar(255) DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_customer_image_upload`;
  CREATE TABLE `web_customer_image_upload` (
    `id` bigint NOT NULL AUTO_INCREMENT,
    `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
    `creator_id` bigint DEFAULT NULL,
    `description` varchar(255) DEFAULT NULL,
    `name` varchar(255) DEFAULT NULL,
    `posted_at` datetime DEFAULT NULL,
    `customer_id` int NOT NULL,
    `image` longblob DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_customer_mail_templates`;
  CREATE TABLE `web_customer_mail_templates` (
    `id` bigint NOT NULL AUTO_INCREMENT,
    `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
    `creator_id` bigint DEFAULT NULL,
    `description` varchar(255) DEFAULT NULL,
    `name` varchar(255) DEFAULT NULL,
    `posted_at` datetime DEFAULT NULL,
    `contents` longtext DEFAULT NULL,
    `customer_id` int NOT NULL,
    `locale_code` varchar(255) NOT NULL,
    `type` int NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_dashboards`;
  CREATE TABLE `web_dashboards` (
    `id` bigint NOT NULL AUTO_INCREMENT,
    `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
    `creator_id` bigint DEFAULT NULL,
    `description` varchar(255) DEFAULT NULL,
    `name` varchar(255) DEFAULT NULL,
    `posted_at` datetime DEFAULT NULL,
    `position` int DEFAULT NULL,
    `perspective_id` bigint DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `FK_rv3rl39evi906xi4x7lqow5gn` (`perspective_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_download_file`;
  CREATE TABLE `web_download_file` (
    `file_identifier` varchar(125) NOT NULL,
    `creation_at` timestamp NOT NULL DEFAULT current_timestamp(),
    `file_path` varchar(255) DEFAULT NULL,
    `last_downloaded_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`file_identifier`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_export_templates`;
  CREATE TABLE `web_export_templates` (
    `id` bigint NOT NULL AUTO_INCREMENT,
    `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
    `creator_id` bigint DEFAULT NULL,
    `description` varchar(255) DEFAULT NULL,
    `name` varchar(255) DEFAULT NULL,
    `posted_at` datetime DEFAULT NULL,
    `template` longblob NOT NULL,
    `title_id` bigint DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `FK_g05s3ucxbeor3nuqy85wkbe6a` (`title_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_export_templates_customer`;
  # InnoDB change: Added primary key
  CREATE TABLE `web_export_templates_customer` (
    `template_id` bigint NOT NULL,
    `customer_id` int NOT NULL,
    KEY `FK_df226qn8ks5vm5dumt4w4udoi` (`template_id`),
    PRIMARY KEY (`template_id`,`customer_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_export_templates_reports`;
  CREATE TABLE `web_export_templates_reports` (
    `template_id` bigint DEFAULT NULL,
    `report_id` bigint NOT NULL,
    PRIMARY KEY (`report_id`),
    KEY `FK_7viucrwq64gu0qhnrtvx4rfev` (`template_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_export_templates_text`;
  CREATE TABLE `web_export_templates_text` (
    `id` bigint NOT NULL AUTO_INCREMENT,
    `default_text` varchar(255) DEFAULT NULL,
    `identifier` varchar(255) DEFAULT NULL,
    `label` varchar(255) DEFAULT NULL,
    `max_length` int DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_export_templates_text_value`;
  CREATE TABLE `web_export_templates_text_value` (
    `id` bigint NOT NULL AUTO_INCREMENT,
    `value` varchar(255) DEFAULT NULL,
    `text_id` bigint DEFAULT NULL,
    `report_id` bigint DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `FK_77reriydhr901v13unt2pryau` (`text_id`),
    KEY `FK_l70f95cr5c1je27my7y625ie1` (`report_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_export_templates_texts`;
  CREATE TABLE `web_export_templates_texts` (
    `template_id` bigint NOT NULL,
    `text_id` bigint NOT NULL,
    PRIMARY KEY (`template_id`,`text_id`),
    UNIQUE KEY `UK_95nadde4fled9wl3gw3usa8n` (`text_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_export_templates_widgets`;
  CREATE TABLE `web_export_templates_widgets` (
    `template_id` bigint DEFAULT NULL,
    `widget_id` bigint DEFAULT NULL,
    `id` bigint NOT NULL AUTO_INCREMENT,
    `number_on_slide` int DEFAULT NULL,
    `slide` int NOT NULL,
    `title_id` bigint DEFAULT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `UK_4cpxdsw9bgv5e1i0t9uag1n1` (`widget_id`),
    KEY `FK_85wnuiiqdwgfevkh7yt07bhpu` (`title_id`),
    KEY `template_id` (`template_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_filter_attribute_type_ids`;
  CREATE TABLE `web_filter_attribute_type_ids` (
    `filter_id` bigint NOT NULL,
    `attribute_type_id` int DEFAULT NULL,
    `pos` int NOT NULL,
    PRIMARY KEY (`filter_id`,`pos`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_filter_authors`;
  CREATE TABLE `web_filter_authors` (
    `filter_id` bigint NOT NULL,
    `author_guid` varchar(255) DEFAULT NULL,
    `pos` int NOT NULL,
    PRIMARY KEY (`filter_id`,`pos`),
    KEY `FK_7tbrdga27ergv073s9jvhv9cj` (`filter_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_filter_black_lists`;
  CREATE TABLE `web_filter_black_lists` (
    `filter_id` bigint NOT NULL,
    `list_id` int DEFAULT NULL,
    `pos` int NOT NULL,
    PRIMARY KEY (`filter_id`,`pos`),
    KEY `FK_kbbtnu9txy7uw7i8spo6qmgtv` (`filter_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_filter_countries`;
  CREATE TABLE `web_filter_countries` (
    `filter_id` bigint NOT NULL,
    `country_id` int DEFAULT NULL,
    `pos` int NOT NULL,
    PRIMARY KEY (`filter_id`,`pos`),
    KEY `FK_k190kisashhgd2ttn7g0xx7kd` (`filter_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_filter_crossed_topics`;
  CREATE TABLE `web_filter_crossed_topics` (
    `filter_id` bigint NOT NULL,
    `node_id` int DEFAULT NULL,
    `pos` int NOT NULL,
    PRIMARY KEY (`filter_id`,`pos`),
    KEY `FK_mjvauwbx1t2uapkx1jkw7su65` (`filter_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_filter_doc_types`;
  CREATE TABLE `web_filter_doc_types` (
    `filter_id` bigint NOT NULL,
    `docType_id` int DEFAULT NULL,
    `pos` int NOT NULL,
    PRIMARY KEY (`filter_id`,`pos`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_filter_genders`;
  CREATE TABLE `web_filter_genders` (
    `filter_id` bigint NOT NULL,
    `gender_id` int DEFAULT NULL,
    `pos` int NOT NULL,
    PRIMARY KEY (`filter_id`,`pos`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_filter_languages`;
  CREATE TABLE `web_filter_languages` (
    `filter_id` bigint NOT NULL,
    `language_id` int DEFAULT NULL,
    `pos` int NOT NULL,
    PRIMARY KEY (`filter_id`,`pos`),
    KEY `FK_f9mkaq7f52xg1ql60pm76ymnn` (`filter_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_filter_market_price_classes`;
  CREATE TABLE `web_filter_market_price_classes` (
    `filter_id` bigint NOT NULL,
    `price_class_id` int DEFAULT NULL,
    `pos` int NOT NULL,
    PRIMARY KEY (`filter_id`,`pos`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_filter_named_entities`;
  CREATE TABLE `web_filter_named_entities` (
    `filter_id` bigint NOT NULL,
    `named_entity_id` varchar(255) DEFAULT NULL,
    `pos` int NOT NULL,
    PRIMARY KEY (`filter_id`,`pos`),
    KEY `FK_1r50ukll4xdeoij5dr4yfipxd` (`filter_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_filter_nodes`;
  CREATE TABLE `web_filter_nodes` (
    `filter_id` bigint NOT NULL,
    `node_id` int DEFAULT NULL,
    `pos` int NOT NULL,
    PRIMARY KEY (`filter_id`,`pos`),
    KEY `FK_afrlfiui2kute4w50ifa8iuyn` (`filter_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_filter_post_comment_state`;
  CREATE TABLE `web_filter_post_comment_state` (
    `filter_id` bigint NOT NULL,
    `post_comment_state` varchar(256) NOT NULL DEFAULT '',
    `pos` int NOT NULL DEFAULT 0,
    PRIMARY KEY (`filter_id`,`pos`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_filter_product`;
  CREATE TABLE `web_filter_product` (
    `filter_id` bigint NOT NULL,
    `product_id` varchar(36) DEFAULT NULL,
    `pos` int NOT NULL,
    PRIMARY KEY (`filter_id`,`pos`),
    KEY `FK_qvbryt0tr40gvs7cysth6vy7c` (`filter_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_filter_product_category_ids`;
  CREATE TABLE `web_filter_product_category_ids` (
    `filter_id` bigint NOT NULL,
    `category_id` int DEFAULT NULL,
    `hierachy_id` int DEFAULT NULL,
    `pos` int NOT NULL,
    PRIMARY KEY (`filter_id`,`pos`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_filter_ratings`;
  CREATE TABLE `web_filter_ratings` (
    `filter_id` bigint NOT NULL,
    `rating_id` double DEFAULT NULL,
    `pos` int NOT NULL,
    PRIMARY KEY (`filter_id`,`pos`),
    KEY `FK_9d0mhx04hhij8rylu5jv1s5wf` (`filter_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_filter_sentiments`;
  CREATE TABLE `web_filter_sentiments` (
    `filter_id` bigint NOT NULL,
    `sentiment_id` int DEFAULT NULL,
    `pos` int NOT NULL,
    PRIMARY KEY (`filter_id`,`pos`),
    KEY `FK_q6iv3olweequ4uul7c46o16it` (`filter_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_filter_sort_field`;
  CREATE TABLE `web_filter_sort_field` (
    `filter_id` bigint NOT NULL,
    `sort_field` varchar(255) DEFAULT NULL,
    `pos` int NOT NULL,
    PRIMARY KEY (`filter_id`,`pos`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_filter_sort_fields`;
  CREATE TABLE `web_filter_sort_fields` (
    `filter_id` bigint NOT NULL,
    `sort_param_id` int DEFAULT NULL,
    `pos` int NOT NULL,
    PRIMARY KEY (`filter_id`,`pos`),
    KEY `FK_1jx47ewaorxfs9wjsnk2tsvmt` (`filter_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_filter_source_types`;
  CREATE TABLE `web_filter_source_types` (
    `filter_id` bigint NOT NULL,
    `source_id` int DEFAULT NULL,
    `pos` int NOT NULL,
    PRIMARY KEY (`filter_id`,`pos`),
    KEY `FK_bd44duosn9y9lm946dgjiu4nv` (`filter_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_filter_sources`;
  CREATE TABLE `web_filter_sources` (
    `filter_id` bigint NOT NULL,
    `source_guid` varchar(255) DEFAULT NULL,
    `pos` int NOT NULL,
    PRIMARY KEY (`filter_id`,`pos`),
    KEY `FK_qcg0ak6y3m6h0gb9fdd157e72` (`filter_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_filter_tags`;
  CREATE TABLE `web_filter_tags` (
    `filter_id` bigint NOT NULL,
    `tag` varchar(255) DEFAULT NULL,
    `pos` int NOT NULL,
    PRIMARY KEY (`filter_id`,`pos`),
    KEY `FK_td2et85u5ddwh874v0u5dnxd5` (`filter_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_filter_white_lists`;
  CREATE TABLE `web_filter_white_lists` (
    `filter_id` bigint NOT NULL,
    `list_id` int DEFAULT NULL,
    `pos` int NOT NULL,
    PRIMARY KEY (`filter_id`,`pos`),
    KEY `FK_28ji5t5kyl77tb5tatkr1kr47` (`filter_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_filters`;
  CREATE TABLE `web_filters` (
    `id` bigint NOT NULL AUTO_INCREMENT,
    `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
    `creator_id` bigint DEFAULT NULL,
    `description` varchar(255) DEFAULT NULL,
    `name` varchar(255) DEFAULT NULL,
    `posted_at` datetime DEFAULT NULL,
    `content_length_from` int DEFAULT NULL,
    `content_length_to` int DEFAULT NULL,
    `date_field` varchar(255) DEFAULT NULL,
    `date_offset_amount` int DEFAULT NULL,
    `date_offset_part` varchar(255) DEFAULT NULL,
    `date_range_amount` int DEFAULT NULL,
    `date_range_part` varchar(255) DEFAULT NULL,
    `dopaEntityType` int DEFAULT NULL,
    `end` datetime DEFAULT NULL,
    `follower_count_from` bigint DEFAULT NULL,
    `follower_count_to` bigint DEFAULT NULL,
    `important_status` int DEFAULT NULL,
    `is_comment` tinyint DEFAULT NULL,
    `is_shared` tinyint DEFAULT NULL,
    `likes_count_from` int DEFAULT NULL,
    `likes_count_to` int DEFAULT NULL,
    `comments_count_from` int DEFAULT NULL,
    `comments_count_to` int DEFAULT NULL,
    `offset` int DEFAULT NULL,
    `post_count_from` bigint DEFAULT NULL,
    `post_count_to` bigint DEFAULT NULL,
    `read_status` int DEFAULT NULL,
    `relevant` int DEFAULT NULL,
    `search_string` text DEFAULT NULL,
    `sentiment_type` int DEFAULT NULL,
    `shared_count_from` int DEFAULT NULL,
    `shared_count_to` int DEFAULT NULL,
    `size` int DEFAULT NULL,
    `sort_field` int DEFAULT NULL,
    `sort_order` int DEFAULT NULL,
    `start` datetime DEFAULT NULL,
    `tagCloudTrendType` varchar(255) DEFAULT NULL,
    `tag_cloud` int DEFAULT NULL,
    `unit_id` int DEFAULT NULL,
    `view_count_from` bigint DEFAULT NULL,
    `view_count_to` bigint DEFAULT NULL,
    `eventUri` bigint DEFAULT NULL,
    `attributes` longtext DEFAULT NULL,
    `min_reviews_count` int DEFAULT NULL,
    `breakdownSize` int DEFAULT NULL,
    `lat_lower_left` double DEFAULT NULL,
    `lat_upper_right` double DEFAULT NULL,
    `lon_lower_left` double DEFAULT NULL,
    `lon_upper_right` double DEFAULT NULL,
    `sample_date` bigint DEFAULT NULL,
    `sample_size` int DEFAULT NULL,
    `post_comment_state` int DEFAULT NULL,
    `post_comment_state_custom` varchar(256) DEFAULT NULL,
    `has_post_comment` tinyint DEFAULT NULL,
    `include_related_data` tinyint NOT NULL DEFAULT 0,
    `show_all` tinyint NOT NULL DEFAULT 0,
    `product_rating_from` double DEFAULT NULL,
    `product_rating_to` double DEFAULT NULL,
    `apply_to_life_time_rating` tinyint NOT NULL DEFAULT 0,
    `asin` varchar(255) DEFAULT NULL,
    `ean` varchar(255) DEFAULT NULL,
    `customFields` longtext DEFAULT NULL,
    `negative_filter_id` bigint DEFAULT NULL,
    `filter_role_id` bigint DEFAULT NULL,
    `role_filter_type` int DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `fk_web_filters_negative_filter_id` (`negative_filter_id`),
    CONSTRAINT `fk_web_filters_negative_filter_id` FOREIGN KEY (`negative_filter_id`) REFERENCES `web_filters` (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_flags`;
  CREATE TABLE `web_flags` (
    `id` bigint NOT NULL AUTO_INCREMENT,
    `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
    `creator_id` bigint DEFAULT NULL,
    `description` varchar(255) DEFAULT NULL,
    `name` varchar(255) DEFAULT NULL,
    `posted_at` datetime DEFAULT NULL,
    `flag_series_id` bigint NOT NULL,
    `is_shared` tinyint NOT NULL,
    `text` varchar(255) DEFAULT NULL,
    `title` varchar(255) DEFAULT NULL,
    `x` varchar(255) DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_flagseries`;
  CREATE TABLE `web_flagseries` (
    `id` bigint NOT NULL AUTO_INCREMENT,
    `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
    `creator_id` bigint DEFAULT NULL,
    `description` varchar(255) DEFAULT NULL,
    `name` varchar(255) DEFAULT NULL,
    `posted_at` datetime DEFAULT NULL,
    `series_id` int DEFAULT NULL,
    `filter_id` bigint DEFAULT NULL,
    `settings_id` bigint DEFAULT NULL,
    `is_shared` bit(1) NOT NULL,
    `text` varchar(255) DEFAULT NULL,
    `title` varchar(255) DEFAULT NULL,
    `x` varchar(255) DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `FK_5d9jsa6mdb3hi5nnoqiob1k6n` (`filter_id`),
    KEY `FK_r07puuf550m2mdiepwudfehfn` (`settings_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_health_taskinfo`;
  CREATE TABLE `web_health_taskinfo` (
    `id` bigint NOT NULL AUTO_INCREMENT,
    `customer_id` int DEFAULT NULL,
    `elapsed_ms` bigint DEFAULT NULL,
    `now` datetime DEFAULT NULL,
    `stacktrace` longtext DEFAULT NULL,
    `start` datetime DEFAULT NULL,
    `state` varchar(255) DEFAULT NULL,
    `task_class` varchar(255) DEFAULT NULL,
    `task_info` longtext DEFAULT NULL,
    `user_id` int DEFAULT NULL,
    `uuid` varchar(36) DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `uuid` (`uuid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_kpi_customer_configuration`;
  CREATE TABLE `web_kpi_customer_configuration` (
    `id` int NOT NULL AUTO_INCREMENT,
    `creation_date` datetime DEFAULT NULL,
    `current_version` int DEFAULT NULL,
    `customer_id` int DEFAULT NULL,
    `last_finished_date` datetime DEFAULT NULL,
    `last_start_date` datetime DEFAULT NULL,
    `project_id` int DEFAULT NULL,
    `schema_class` varchar(255) DEFAULT NULL,
    `shop_id` int DEFAULT NULL,
    `shop_url` varchar(255) DEFAULT NULL,
    `state` enum('MODIFIED','RUNNING','ERROR','SUCCESS','DISABLED') DEFAULT NULL,
    `strict_kpis` tinyint DEFAULT 1,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_label_nodes`;
  CREATE TABLE `web_label_nodes` (
    `label_id` bigint NOT NULL,
    `node_id` int DEFAULT NULL,
    `pos` int NOT NULL,
    PRIMARY KEY (`label_id`,`pos`),
    KEY `FK_t9dgy6ieo9ycy9uetnqadrivx` (`label_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_label_perspectives`;
  CREATE TABLE `web_label_perspectives` (
    `label_id` bigint NOT NULL,
    `perspective_id` bigint DEFAULT NULL,
    `pos` int NOT NULL,
    PRIMARY KEY (`label_id`,`pos`),
    KEY `FK_qe3640t7w66ywe54gurpemwe8` (`label_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_labels`;
  CREATE TABLE `web_labels` (
    `id` bigint NOT NULL AUTO_INCREMENT,
    `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
    `creator_id` bigint DEFAULT NULL,
    `description` varchar(255) DEFAULT NULL,
    `name` varchar(255) DEFAULT NULL,
    `posted_at` datetime DEFAULT NULL,
    `customer_id` int DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  
  DROP TABLE IF EXISTS `web_perspectives`;
  CREATE TABLE `web_perspectives` (
    `id` bigint NOT NULL AUTO_INCREMENT,
    `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
    `creator_id` bigint DEFAULT NULL,
    `description` varchar(255) DEFAULT NULL,
    `name` varchar(255) DEFAULT NULL,
    `posted_at` datetime DEFAULT NULL,
    `customer_id` int DEFAULT NULL,
    `is_global_template` tinyint NOT NULL DEFAULT 0,
    `is_accessible_by_link` tinyint DEFAULT 0,
    `is_default` tinyint DEFAULT 0,
    `selected_dashboard_index` int DEFAULT NULL,
    `is_new_date` timestamp NULL DEFAULT NULL,
    `is_template` tinyint DEFAULT NULL,
    `filter_id` bigint DEFAULT NULL,
    `project_id` bigint DEFAULT NULL,
    `made_default_at` datetime DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `FK_kunc8ulh6hquldle1wl5n40hf` (`filter_id`),
    KEY `FK_hmdqcx5frpt2lsxikuf5wu8mb` (`project_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_projects`;
  CREATE TABLE `web_projects` (
    `id` bigint NOT NULL AUTO_INCREMENT,
    `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
    `creator_id` bigint DEFAULT NULL,
    `description` varchar(255) DEFAULT NULL,
    `name` varchar(255) DEFAULT NULL,
    `posted_at` datetime DEFAULT NULL,
    `customer_id` int DEFAULT NULL,
    `hide` tinyint DEFAULT NULL,
    `node_id` int DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_reply_templates`;
  CREATE TABLE `web_reply_templates` (
    `id` bigint unsigned NOT NULL AUTO_INCREMENT,
    `customer_id` int unsigned NOT NULL,
    `title` varchar(255) NOT NULL DEFAULT '',
    `content` text NOT NULL,
    `creation_date` datetime NOT NULL,
    `creation_user_id` int NOT NULL,
    `update_date` datetime NOT NULL,
    `update_user_id` int NOT NULL,
    PRIMARY KEY (`id`),
    KEY `customer_id` (`customer_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_reports`;
  CREATE TABLE `web_reports` (
    `id` bigint NOT NULL AUTO_INCREMENT,
    `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
    `creator_id` bigint DEFAULT NULL,
    `description` varchar(255) DEFAULT NULL,
    `name` varchar(255) DEFAULT NULL,
    `posted_at` datetime DEFAULT NULL,
    `customer_id` int DEFAULT NULL,
    `doc_list_include_in_email` tinyint DEFAULT NULL,
    `doc_list_translate_lang` varchar(10) DEFAULT NULL,
    `period` int NOT NULL,
    `period_type` varchar(255) DEFAULT NULL,
    `real_sent_date` datetime DEFAULT NULL,
    `running` tinyint NOT NULL,
    `sent_date` datetime DEFAULT NULL,
    `start_date` datetime DEFAULT NULL,
    `dashboard_id` bigint DEFAULT NULL,
    `filter_id` bigint DEFAULT NULL,
    `widget_id` bigint DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `FK_1q8fdlsnjrokpp41rds8ccrkn` (`dashboard_id`),
    KEY `FK_7clyen47i5vtds3iot5nusfsd` (`filter_id`),
    KEY `FK_aacjujuathr7r5ofkt5hs5ocs` (`widget_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_reports_addresses`;
  CREATE TABLE `web_reports_addresses` (
    `report_id` bigint NOT NULL,
    `address` varchar(255) DEFAULT NULL,
    `pos` int NOT NULL,
    PRIMARY KEY (`report_id`,`pos`),
    KEY `FK_9l27d4xd96xtqekdgydt1nrfj` (`report_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_reports_formats`;
  CREATE TABLE `web_reports_formats` (
    `report_id` bigint NOT NULL,
    `format` varchar(255) DEFAULT NULL,
    `pos` int NOT NULL,
    PRIMARY KEY (`report_id`,`pos`),
    KEY `FK_66dhojw22r6gypjla5t1ht19c` (`report_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_reports_widgets_filters`;
  CREATE TABLE `web_reports_widgets_filters` (
    `filter_id` bigint NOT NULL,
    `report_id` bigint NOT NULL,
    `widget_id` bigint NOT NULL,
    UNIQUE KEY `UK_hpxwpowq4sb6vcts7a6f33vb5` (`filter_id`),
    KEY `FK_h3m1b8qchcjvbl8sm4odujd1` (`report_id`),
    KEY `FK_aqahpthl5hd0gavm77jy5h46h` (`widget_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_shared_perspectives`;
  CREATE TABLE `web_shared_perspectives` (
    `id` bigint NOT NULL AUTO_INCREMENT,
    `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
    `creator_id` bigint DEFAULT NULL,
    `description` varchar(255) DEFAULT NULL,
    `name` varchar(255) DEFAULT NULL,
    `posted_at` datetime DEFAULT NULL,
    `group_id` bigint DEFAULT NULL,
    `permission` int DEFAULT NULL,
    `user_id` bigint DEFAULT NULL,
    `perspective_id` bigint DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `FK_oo7x8x69g5x1adbrf3qoo7gsm` (`perspective_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_social_media_channel_token`;
  CREATE TABLE `web_social_media_channel_token` (
    `id` int NOT NULL AUTO_INCREMENT,
    `token` varchar(255) DEFAULT NULL,
    `update_date` timestamp NULL DEFAULT NULL,
    `external_user_id` varchar(50) DEFAULT NULL,
    `granted_scopes` varchar(255) DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_social_media_user_token`;
  CREATE TABLE `web_social_media_user_token` (
    `id` int NOT NULL AUTO_INCREMENT,
    `customer_id` int NOT NULL,
    `token` varchar(255) DEFAULT NULL,
    `update_date` timestamp NULL DEFAULT NULL,
    `update_user_id` int DEFAULT NULL,
    `external_user_name` varchar(150) DEFAULT NULL,
    `external_user_id` varchar(50) DEFAULT NULL,
    `granted_scopes` varchar(255) DEFAULT NULL,
    `source_guid` char(36) NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_themes`;
  CREATE TABLE `web_themes` (
    `id` bigint NOT NULL AUTO_INCREMENT,
    `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
    `creator_id` bigint DEFAULT NULL,
    `description` varchar(255) DEFAULT NULL,
    `name` varchar(255) DEFAULT NULL,
    `posted_at` datetime DEFAULT NULL,
    `chart_colors` varchar(500) NOT NULL,
    `customer_id` int DEFAULT NULL,
    `dark_complement_color` varchar(7) DEFAULT NULL,
    `header_color` varchar(7) DEFAULT NULL,
    `header_font_color` varchar(7) DEFAULT NULL,
    `header_font_size` int DEFAULT NULL,
    `light_complement_color` varchar(7) DEFAULT NULL,
    `primary_main_color` varchar(7) DEFAULT NULL,
    `secondary_main_color` varchar(7) DEFAULT NULL,
    `is_template` tinyint DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_user_annotation_context`;
  CREATE TABLE `web_user_annotation_context` (
    `id` bigint NOT NULL AUTO_INCREMENT,
    `type` int DEFAULT NULL,
    `value` varchar(60) DEFAULT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `UK_bmcigqxjs9fxhlpcjx1m755qg` (`type`,`value`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_user_annotation_entry`;
  CREATE TABLE `web_user_annotation_entry` (
    `id` bigint NOT NULL AUTO_INCREMENT,
    `document_guid` varchar(40) NOT NULL,
    `important` tinyint DEFAULT NULL,
    `irrelevant` tinyint DEFAULT NULL,
    `language_id` int NOT NULL,
    `docRead` tinyint DEFAULT NULL,
    `sentiment` int DEFAULT NULL,
    `topic` tinyint DEFAULT NULL,
    `country_id` int DEFAULT NULL,
    `updated_at` datetime DEFAULT NULL,
    `updater_id` bigint NOT NULL,
    `contextEntry_id` bigint DEFAULT NULL,
    `updater_customer_id` int DEFAULT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `UK_c2800uyt8ee5be50idukdkv1g` (`document_guid`,`contextEntry_id`),
    KEY `FK_a19kvykvtcbh3bw2jtgw9kjov` (`contextEntry_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_user_project`;
  CREATE TABLE `web_user_project` (
    `id` bigint NOT NULL AUTO_INCREMENT,
    `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
    `creator_id` bigint DEFAULT NULL,
    `description` varchar(255) DEFAULT NULL,
    `name` varchar(255) DEFAULT NULL,
    `posted_at` datetime DEFAULT NULL,
    `project_id` bigint DEFAULT NULL,
    `user_id` int NOT NULL,
    `customer_id` int DEFAULT NULL,
    `perspective_id` bigint DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `fk_web_user_project_perspective_id` (`perspective_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  
  DROP TABLE IF EXISTS `web_webdashboard_containers`;
  CREATE TABLE `web_webdashboard_containers` (
    `webdashboard_id` bigint NOT NULL,
    `value` mediumtext DEFAULT NULL,
    `name` varchar(50) NOT NULL,
    PRIMARY KEY (`webdashboard_id`,`name`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_webdashboard_links`;
  CREATE TABLE `web_webdashboard_links` (
    `id` bigint NOT NULL AUTO_INCREMENT,
    `dashboard_id` bigint DEFAULT NULL,
    `perspective_id` bigint DEFAULT NULL,
    `title` varchar(255) DEFAULT NULL,
    PRIMARY KEY (`id`) USING BTREE
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_webdashboard_webdashboard_links`;
  CREATE TABLE `web_webdashboard_webdashboard_links` (
    `webdashboard_id` bigint NOT NULL,
    `webdashboard_link_id` bigint NOT NULL,
    `pos` int NOT NULL,
    PRIMARY KEY (`webdashboard_id`,`pos`),
    UNIQUE KEY `UK_76mpuo9whls9h4g96oyi7wgbd` (`webdashboard_link_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_webdashboards`;
  CREATE TABLE `web_webdashboards` (
    `id` bigint NOT NULL AUTO_INCREMENT,
    `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
    `customer_id` int DEFAULT NULL,
    `name` varchar(255) DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_webpage_entry`;
  CREATE TABLE `web_webpage_entry` (
    `id` bigint NOT NULL AUTO_INCREMENT,
    `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
    `customer_id` int DEFAULT NULL,
    `failed_reason` text DEFAULT NULL,
    `failed_requests` tinyint DEFAULT NULL,
    `hash` char(32) DEFAULT NULL,
    `last_checked` timestamp NOT NULL DEFAULT '1970-01-02 00:00:00',
    `state` enum('NEW','FAILED','SUCCESS') NOT NULL DEFAULT 'NEW',
    `token_name` varchar(32) DEFAULT NULL,
    `url` text NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `UK_kside0ny7k00xebg0xis5sxwq` (`hash`),
    KEY `hash_index` (`hash`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_widget_color_settings`;
  CREATE TABLE `web_widget_color_settings` (
    `id` bigint NOT NULL AUTO_INCREMENT,
    `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
    `creator_id` bigint DEFAULT NULL,
    `description` varchar(255) DEFAULT NULL,
    `name` varchar(255) DEFAULT NULL,
    `posted_at` datetime DEFAULT NULL,
    `colors` varchar(255) DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_widget_settings`;
  CREATE TABLE `web_widget_settings` (
    `id` bigint NOT NULL AUTO_INCREMENT,
    `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
    `creator_id` bigint DEFAULT NULL,
    `description` varchar(255) DEFAULT NULL,
    `name` varchar(255) DEFAULT NULL,
    `posted_at` datetime DEFAULT NULL,
    `aggregation_type` int DEFAULT NULL,
    `alternative_image` longblob DEFAULT NULL,
    `breakdown` varchar(255) DEFAULT NULL,
    `breakdown_right` varchar(255) DEFAULT NULL,
    `feed_based_export` tinyint DEFAULT NULL,
    `notes_visible` tinyint DEFAULT NULL,
    `polar` tinyint DEFAULT NULL,
    `posts_per_page` int DEFAULT NULL,
    `stacking` varchar(255) DEFAULT NULL,
    `trend_aggregation_type` int DEFAULT NULL,
    `type` varchar(255) DEFAULT NULL,
    `update_interval` int DEFAULT NULL,
    `x_axis` varchar(255) DEFAULT NULL,
    `y_axis` varchar(255) DEFAULT NULL,
    `y_axis_right` varchar(255) DEFAULT NULL,
    `colorSettings_id` bigint DEFAULT NULL,
    `widget_logo` mediumblob DEFAULT NULL,
    `visualization` varchar(255) DEFAULT NULL,
    `custom_columns_export` bit(1) DEFAULT NULL,
    `x_axis_max` int DEFAULT NULL,
    `y_axis_interval` varchar(255) DEFAULT NULL,
    `y_axis_interval_right` varchar(255) DEFAULT NULL,
    `y_axis_max` varchar(255) DEFAULT NULL,
    `y_axis_max_right` varchar(255) DEFAULT NULL,
    `y_axis_min` varchar(255) DEFAULT NULL,
    `y_axis_min_right` varchar(255) DEFAULT NULL,
    `social_metric_id` int DEFAULT NULL,
    `include_related_data` tinyint NOT NULL DEFAULT 0,
    `video_url` varchar(2083) DEFAULT NULL,
    `autoplay` tinyint NOT NULL DEFAULT 0,
    `mute` tinyint NOT NULL DEFAULT 0,
    `loop_video` tinyint NOT NULL DEFAULT 0,
    `showOnlyAttributesFromFilter` tinyint NOT NULL DEFAULT 0,
    `resolveProductCategoriesToLeaves` tinyint NOT NULL DEFAULT 0,
    `attributeValueType` varchar(256) DEFAULT NULL,
    `show_all` tinyint NOT NULL DEFAULT 0,
    `chart_widget_sorting_option` enum('Y_AXIS_LEFT_ASC','Y_AXIS_LEFT_DESC','Y_AXIS_RIGHT_ASC','Y_AXIS_RIGHT_DESC','X_AXIS_ASC','X_AXIS_DESC') DEFAULT NULL,
    `remove_zero_categories` tinyint DEFAULT 0,
    `sound` tinyint NOT NULL DEFAULT 0,
    `tag_cloud_target_lang` varchar(2) DEFAULT NULL,
    `data_label_option` enum('NONE','PERCENTAGE','ABSOLUTE') DEFAULT 'NONE',
    `legacy_export` tinyint DEFAULT NULL,
    `y_axis_threshold` double DEFAULT NULL,
    `y_axis_threshold_right` double DEFAULT NULL,
    `resolve_depth` tinyint NOT NULL DEFAULT 0,
    PRIMARY KEY (`id`),
    KEY `FK_1luqlq97o927tn6hv4aqpnhut` (`colorSettings_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_widget_settings_post_columns`;
  CREATE TABLE `web_widget_settings_post_columns` (
    `settings_id` bigint NOT NULL,
    `post_column` int DEFAULT NULL,
    `pos` int NOT NULL,
    PRIMARY KEY (`settings_id`,`pos`),
    KEY `FK_kubqs1mfd3aubxry8s4oylo8h` (`settings_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_widget_settings_visible_columns`;
  CREATE TABLE `web_widget_settings_visible_columns` (
    `settings_id` bigint NOT NULL,
    `visible_column` varchar(255) DEFAULT NULL,
    `pos` int NOT NULL,
    PRIMARY KEY (`settings_id`,`pos`),
    KEY `FK_8ptimqcsec0yexr0txl2etxj0` (`settings_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_widget_template_categories`;
  CREATE TABLE `web_widget_template_categories` (
    `id` bigint NOT NULL AUTO_INCREMENT,
    `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
    `creator_id` bigint DEFAULT NULL,
    `description` varchar(255) DEFAULT NULL,
    `name` varchar(255) DEFAULT NULL,
    `posted_at` datetime DEFAULT NULL,
    `iconName` varchar(255) DEFAULT NULL,
    `is_active` tinyint NOT NULL DEFAULT 1,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_widget_template_categories_widgets`;
  CREATE TABLE `web_widget_template_categories_widgets` (
    `widget_template_category_id` bigint NOT NULL,
    `widget_id` bigint NOT NULL,
    `pos` int NOT NULL,
    PRIMARY KEY (`widget_template_category_id`,`pos`),
    UNIQUE KEY `unique_ids` (`widget_template_category_id`,`widget_id`),
    KEY `FK_j1mksd6uwr5hh3gw8kuktf494` (`widget_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_widget_views`;
  CREATE TABLE `web_widget_views` (
    `id` bigint NOT NULL AUTO_INCREMENT,
    `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
    `creator_id` bigint DEFAULT NULL,
    `description` varchar(255) DEFAULT NULL,
    `name` varchar(255) DEFAULT NULL,
    `posted_at` datetime DEFAULT NULL,
    `end_point` varchar(255) DEFAULT NULL,
    `export_template` varchar(255) DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `web_widgets`;
  CREATE TABLE `web_widgets` (
    `id` bigint NOT NULL AUTO_INCREMENT,
    `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
    `creator_id` bigint DEFAULT NULL,
    `description` varchar(255) DEFAULT NULL,
    `name` varchar(255) DEFAULT NULL,
    `posted_at` datetime DEFAULT NULL,
    `grid_column` int DEFAULT NULL,
    `custom_url` varchar(255) DEFAULT NULL,
    `customer_id` int DEFAULT NULL,
    `order_number` int DEFAULT NULL,
    `grid_row` int DEFAULT NULL,
    `size_x` int DEFAULT NULL,
    `size_y` int DEFAULT NULL,
    `is_template` tinyint DEFAULT NULL,
    `text` text DEFAULT NULL,
    `category_id` bigint DEFAULT NULL,
    `dashboard_id` bigint DEFAULT NULL,
    `filter_id` bigint DEFAULT NULL,
    `widget_settings_id` bigint DEFAULT NULL,
    `widget_view_id` bigint DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `FK_5pj0t64qvtf5lxd5gtsxrk7o` (`category_id`),
    KEY `FK_fe11vr86ybchdtq3dpm5u19yd` (`dashboard_id`),
    KEY `FK_au6vqn9yt63dni8cpk7k0bstj` (`filter_id`),
    KEY `FK_dg3u1i17ikuj9lcq1a3mvssln` (`widget_settings_id`),
    KEY `FK_dfsxja2r7g0au7ubq48ux43wc` (`widget_view_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  
  DROP TABLE IF EXISTS `webpage_tracking_alerting`;
  CREATE TABLE `webpage_tracking_alerting` (
    `webpage_id` int unsigned NOT NULL,
    `permission_id` int unsigned NOT NULL,
    `permission_type` enum('user','group','role') NOT NULL,
    `alert_interval` enum('immediately','daily','weekly','monthly') NOT NULL DEFAULT 'daily',
    UNIQUE KEY `webpage_id_permission_id_permission_type` (`webpage_id`,`permission_id`,`permission_type`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `webpage_tracking_category`;
  CREATE TABLE `webpage_tracking_category` (
    `id` int unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(255) NOT NULL,
    `creation_user_id` int DEFAULT NULL,
    `creation_date` timestamp NOT NULL DEFAULT current_timestamp(),
    `customer_id` int NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `name_customer_id` (`name`,`customer_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `webpage_tracking_localization`;
  CREATE TABLE `webpage_tracking_localization` (
    `name` varchar(255) NOT NULL,
    `value` mediumtext NOT NULL,
    UNIQUE KEY `name` (`name`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `webpage_tracking_mailing`;
  # InnoDB change: Added primary key
  CREATE TABLE `webpage_tracking_mailing` (
    `webpage_id` int unsigned NOT NULL,
    `version` int unsigned NOT NULL,
    `user_id` int unsigned NOT NULL,
    `date` datetime DEFAULT NULL,
    `sent` datetime DEFAULT NULL,
    `alerting_interval` enum('immediately','daily','weekly','monthly') NOT NULL DEFAULT 'immediately',
    PRIMARY KEY (`webpage_id`,`version`,`user_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `webpage_tracking_permission`;
  CREATE TABLE `webpage_tracking_permission` (
    `webpage_id` int unsigned NOT NULL,
    `permission_id` int unsigned NOT NULL,
    `permission_type` enum('user','group','role','customer') NOT NULL,
    UNIQUE KEY `webpage_id_group_id_permission_type` (`webpage_id`,`permission_id`,`permission_type`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `webpage_tracking_request`;
  CREATE TABLE `webpage_tracking_request` (
    `webpage_id` int unsigned NOT NULL,
    `day` date NOT NULL,
    `requests` int unsigned NOT NULL,
    UNIQUE KEY `webpage_id_day` (`webpage_id`,`day`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `webpage_tracking_topic`;
  CREATE TABLE `webpage_tracking_topic` (
    `id` int unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(255) NOT NULL,
    `creation_user_id` int DEFAULT NULL,
    `creation_date` timestamp NOT NULL DEFAULT current_timestamp(),
    `customer_id` int NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `name` (`name`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `webpage_tracking_webpage`;
  CREATE TABLE `webpage_tracking_webpage` (
    `id` int unsigned NOT NULL AUTO_INCREMENT,
    `url` text NOT NULL,
    `title` text DEFAULT NULL,
    `language_id` tinyint unsigned NOT NULL,
    `category_id` int unsigned NOT NULL,
    `topic_id` int unsigned NOT NULL DEFAULT 0,
    `comment` text DEFAULT NULL,
    `active` tinyint unsigned NOT NULL DEFAULT 1,
    `top_site` tinyint unsigned NOT NULL DEFAULT 0,
    `alerting` tinyint unsigned NOT NULL DEFAULT 0,
    `update_interval_s` int unsigned NOT NULL DEFAULT 3600,
    `lastchecked` datetime NOT NULL DEFAULT '1970-01-01 00:00:00',
    `failed_requests` int unsigned NOT NULL DEFAULT 0,
    `failure_reason` text DEFAULT NULL,
    `custom_title` varchar(255) DEFAULT NULL,
    `encoding` enum('UTF-8','ISO-8859-1','windows-1251') DEFAULT NULL,
    `creation_user_id` int DEFAULT NULL,
    `creation_date` timestamp NOT NULL DEFAULT current_timestamp(),
    `customer_id` int unsigned DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  DROP TABLE IF EXISTS `webpage_tracking_webpage_content`;
  CREATE TABLE `webpage_tracking_webpage_content` (
    `version_id` int unsigned NOT NULL,
    `content` mediumtext DEFAULT NULL,
    `delta` mediumtext DEFAULT NULL,
    UNIQUE KEY `version_id` (`version_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  
  DROP TABLE IF EXISTS `webpage_tracking_webpage_version`;
  CREATE TABLE `webpage_tracking_webpage_version` (
    `id` int unsigned NOT NULL AUTO_INCREMENT,
    `webpage_id` int unsigned NOT NULL,
    `mimetype` varchar(255) NOT NULL,
    `is_text` tinyint unsigned NOT NULL,
    `version` int unsigned NOT NULL,
    `date` datetime NOT NULL,
    `size` bigint unsigned NOT NULL,
    `title` text DEFAULT NULL,
    `is_read` tinyint unsigned NOT NULL DEFAULT 0,
    PRIMARY KEY (`id`),
    UNIQUE KEY `page_id_version` (`webpage_id`,`version`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
  
  
  
  ```
- ``` 
  mysqldump -u vicoroot -p -n -t  -h 10.23.22.70 --databases monitoring --tables alert > station-dev-001_data.sql<
  mysqldump -u vicoroot -f -p -n -t --complete-insert -h 10.23.22.188 --databases monitoring --tables alert alert_logging alexa api_key_mapping api_rate_limit_bucket_configuration author_review_metadata auto_reports_feeds_data auto_reports_hashtag_data auto_reports_tags_data base_hierarchy_id blacklist_author blacklist_channel blacklist_phrase blacklist_source blacklist_sourcename blacklist_url blacklist_url category configuration customer customer_metadata customer_productkpidata dashboard_channel dashboard_view dashboard_view_node dashboard_view_node_category dashboard_view_node_category_topic dashboard_view_node_channel dashboard_view_node_custom_query dashboard_view_node_customer_product dashboard_view_node_entity dashboard_view_node_product_category dashboard_view_node_query entry_editorial filter_alias filter_keywords filter_list group group_customer group_project indexer_parameters language list_author list_document list_source log_customer log_macro log_node log_product_category log_query log_report macro macro_category market_price_class node_sentiment_model node_sentimentquery oauth_access_token oauth_client_details pricing_customer_booking pricing_customer_price pricing_customer_volume pricing_feature pricing_feed_volume pricing_package pricing_package_feature product_reference_price rate_limit_configuration rights role role_grant_role role_rights scheduled_export_task searchterm_management_log sentiment_model_trials sentiment_models sentimentquery service_entry shared_clipboard source sourceset sourceset_subselection sourceset_types source_category station_annotator_errors statistics_user_action stopwords stored_searches synonym_tagcloud_tokens synonym_tagcloud_variants topic topicmodel topicmodel_node topicmodel_topic topicstopwords user_abo user_alert user_annotations user_filters user_group user_rights user_role user_settings users web_alert_addresses web_alerts web_alerts_stream web_alerts_stream_conds web_alerts_stream_config web_alerts_stream_config_params web_alerts_stream_incident web_archive_customer_configuration web_customer_export_template web_customer_image_upload web_customer_mail_templates web_dashboards web_download_file web_export_templates web_export_templates_customer web_export_templates_reports web_export_templates_text web_export_templates_text_value web_export_templates_texts web_export_templates_widgets web_filter_attribute_type_ids web_filter_authors web_filter_black_lists web_filter_categories web_filter_countries web_filter_crossed_topics web_filter_data_providers web_filter_doc_types web_filter_genders web_filter_languages web_filter_market_price_classes web_filter_named_entities web_filter_nodes web_filter_post_comment_state web_filter_product web_filter_product_category_ids web_filter_product_sub_category_ids web_filter_ratings web_filter_sentiments web_filter_sort_field web_filter_sort_fields web_filter_source_types web_filter_sources web_filter_tags web_filter_topics  web_filter_white_lists web_filters web_flags web_flagseries web_health_taskinfo web_kpi_customer_configuration web_label_nodes web_label_perspectives web_labels web_perspectives web_projects web_reply_templates web_reports web_reports_addresses web_reports_formats web_reports_widgets_filters web_shared_perspectives web_social_media_channel_token web_social_media_user_token web_themes web_user_annotation_context web_user_annotation_entry web_user_project web_webdashboard_containers web_webdashboard_links web_webdashboard_webdashboard_links web_webdashboards web_webpage_entry web_widget_color_settings web_widget_settings web_widget_settings_post_columns web_widget_settings_visible_columns web_widget_template_categories web_widget_template_categories_widgets web_widget_views web_widgets webpage_tracking_alerting webpage_tracking_category webpage_tracking_localization webpage_tracking_mailing webpage_tracking_permission webpage_tracking_request webpage_tracking_topic webpage_tracking_webpage webpage_tracking_webpage_content webpage_tracking_webpage_version > station-bpt_data_small.sql
  
  
   mysqldump -u vicoroot -f -pSohquai2 -n -t --complete-insert -h 10.23.22.188 --databases monitoring --tables author > station-bpt_author.sql
   | mysql -f -h mysql-001.va.k8s-c1.vicosrv.de monitoring_808 -u root -paEer§$jgh0!. 
  
  cat station-bpt_data_small.sql | mysql  -u root -p -f -h mysql-001.va.k8s-c1.vicosrv.de monitoring_814
  
  mysqldump -u vicoroot -f -pSohquai2 -n -t --complete-insert -h 10.23.22.188 --databases monitoring --tables author > station-bpt_author.sql
  cat station-bpt_author.sql | mysql  -u root -p -f -h mysql-001.va.k8s-c1.vicosrv.de monitoring_808
  
  mysqldump -u vicoroot -f -pSohquai2 -n -t --complete-insert -h 10.23.22.188 --databases monitoring --tables thread > station-bpt_thread.sql
  cat station-bpt_thread.sql | mysql  -u root -p -f -h mysql-001.va.k8s-c1.vicosrv.de monitoring_808
  
  
  mysqldump -h source_host -u source_username -pSourcePassword source_database_name --tables table1 table2 | mysql -h destination_host -u destination_username -pDestinationPassword destination_database_name
  
  mysqldump -u vicoroot -f -p -n -t -h 10.23.22.188 --databases monitoring --routines -d > station_bpt_functions.sql
  
  
  mysqldump -u vicoroot -f -p -n -t --complete-insert -h station-dev-001.vicosrv.de --databases monitoring --tables alert alert_logging alexa api_key_mapping api_rate_limit_bucket_configuration author_review_metadata auto_reports_feeds_data auto_reports_hashtag_data auto_reports_tags_data base_hierarchy_id blacklist_author blacklist_channel blacklist_phrase blacklist_source blacklist_sourcename blacklist_url category configuration customer customer_metadata customer_productkpidata dashboard_channel dashboard_view dashboard_view_node dashboard_view_node_category dashboard_view_node_category_topic dashboard_view_node_channel dashboard_view_node_custom_query dashboard_view_node_customer_product dashboard_view_node_entity dashboard_view_node_product_category dashboard_view_node_query entry_editorial filter_alias filter_keywords filter_list group group_customer group_project indexer_parameters language list_author list_document list_source log_customer log_macro log_node log_product_category log_query log_report macro macro_category market_price_class node_sentiment_model node_sentimentquery oauth_access_token oauth_client_details pricing_customer_booking pricing_customer_price pricing_customer_volume pricing_feature pricing_feed_volume pricing_package pricing_package_feature product_reference_price rate_limit_configuration rights role role_grant_role role_rights scheduled_export_task searchterm_management_log sentiment_model_trials sentiment_models sentimentquery service_entry shared_clipboard source sourceset sourceset_subselection sourceset_types source_category station_annotator_errors statistics_user_action stopwords stored_searches synonym_tagcloud_tokens synonym_tagcloud_variants topic topicmodel topicmodel_node topicmodel_topic topicstopwords user_abo user_alert user_annotations user_filters user_group user_rights user_role user_settings users web_alert_addresses web_alerts web_alerts_stream web_alerts_stream_conds web_alerts_stream_config web_alerts_stream_config_params web_alerts_stream_incident web_archive_customer_configuration web_customer_export_template web_customer_image_upload web_customer_mail_templates web_dashboards web_download_file web_export_templates web_export_templates_customer web_export_templates_reports web_export_templates_text web_export_templates_text_value web_export_templates_texts web_export_templates_widgets web_filter_attribute_type_ids web_filter_authors web_filter_black_lists web_filter_categories web_filter_countries web_filter_crossed_topics web_filter_data_providers web_filter_doc_types web_filter_genders web_filter_languages web_filter_market_price_classes web_filter_named_entities web_filter_nodes web_filter_post_comment_state web_filter_product web_filter_product_category_ids web_filter_product_sub_category_ids web_filter_ratings web_filter_sentiments web_filter_sort_field web_filter_sort_fields web_filter_source_types web_filter_sources web_filter_tags web_filter_topics  web_filter_white_lists web_filters web_flags web_flagseries web_health_taskinfo web_kpi_customer_configuration web_label_nodes web_label_perspectives web_labels web_perspectives web_projects web_reply_templates web_reports web_reports_addresses web_reports_formats web_reports_widgets_filters web_shared_perspectives web_social_media_channel_token web_social_media_user_token web_themes web_user_annotation_context web_user_annotation_entry web_user_project web_webdashboard_containers web_webdashboard_links web_webdashboard_webdashboard_links web_webdashboards web_webpage_entry web_widget_color_settings web_widget_settings web_widget_settings_post_columns web_widget_settings_visible_columns web_widget_template_categories web_widget_template_categories_widgets web_widget_views web_widgets webpage_tracking_alerting webpage_tracking_category webpage_tracking_localization webpage_tracking_mailing webpage_tracking_permission webpage_tracking_request webpage_tracking_topic webpage_tracking_webpage webpage_tracking_webpage_content webpage_tracking_webpage_version > station-dev1_va.sql
  
  
  station-dev-001.vicosrv.de /srv/sql/station-dev1_va.sql
  
  ```
- ``` 
  virtualbox ubuntu
  
  Host
  
  NatNetwork in Virtualbox mit Port Weiterleitung
  Host IP 127.0.0.1 Port 22
  Gast IP 10.0.2.4 Port 22
  
  In .ssh/config
  
  Host ubunutu localhost
     User eckertms
     Hostname localhost
  
  
  Gast
  
  sudo apt install openssh server
  ssh-keygen -t rsa
  
  add host:.ssh/id_rsa.pub to guest:.ssh/authorized_keys
  
  
  Install Docker
  
  https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04
  
  sudo apt upgrade
  sudo apt install apt-transport-https ca-certificates curl software-properties-common
  curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
  sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
  sudo apt update
  apt-cache policy docker-ce
  sudo apt install docker-ce
  sudo systemctl status docker
  
  sudo usermod -aG docker eckertms
  
  ```
- ``` 
  Stats VA:
  (#Komponent,#Factory,#Service,#Directive)
  Administration
  	167 
  Common
  	129
  Workspace
  	206
  
  502
  
  ```
- ``` 
  LANG=C < productstore-2020-02-02_23-00-01.sql parallel --pipe --block 10M grep -F '79209d7c-1a76-4b8f-96e7-173cb25c708e'
  
  
  
  LC_ALL=C grep -F -A 5 -B 5 "79209d7c-1a76-4b8f-96e7-173cb25c708e" productstore-2020-02-02_23-00-01.sql > deleted_prod_79209d7c.sql
  
  fgrep "79209d7c-1a76-4b8f-96e7-173cb25c708e" deleted_prods.sql
  
  
  
  3b21ea7a-3c2a-4135-a82b-5942fc565108
  
  
  LC_ALL=C grep -P "3b21ea7a-3c2a-4135-a82b-5942fc565108\|^COPY " productstore-2020-02-02_23-00-01.sql > deleted_prod_3b21ea7a.sql
  
  IBjINtdY9eH7Jpq7ZdGk3Q==
  
  
  ```
- ``` 
  curl -i -X POST -H "Content-Type: application/json" -d "{\"configuredLevel\": \"TRACE\"}" http://telekom-exporter.k8s-c1.vicosrv.de/actuator/loggers/com.vico.micrometer
  
  
  api-hazelcast.va-apipreview.svc.cluster.local
  ```