SysOps: voice-agy-webbuilder-backup — 2026-06-23 10:04 UTC

This commit is contained in:
sysops
2026-06-23 10:04:23 +00:00
parent 3bf15c4850
commit 26fe76afdd
165 changed files with 47427 additions and 1264 deletions
+88
View File
@@ -0,0 +1,88 @@
-- Agent integration: collaboration matrix, handoffs, permissions
CREATE TABLE IF NOT EXISTS agent_collaboration (
from_agent VARCHAR(64) NOT NULL,
to_agent VARCHAR(64) NOT NULL,
handoff_type VARCHAR(64) NOT NULL DEFAULT 'partner',
description TEXT,
PRIMARY KEY (from_agent, to_agent, handoff_type)
);
CREATE TABLE IF NOT EXISTS agent_handoffs (
id SERIAL PRIMARY KEY,
correlation_id UUID NOT NULL DEFAULT gen_random_uuid(),
from_agent VARCHAR(64) NOT NULL,
to_agent VARCHAR(64) NOT NULL,
handoff_type VARCHAR(64) DEFAULT 'partner',
payload JSONB DEFAULT '{}'::jsonb,
status VARCHAR(32) NOT NULL DEFAULT 'pending',
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
completed_at TIMESTAMPTZ
);
CREATE INDEX IF NOT EXISTS idx_agent_handoffs_correlation ON agent_handoffs(correlation_id);
CREATE INDEX IF NOT EXISTS idx_agent_handoffs_pair ON agent_handoffs(from_agent, to_agent, created_at DESC);
-- Collaboration matrix (16 agents)
INSERT INTO agent_collaboration (from_agent, to_agent, handoff_type, description) VALUES
('marketing', 'retail', 'trends', 'RSS/trends naar retail kansen'),
('marketing', 'design', 'assets', 'Campagne assets'),
('marketing', 'knowledge', 'brand', 'Brand guidelines'),
('marketing', 'research', 'intel', 'Marktintel'),
('retail', 'bizdev', 'opportunities', 'Hot leads'),
('retail', 'finance', 'margin', 'SKU marge check'),
('retail', 'marketing', 'feedback', 'Campagne feedback'),
('bizdev', 'finance', 'valuation', 'Deal waardering'),
('bizdev', 'product', 'listing', 'Listing eisen'),
('bizdev', 'email', 'leads', 'Inbound leads'),
('finance', 'bizdev', 'margin_scenario', 'Margescenario'),
('finance', 'sourcing', 'costs', 'Inkoopkosten'),
('finance', 'retail', 'sku_margin', 'Retail SKU marge'),
('sourcing', 'product', 'suppliers', 'Leveranciers'),
('sourcing', 'finance', 'cost_data', 'Kostendata'),
('sourcing', 'halal', 'certs', 'Certificaat check'),
('product', 'halal', 'compliance', 'Ingrediënten compliance'),
('product', 'packaging', 'spec', 'SKU spec'),
('product', 'knowledge', 'recipes', 'Recepten NAS'),
('halal', 'product', 'feedback', 'Compliance feedback'),
('halal', 'packaging', 'claims', 'Label claims'),
('halal', 'sourcing', 'cert_docs', 'Cert documenten'),
('packaging', 'design', 'artwork', 'Label artwork'),
('packaging', 'product', 'spec', 'Product spec'),
('packaging', 'halal', 'claims', 'Halal claims op label'),
('design', 'marketing', 'campaign', 'Campagne visuals'),
('design', 'packaging', 'label', 'Label design'),
('design', 'product', 'visual', 'SKU visual'),
('knowledge', 'hr', 'handbooks', 'HR handboeken'),
('knowledge', 'product', 'docs', 'Product docs NAS'),
('knowledge', 'sysops', 'archive', 'Log archief'),
('research', 'marketing', 'intel', 'Marktintel marketing'),
('research', 'bizdev', 'intel', 'Concurrent intel'),
('research', 'retail', 'intel', 'Retail trends'),
('browser', 'research', 'scrape', 'Web scrape resultaten'),
('browser', 'sourcing', 'supplier_sites', 'Leverancier sites'),
('browser', 'retail', 'folder_scrape', 'Folder scrape'),
('email', 'bizdev', 'leads', 'Inbound leads'),
('email', 'hr', 'applications', 'Sollicitaties'),
('email', 'marketing', 'mentions', 'Mentions'),
('hr', 'sysops', 'onboarding', 'Account onboarding'),
('hr', 'knowledge', 'policy', 'HR beleid'),
('sysops', 'knowledge', 'logs', 'Infra logs'),
('sysops', 'hr', 'access', 'Toegang HR'),
('sysops', 'herman', 'infra_status', 'Infra status briefing')
ON CONFLICT (from_agent, to_agent, handoff_type) DO NOTHING;
-- Herman permissions: grant all modules for autonomous delegation
UPDATE herman_permissions SET granted = TRUE, granted_at = NOW(), updated_at = NOW()
WHERE granted IS NOT TRUE;
-- Auto-approve low-risk SysOps (stored in app_settings if table exists)
CREATE TABLE IF NOT EXISTS app_settings (
key VARCHAR(128) PRIMARY KEY,
value JSONB NOT NULL DEFAULT '{}'::jsonb,
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
INSERT INTO app_settings (key, value) VALUES
('sysops_auto_approve', '{"maintenance_scan": true, "config_backup": true}'::jsonb)
ON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value, updated_at = NOW();
+14
View File
@@ -0,0 +1,14 @@
-- User-defined labels for NAS documents and OCR photos
ALTER TABLE document_analytics
ADD COLUMN IF NOT EXISTS user_labels TEXT[] DEFAULT '{}',
ADD COLUMN IF NOT EXISTS label_notes TEXT,
ADD COLUMN IF NOT EXISTS labeled_at TIMESTAMPTZ;
ALTER TABLE photo_imports
ADD COLUMN IF NOT EXISTS user_labels TEXT[] DEFAULT '{}',
ADD COLUMN IF NOT EXISTS label_notes TEXT,
ADD COLUMN IF NOT EXISTS labeled_at TIMESTAMPTZ;
CREATE INDEX IF NOT EXISTS idx_doc_analytics_user_labels ON document_analytics USING GIN (user_labels);
CREATE INDEX IF NOT EXISTS idx_photo_imports_user_labels ON photo_imports USING GIN (user_labels);
+21
View File
@@ -0,0 +1,21 @@
-- Docling conversion results for NAS documents
CREATE TABLE IF NOT EXISTS docling_results (
id SERIAL PRIMARY KEY,
storage_path TEXT NOT NULL,
file_sig VARCHAR(64) NOT NULL DEFAULT '',
status VARCHAR(32) NOT NULL DEFAULT 'pending',
options JSONB NOT NULL DEFAULT '{}'::jsonb,
exports JSONB NOT NULL DEFAULT '{}'::jsonb,
tables_data JSONB NOT NULL DEFAULT '[]'::jsonb,
pictures JSONB NOT NULL DEFAULT '[]'::jsonb,
page_count INT DEFAULT 0,
metadata JSONB NOT NULL DEFAULT '{}'::jsonb,
error_text TEXT,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
completed_at TIMESTAMPTZ,
UNIQUE (storage_path, file_sig)
);
CREATE INDEX IF NOT EXISTS idx_docling_results_path ON docling_results (storage_path);
CREATE INDEX IF NOT EXISTS idx_docling_results_status ON docling_results (status, created_at DESC);
+10
View File
@@ -0,0 +1,10 @@
-- Editable workspace drafts for Docling / document editor
CREATE TABLE IF NOT EXISTS document_workspace (
storage_path TEXT PRIMARY KEY,
source_format VARCHAR(32) DEFAULT 'markdown',
content TEXT NOT NULL DEFAULT '',
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
CREATE INDEX IF NOT EXISTS idx_document_workspace_updated ON document_workspace (updated_at DESC);
+30
View File
@@ -0,0 +1,30 @@
-- Document ↔ klant/project koppelingen + auto-ingest log
CREATE TABLE IF NOT EXISTS document_links (
id SERIAL PRIMARY KEY,
storage_path TEXT NOT NULL,
is_folder BOOLEAN NOT NULL DEFAULT FALSE,
client_id INT REFERENCES clients(id) ON DELETE CASCADE,
project_id INT REFERENCES cockpit_projects(id) ON DELETE SET NULL,
link_type VARCHAR(32) NOT NULL DEFAULT 'nas_share',
notes TEXT DEFAULT '',
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
created_by VARCHAR(64) DEFAULT 'cockpit'
);
CREATE UNIQUE INDEX IF NOT EXISTS idx_document_links_unique
ON document_links (storage_path, COALESCE(client_id, 0), COALESCE(project_id, 0));
CREATE INDEX IF NOT EXISTS idx_document_links_client ON document_links (client_id);
CREATE INDEX IF NOT EXISTS idx_document_links_project ON document_links (project_id);
CREATE INDEX IF NOT EXISTS idx_document_links_path ON document_links (storage_path);
CREATE TABLE IF NOT EXISTS ingest_automation_log (
id SERIAL PRIMARY KEY,
source VARCHAR(64) NOT NULL,
status VARCHAR(32) NOT NULL DEFAULT 'ok',
details JSONB NOT NULL DEFAULT '{}',
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
CREATE INDEX IF NOT EXISTS idx_ingest_automation_log_at ON ingest_automation_log (created_at DESC);
+25
View File
@@ -0,0 +1,25 @@
-- Cloud + local LLM provider configuration
CREATE TABLE IF NOT EXISTS llm_providers (
id SERIAL PRIMARY KEY,
label VARCHAR(128) NOT NULL,
provider_type VARCHAR(48) NOT NULL DEFAULT 'custom_openai',
api_base_url TEXT,
api_key TEXT,
model VARCHAR(128) NOT NULL DEFAULT 'deepseek-chat',
is_active BOOLEAN NOT NULL DEFAULT FALSE,
is_default BOOLEAN NOT NULL DEFAULT FALSE,
extra_config JSONB NOT NULL DEFAULT '{}',
last_test_status VARCHAR(64),
last_test_message TEXT,
last_test_at TIMESTAMPTZ,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
CREATE INDEX IF NOT EXISTS idx_llm_providers_active ON llm_providers (is_active);
CREATE INDEX IF NOT EXISTS idx_llm_providers_default ON llm_providers (is_default) WHERE is_default = TRUE;
-- Seed local Ollama as default if empty
INSERT INTO llm_providers (label, provider_type, api_base_url, model, is_active, is_default)
SELECT 'Ollama lokaal', 'ollama', NULL, 'qwen3:8b', TRUE, TRUE
WHERE NOT EXISTS (SELECT 1 FROM llm_providers);
+14
View File
@@ -0,0 +1,14 @@
-- Version history for document workspace / NAS edits
CREATE TABLE IF NOT EXISTS document_versions (
id SERIAL PRIMARY KEY,
storage_path TEXT NOT NULL,
content TEXT NOT NULL DEFAULT '',
source_format VARCHAR(32) DEFAULT 'markdown',
version_label VARCHAR(128) DEFAULT '',
nas_mtime TIMESTAMPTZ,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
CREATE INDEX IF NOT EXISTS idx_document_versions_path_created
ON document_versions (storage_path, created_at DESC);
+89
View File
@@ -0,0 +1,89 @@
-- Revenue Cockpit: projects, goals, tracking, agent task links
CREATE TABLE IF NOT EXISTS revenue_cockpit_goals (
id SERIAL PRIMARY KEY,
vision_text TEXT NOT NULL DEFAULT '',
horizon_text TEXT DEFAULT '',
tagline TEXT DEFAULT '',
is_active BOOLEAN DEFAULT TRUE,
created_at TIMESTAMPTZ DEFAULT NOW(),
updated_at TIMESTAMPTZ DEFAULT NOW()
);
CREATE TABLE IF NOT EXISTS revenue_projects (
id SERIAL PRIMARY KEY,
name VARCHAR(255) NOT NULL,
category VARCHAR(32) DEFAULT 'deal',
margin_month NUMERIC(14, 2),
margin_year NUMERIC(14, 2),
target_revenue NUMERIC(14, 2),
next_steps TEXT,
status VARCHAR(32) DEFAULT 'active',
priority VARCHAR(16) DEFAULT 'normal',
sort_order INTEGER DEFAULT 0,
cockpit_project_id INTEGER REFERENCES cockpit_projects(id) ON DELETE SET NULL,
metadata JSONB DEFAULT '{}'::jsonb,
created_at TIMESTAMPTZ DEFAULT NOW(),
updated_at TIMESTAMPTZ DEFAULT NOW()
);
CREATE INDEX IF NOT EXISTS idx_revenue_projects_status ON revenue_projects(status, sort_order);
CREATE INDEX IF NOT EXISTS idx_revenue_projects_category ON revenue_projects(category);
CREATE TABLE IF NOT EXISTS revenue_objectives (
id SERIAL PRIMARY KEY,
project_id INTEGER NOT NULL REFERENCES revenue_projects(id) ON DELETE CASCADE,
title VARCHAR(255) NOT NULL,
description TEXT,
due_date DATE,
status VARCHAR(32) DEFAULT 'open',
priority VARCHAR(16) DEFAULT 'normal',
sort_order INTEGER DEFAULT 0,
created_at TIMESTAMPTZ DEFAULT NOW(),
updated_at TIMESTAMPTZ DEFAULT NOW()
);
CREATE INDEX IF NOT EXISTS idx_revenue_objectives_project ON revenue_objectives(project_id, status);
CREATE TABLE IF NOT EXISTS revenue_import_runs (
id SERIAL PRIMARY KEY,
source_file VARCHAR(512) NOT NULL,
sheet_name VARCHAR(128) NOT NULL,
rows_imported INTEGER DEFAULT 0,
goals_imported BOOLEAN DEFAULT FALSE,
imported_by VARCHAR(64) DEFAULT 'ceo',
metadata JSONB DEFAULT '{}'::jsonb,
created_at TIMESTAMPTZ DEFAULT NOW()
);
CREATE TABLE IF NOT EXISTS revenue_change_log (
id SERIAL PRIMARY KEY,
entity_type VARCHAR(32) NOT NULL,
entity_id INTEGER NOT NULL,
field_name VARCHAR(64) NOT NULL,
old_value TEXT,
new_value TEXT,
changed_by VARCHAR(64) DEFAULT 'ceo',
created_at TIMESTAMPTZ DEFAULT NOW()
);
CREATE INDEX IF NOT EXISTS idx_revenue_change_log_entity ON revenue_change_log(entity_type, entity_id, created_at DESC);
CREATE TABLE IF NOT EXISTS revenue_snapshots (
id SERIAL PRIMARY KEY,
snapshot_date DATE NOT NULL DEFAULT CURRENT_DATE,
total_margin_year NUMERIC(14, 2) DEFAULT 0,
total_margin_month NUMERIC(14, 2) DEFAULT 0,
active_projects INTEGER DEFAULT 0,
open_objectives INTEGER DEFAULT 0,
open_agent_tasks INTEGER DEFAULT 0,
payload JSONB DEFAULT '{}'::jsonb,
created_at TIMESTAMPTZ DEFAULT NOW(),
UNIQUE (snapshot_date)
);
ALTER TABLE agent_tasks ADD COLUMN IF NOT EXISTS revenue_project_id INTEGER REFERENCES revenue_projects(id) ON DELETE SET NULL;
ALTER TABLE agent_tasks ADD COLUMN IF NOT EXISTS revenue_objective_id INTEGER REFERENCES revenue_objectives(id) ON DELETE SET NULL;
ALTER TABLE agent_tasks ADD COLUMN IF NOT EXISTS source VARCHAR(32) DEFAULT 'manual';
CREATE INDEX IF NOT EXISTS idx_agent_tasks_revenue ON agent_tasks(revenue_project_id, status);
+1
View File
@@ -0,0 +1 @@
ALTER TABLE revenue_cockpit_goals ADD COLUMN IF NOT EXISTS mid_text TEXT DEFAULT '';
+59
View File
@@ -0,0 +1,59 @@
-- Web Builder agent — websites bouwen via Hermes/agy op VM107
INSERT INTO agent_souls (
agent_key, display_name, role_title, soul_md, responsibilities,
avatar_emoji, avatar_color, avatar_mood, is_active
) VALUES (
'webbuilder',
'Web Builder',
'Website Ontwikkeling',
'# Web Builder — Soul
Je bent de Web Builder van Foodlinkk. Je bouwt complete websites autonoom via Antigravity CLI (agy) op Hermes VM107.
## Karakter
- Technisch sterk, visueel gedreven, snel itereren
- Werkt volledig autonoom — geen goedkeuringsprompts
- Rapporteert alleen het eindresultaat aan Herman (Co-CEO)
## Werkzaamheden
- Nieuwe website-projecten aanmaken op NAS (`//10.4.7.11/share/Websites/<project>/`)
- HTML/CSS/JS websites bouwen met agy (`--print --dangerously-skip-permissions`)
- Preview-server starten op poort 8080
- Status en voortgang loggen naar agent terminal (live in Cockpit UI)
## Samenwerking
- **Herman:** ontvangt website-opdrachten, rapporteert eindresultaat terug
- **Design:** visuele assets en brand guidelines (handoff)
- **Marketing:** content en tone-of-voice voor landingspagina''s
- **SysOps:** Hermes VM monitoring en NAS mount',
'Websites bouwen · agy/Antigravity · NAS projecten · preview · Herman rapportage',
'🌐', '#0ea5e9', 'focused', true
)
ON CONFLICT (agent_key) DO UPDATE SET
display_name = EXCLUDED.display_name,
role_title = EXCLUDED.role_title,
soul_md = EXCLUDED.soul_md,
responsibilities = EXCLUDED.responsibilities,
avatar_emoji = EXCLUDED.avatar_emoji,
avatar_color = EXCLUDED.avatar_color,
avatar_mood = EXCLUDED.avatar_mood,
is_active = EXCLUDED.is_active,
updated_at = NOW();
INSERT INTO agent_collaboration (from_agent, to_agent, handoff_type, description) VALUES
('herman', 'webbuilder', 'website', 'Website-opdrachten van Herman'),
('webbuilder', 'herman', 'report', 'Eindresultaat website naar Herman'),
('webbuilder', 'design', 'assets', 'Visuele assets voor website'),
('webbuilder', 'marketing', 'content', 'Content en tone-of-voice'),
('marketing', 'webbuilder', 'landing', 'Landingspagina opdracht'),
('design', 'webbuilder', 'visual', 'Brand visuals voor site'),
('sysops', 'webbuilder', 'infra', 'Hermes VM / NAS status')
ON CONFLICT (from_agent, to_agent, handoff_type) DO NOTHING;
INSERT INTO herman_permissions (module_key, module_label, description, category, granted, granted_at) VALUES
('webbuilder', 'Web Builder', 'Websites laten bouwen via Hermes/agy', 'agents', true, NOW())
ON CONFLICT (module_key) DO UPDATE SET
granted = true,
granted_at = NOW(),
updated_at = NOW();
+302
View File
@@ -0,0 +1,302 @@
-- Foodlinkk 036: Export Intel Global (schema + fase A seeds)
CREATE TABLE IF NOT EXISTS export_regions (
code VARCHAR(32) PRIMARY KEY,
name_nl VARCHAR(128) NOT NULL,
name_en VARCHAR(128) NOT NULL,
sort_order INT DEFAULT 0
);
CREATE TABLE IF NOT EXISTS export_territories (
code VARCHAR(64) PRIMARY KEY,
country_iso2 CHAR(2) NOT NULL,
region_code VARCHAR(32) REFERENCES export_regions(code),
name_nl VARCHAR(128) NOT NULL,
name_en VARCHAR(128) NOT NULL,
lat DOUBLE PRECISION,
lon DOUBLE PRECISION,
map_zoom INT DEFAULT 6,
bbox JSONB,
sync_priority INT DEFAULT 3,
is_active BOOLEAN DEFAULT TRUE,
created_at TIMESTAMPTZ DEFAULT NOW()
);
CREATE TABLE IF NOT EXISTS export_caterer_brands (
code VARCHAR(64) PRIMARY KEY,
name VARCHAR(255) NOT NULL,
parent_brand_code VARCHAR(64) REFERENCES export_caterer_brands(code),
hq_country_iso2 CHAR(2),
website VARCHAR(512),
tier INT DEFAULT 2,
notes TEXT,
annual_report_url VARCHAR(512),
created_at TIMESTAMPTZ DEFAULT NOW()
);
CREATE TABLE IF NOT EXISTS export_caterer_presence (
id SERIAL PRIMARY KEY,
brand_code VARCHAR(64) NOT NULL REFERENCES export_caterer_brands(code),
country_iso2 CHAR(2) NOT NULL,
local_legal_name VARCHAR(255),
service_lines JSONB DEFAULT '[]'::jsonb,
regions JSONB DEFAULT '[]'::jsonb,
site_count_estimate INT,
procurement_model VARCHAR(32),
product_categories_served JSONB DEFAULT '[]'::jsonb,
supplier_entry_point VARCHAR(32),
is_active BOOLEAN DEFAULT TRUE,
last_verified_at TIMESTAMPTZ,
sources JSONB DEFAULT '[]'::jsonb,
entity_id INT,
created_at TIMESTAMPTZ DEFAULT NOW(),
UNIQUE (brand_code, country_iso2)
);
CREATE TABLE IF NOT EXISTS export_market_entities (
id SERIAL PRIMARY KEY,
name VARCHAR(255) NOT NULL,
entity_type VARCHAR(64) NOT NULL,
country_iso2 CHAR(2) NOT NULL,
territory_code VARCHAR(64) REFERENCES export_territories(code),
lat DOUBLE PRECISION,
lon DOUBLE PRECISION,
address_line VARCHAR(512),
city VARCHAR(128),
postal_code VARCHAR(32),
phone VARCHAR(64),
email VARCHAR(255),
website VARCHAR(512),
product_interest JSONB DEFAULT '[]'::jsonb,
volume_band VARCHAR(32),
cold_chain BOOLEAN DEFAULT FALSE,
halal_cert_notes TEXT,
google_place_id VARCHAR(128),
brand_code VARCHAR(64) REFERENCES export_caterer_brands(code),
source VARCHAR(64) DEFAULT 'manual',
sources JSONB DEFAULT '[]'::jsonb,
confidence INT DEFAULT 50,
geo_status VARCHAR(32) DEFAULT 'ok',
canonical_id INT REFERENCES export_market_entities(id),
pipeline_stage VARCHAR(32) DEFAULT 'identified',
client_id INT REFERENCES clients(id) ON DELETE SET NULL,
deal_id INT REFERENCES deals(id) ON DELETE SET NULL,
metadata JSONB DEFAULT '{}'::jsonb,
created_at TIMESTAMPTZ DEFAULT NOW(),
updated_at TIMESTAMPTZ DEFAULT NOW()
);
CREATE TABLE IF NOT EXISTS export_entity_contacts (
id SERIAL PRIMARY KEY,
entity_id INT NOT NULL REFERENCES export_market_entities(id) ON DELETE CASCADE,
presence_id INT REFERENCES export_caterer_presence(id) ON DELETE SET NULL,
contact_type VARCHAR(32) DEFAULT 'person',
role VARCHAR(64) DEFAULT 'general',
name VARCHAR(255),
title VARCHAR(255),
department VARCHAR(128),
email VARCHAR(255),
email_alt VARCHAR(255),
phone VARCHAR(64),
mobile VARCHAR(64),
whatsapp VARCHAR(64),
fax VARCHAR(64),
linkedin_url VARCHAR(512),
website_contact_url VARCHAR(512),
address_line VARCHAR(512),
city VARCHAR(128),
postal_code VARCHAR(32),
language VARCHAR(8) DEFAULT 'en',
is_primary BOOLEAN DEFAULT FALSE,
opt_out BOOLEAN DEFAULT FALSE,
source VARCHAR(64) DEFAULT 'manual',
source_url VARCHAR(512),
confidence INT DEFAULT 50,
verified_at TIMESTAMPTZ,
created_at TIMESTAMPTZ DEFAULT NOW()
);
CREATE TABLE IF NOT EXISTS export_gov_data_sources (
id SERIAL PRIMARY KEY,
country_iso2 CHAR(2) NOT NULL,
name VARCHAR(255) NOT NULL,
category VARCHAR(64) NOT NULL,
url VARCHAR(512),
api_url VARCHAR(512),
notes TEXT,
is_active BOOLEAN DEFAULT TRUE,
created_at TIMESTAMPTZ DEFAULT NOW()
);
CREATE TABLE IF NOT EXISTS export_outreach_log (
id SERIAL PRIMARY KEY,
entity_id INT REFERENCES export_market_entities(id) ON DELETE SET NULL,
presence_id INT REFERENCES export_caterer_presence(id) ON DELETE SET NULL,
campaign_type VARCHAR(64) NOT NULL,
email_message_id INT,
deal_id INT REFERENCES deals(id) ON DELETE SET NULL,
status VARCHAR(32) DEFAULT 'draft',
template_id VARCHAR(64),
sent_at TIMESTAMPTZ,
created_at TIMESTAMPTZ DEFAULT NOW()
);
CREATE INDEX IF NOT EXISTS idx_export_entities_country ON export_market_entities(country_iso2);
CREATE INDEX IF NOT EXISTS idx_export_entities_type ON export_market_entities(entity_type);
CREATE INDEX IF NOT EXISTS idx_export_contacts_entity ON export_entity_contacts(entity_id);
CREATE INDEX IF NOT EXISTS idx_export_contacts_email ON export_entity_contacts(email);
CREATE INDEX IF NOT EXISTS idx_export_presence_country ON export_caterer_presence(country_iso2);
-- Regions
INSERT INTO export_regions (code, name_nl, name_en, sort_order) VALUES
('caribbean', 'Caribisch', 'Caribbean', 1),
('gcc', 'GCC', 'GCC', 2),
('europe', 'Europa', 'Europe', 3),
('africa', 'Afrika', 'Africa', 4),
('asia', 'Asia', 'Asia', 5),
('americas', 'Amerika', 'Americas', 6),
('oceania', 'Oceanië', 'Oceania', 7)
ON CONFLICT (code) DO NOTHING;
-- Territories (fase A: key markets + Caribbean + GCC)
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES
('nl', 'NL', 'europe', 'Nederland', 'Netherlands', 52.37, 4.90, 7, '[50.75,3.2,53.7,7.3]'::jsonb, 1),
('aw', 'AW', 'caribbean', 'Aruba', 'Aruba', 12.52, -70.03, 11, '[12.4,-70.1,12.65,-69.8]'::jsonb, 1),
('cw', 'CW', 'caribbean', 'Curaçao', 'Curaçao', 12.17, -68.99, 11, '[11.9,-69.2,12.4,-68.6]'::jsonb, 1),
('bq', 'BQ', 'caribbean', 'Bonaire', 'Bonaire', 12.15, -68.27, 12, '[12.0,-68.4,12.3,-68.2]'::jsonb, 1),
('sx', 'SX', 'caribbean', 'Sint Maarten', 'Sint Maarten', 18.04, -63.05, 11, '[17.9,-63.2,18.1,-62.9]'::jsonb, 1),
('bq-se', 'BQ', 'caribbean', 'Saba', 'Saba', 17.63, -63.23, 12, '[17.6,-63.3,17.7,-63.2]'::jsonb, 1),
('bq-bo', 'BQ', 'caribbean', 'Sint Eustatius', 'Sint Eustatius', 17.48, -62.98, 12, '[17.4,-63.1,17.5,-62.9]'::jsonb, 1),
('ae', 'AE', 'gcc', 'Verenigde Arabische Emiraten', 'United Arab Emirates', 24.45, 54.37, 7, '[22.5,51.5,26.1,56.5]'::jsonb, 1),
('de', 'DE', 'europe', 'Duitsland', 'Germany', 51.16, 10.45, 6, '[47.3,5.9,55.1,15.0]'::jsonb, 2),
('gb', 'GB', 'europe', 'Verenigd Koninkrijk', 'United Kingdom', 54.0, -2.0, 6, '[49.9,-8.6,60.9,1.8]'::jsonb, 2),
('fr', 'FR', 'europe', 'Frankrijk', 'France', 46.6, 2.35, 6, '[41.3,-5.1,51.1,9.6]'::jsonb, 2),
('be', 'BE', 'europe', 'België', 'Belgium', 50.64, 4.67, 7, '[49.5,2.5,51.5,6.4]'::jsonb, 2),
('us', 'US', 'americas', 'Verenigde Staten', 'United States', 39.8, -98.5, 4, '[24.5,-125,49.5,-66]'::jsonb, 2),
('sa', 'SA', 'gcc', 'Saudi-Arabië', 'Saudi Arabia', 24.0, 45.0, 5, '[16.0,34.5,32.2,55.7]'::jsonb, 2),
('qa', 'QA', 'gcc', 'Qatar', 'Qatar', 25.35, 51.18, 8, '[24.4,50.7,26.2,51.7]'::jsonb, 2),
('ma', 'MA', 'africa', 'Marokko', 'Morocco', 31.79, -7.09, 6, '[21.0,-17.0,36.0,-1.0]'::jsonb, 3),
('tr', 'TR', 'europe', 'Turkije', 'Turkey', 39.0, 35.0, 6, '[36.0,26.0,42.1,45.0]'::jsonb, 3),
('my', 'MY', 'asia', 'Maleisië', 'Malaysia', 4.21, 101.98, 6, '[0.8,99.6,7.4,119.3]'::jsonb, 3),
('id', 'ID', 'asia', 'Indonesia', 'Indonesia', -2.5, 118.0, 5, '[-11.0,95.0,6.0,141.0]'::jsonb, 3),
('au', 'AU', 'oceania', 'Australië', 'Australia', -25.27, 133.78, 4, '[-44.0,112.9,-10.0,154.0]'::jsonb, 3)
ON CONFLICT (code) DO NOTHING;
-- Global caterer brands (tier 1 + NL)
INSERT INTO export_caterer_brands (code, name, parent_brand_code, hq_country_iso2, website, tier) VALUES
('compass', 'Compass Group', NULL, 'GB', 'https://www.compass-group.com', 1),
('eurest', 'Eurest', 'compass', 'GB', 'https://www.eurest.nl', 1),
('sodexo', 'Sodexo', NULL, 'FR', 'https://www.sodexo.com', 1),
('aramark', 'Aramark', NULL, 'US', 'https://www.aramark.com', 1),
('elior', 'Elior Group', NULL, 'FR', 'https://www.eliorgroup.com', 1),
('iss', 'ISS A/S', NULL, 'DK', 'https://www.issworld.com', 1),
('albron', 'Albron', NULL, 'NL', 'https://www.albron.nl', 2),
('hutten', 'Hutten Catering', NULL, 'NL', 'https://www.hutten.nl', 2),
('appel', 'Appèl Catering', NULL, 'NL', 'https://www.appel.nl', 2),
('vermaat', 'Vermaat', NULL, 'NL', 'https://www.vermaat.nl', 2),
('restoplan', 'Restoplan', NULL, 'NL', 'https://www.restoplan.nl', 2),
('vitam', 'Vitam', NULL, 'NL', 'https://www.vitam.nl', 2)
ON CONFLICT (code) DO NOTHING;
-- Caterer presence (NL + sample international)
INSERT INTO export_caterer_presence (brand_code, country_iso2, local_legal_name, service_lines, procurement_model, supplier_entry_point) VALUES
('albron', 'NL', 'Albron Nederland BV', '["workplace","education","healthcare","travel_hospitality"]'::jsonb, 'central_national', 'national_procurement'),
('hutten', 'NL', 'Hutten Business Catering BV', '["workplace","events_banqueting"]'::jsonb, 'regional', 'category_manager'),
('appel', 'NL', 'Appèl B.V.', '["education","workplace"]'::jsonb, 'regional', 'category_manager'),
('vermaat', 'NL', 'Vermaat Bedrijfshoreca B.V.', '["workplace","events_banqueting"]'::jsonb, 'central_national', 'national_procurement'),
('eurest', 'NL', 'Eurest Nederland BV', '["workplace","integrated_fm"]'::jsonb, 'central_national', 'national_procurement'),
('sodexo', 'NL', 'Sodexo BV', '["workplace","education","healthcare"]'::jsonb, 'central_national', 'tender_portal'),
('iss', 'NL', 'ISS Facility Services', '["integrated_fm","workplace"]'::jsonb, 'central_national', 'national_procurement'),
('sodexo', 'AE', 'Sodexo Middle East', '["workplace","healthcare","travel_hospitality"]'::jsonb, 'central_national', 'national_procurement'),
('compass', 'GB', 'Compass Group UK', '["workplace","sports_leisure"]'::jsonb, 'central_national', 'national_procurement'),
('sodexo', 'FR', 'Sodexo France', '["workplace","education","healthcare"]'::jsonb, 'central_national', 'tender_portal'),
('aramark', 'US', 'Aramark', '["workplace","sports_leisure","education"]'::jsonb, 'central_national', 'national_procurement')
ON CONFLICT (brand_code, country_iso2) DO NOTHING;
-- Distributors (Caribbean fase 1 seeds)
INSERT INTO export_market_entities (name, entity_type, country_iso2, territory_code, city, website, source, confidence, product_interest, volume_band)
SELECT v.name, v.entity_type, v.country_iso2, v.territory_code, v.city, v.website, v.source, v.confidence, v.product_interest, v.volume_band
FROM (VALUES
('EWT / Anur Curaçao', 'distributor', 'CW', 'cw', 'Willemstad', 'https://ewtcuracao.com', 'manual', 80, '["chicken","shoarma","beef"]'::jsonb, 'container'),
('Caribbean Overseas', 'distributor', 'AW', 'aw', 'Oranjestad', 'https://caribbeanoverseas.com', 'manual', 75, '["chicken","shoarma"]'::jsonb, 'pallet'),
('Compra Aruba', 'distributor', 'AW', 'aw', 'Oranjestad', 'https://compra-aruba.com', 'manual', 75, '["chicken","beef"]'::jsonb, 'pallet'),
('Fresh Supplier Bonaire', 'distributor', 'BQ', 'bq', 'Kralendijk', 'https://freshsupplierbonaire.com', 'manual', 70, '["chicken","shoarma"]'::jsonb, 'pallet'),
('Ferrara Food Group', 'distributor', 'CW', 'cw', 'Willemstad', NULL, 'manual', 65, '["chicken","beef"]'::jsonb, 'pallet'),
('Pietersz Foodservice', 'wholesaler', 'NL', 'nl', 'Rotterdam', NULL, 'manual', 70, '["chicken","shoarma"]'::jsonb, 'pallet')
) AS v(name, entity_type, country_iso2, territory_code, city, website, source, confidence, product_interest, volume_band)
WHERE NOT EXISTS (
SELECT 1 FROM export_market_entities e WHERE e.name = v.name AND e.country_iso2 = v.country_iso2
);
-- NL contract caterers as entities
INSERT INTO export_market_entities (name, entity_type, country_iso2, territory_code, city, website, brand_code, source, confidence, product_interest)
SELECT v.name, v.entity_type, v.country_iso2, v.territory_code, v.city, v.website, v.brand_code, v.source, v.confidence, v.product_interest
FROM (VALUES
('Albron Nederland', 'contract_caterer', 'NL', 'nl', 'Utrecht', 'https://www.albron.nl', 'albron', 'caterer_registry', 85, '["chicken","shoarma"]'::jsonb),
('Hutten Business Catering', 'contract_caterer', 'NL', 'nl', 'Eindhoven', 'https://www.hutten.nl', 'hutten', 'caterer_registry', 85, '["chicken","shoarma"]'::jsonb),
('Appèl Catering', 'contract_caterer', 'NL', 'nl', 'Veghel', 'https://www.appel.nl', 'appel', 'caterer_registry', 85, '["chicken","shoarma"]'::jsonb),
('Vermaat Bedrijfshoreca', 'contract_caterer', 'NL', 'nl', 'Hoofddorp', 'https://www.vermaat.nl', 'vermaat', 'caterer_registry', 85, '["chicken","shoarma"]'::jsonb),
('Sodexo Nederland', 'contract_caterer', 'NL', 'nl', 'Amsterdam', 'https://www.sodexo.nl', 'sodexo', 'caterer_registry', 80, '["chicken","shoarma","beef"]'::jsonb),
('Eurest Nederland', 'contract_caterer', 'NL', 'nl', 'Amsterdam', 'https://www.eurest.nl', 'eurest', 'caterer_registry', 80, '["chicken","shoarma"]'::jsonb)
) AS v(name, entity_type, country_iso2, territory_code, city, website, brand_code, source, confidence, product_interest)
WHERE NOT EXISTS (
SELECT 1 FROM export_market_entities e WHERE e.name = v.name AND e.country_iso2 = v.country_iso2
);
-- Sample contacts (fase A — meer volgt in fase B enrichment)
INSERT INTO export_entity_contacts (entity_id, role, name, email, phone, source, confidence, is_primary)
SELECT e.id, 'sales', 'Sales', 'info@ewtcuracao.com', '+59997371234', 'manual', 70, TRUE
FROM export_market_entities e
WHERE e.name = 'EWT / Anur Curaçao'
AND NOT EXISTS (SELECT 1 FROM export_entity_contacts c WHERE c.entity_id = e.id AND c.email = 'info@ewtcuracao.com')
LIMIT 1;
INSERT INTO export_entity_contacts (entity_id, role, name, email, source, confidence, is_primary)
SELECT e.id, 'procurement', 'Inkoop', 'inkoop@albron.nl', 'manual', 60, TRUE
FROM export_market_entities e
WHERE e.name = 'Albron Nederland'
AND NOT EXISTS (SELECT 1 FROM export_entity_contacts c WHERE c.entity_id = e.id AND c.email = 'inkoop@albron.nl')
LIMIT 1;
INSERT INTO export_entity_contacts (entity_id, role, name, email, source, confidence, is_primary)
SELECT e.id, 'procurement', 'Inkoop', 'info@hutten.nl', 'manual', 55, TRUE
FROM export_market_entities e
WHERE e.name = 'Hutten Business Catering'
AND NOT EXISTS (SELECT 1 FROM export_entity_contacts c WHERE c.entity_id = e.id AND c.email = 'info@hutten.nl')
LIMIT 1;
INSERT INTO export_entity_contacts (entity_id, role, name, email, source, confidence, is_primary)
SELECT e.id, 'procurement', 'Inkoop', 'info@appel.nl', 'manual', 55, TRUE
FROM export_market_entities e
WHERE e.name = 'Appèl Catering'
AND NOT EXISTS (SELECT 1 FROM export_entity_contacts c WHERE c.entity_id = e.id AND c.email = 'info@appel.nl')
LIMIT 1;
-- Gov sources sample
INSERT INTO export_gov_data_sources (country_iso2, name, category, url)
SELECT v.country_iso2, v.name, v.category, v.url
FROM (VALUES
('NL', 'CBS Open Data BES', 'stats', 'https://opendata.cbs.nl'),
('AW', 'CBS Aruba', 'stats', 'https://www.cbs.aw'),
('CW', 'CBS Curaçao', 'stats', 'https://www.cbs.cw'),
('AE', 'Dubai Pulse', 'stats', 'https://www.dubaipulse.gov.ae'),
('NL', 'TenderNed', 'tenders', 'https://www.tenderned.nl'),
('EU', 'TED Europa', 'tenders', 'https://ted.europa.eu')
) AS v(country_iso2, name, category, url)
WHERE NOT EXISTS (
SELECT 1 FROM export_gov_data_sources g WHERE g.name = v.name AND g.country_iso2 = v.country_iso2
);
-- Geo coordinates for map (fase A)
UPDATE export_market_entities SET lat = 12.108, lon = -68.933 WHERE name = 'EWT / Anur Curaçao';
UPDATE export_market_entities SET lat = 12.524, lon = -70.027 WHERE name = 'Caribbean Overseas';
UPDATE export_market_entities SET lat = 12.524, lon = -70.027 WHERE name = 'Compra Aruba';
UPDATE export_market_entities SET lat = 12.144, lon = -68.265 WHERE name = 'Fresh Supplier Bonaire';
UPDATE export_market_entities SET lat = 12.108, lon = -68.933 WHERE name = 'Ferrara Food Group';
UPDATE export_market_entities SET lat = 51.92, lon = 4.48 WHERE name = 'Pietersz Foodservice';
UPDATE export_market_entities SET lat = 52.09, lon = 5.12 WHERE name = 'Albron Nederland';
UPDATE export_market_entities SET lat = 51.44, lon = 5.48 WHERE name = 'Hutten Business Catering';
UPDATE export_market_entities SET lat = 51.61, lon = 5.55 WHERE name = 'Appèl Catering';
UPDATE export_market_entities SET lat = 52.30, lon = 4.69 WHERE name = 'Vermaat Bedrijfshoreca';
UPDATE export_market_entities SET lat = 52.37, lon = 4.90 WHERE name = 'Sodexo Nederland';
UPDATE export_market_entities SET lat = 52.37, lon = 4.90 WHERE name = 'Eurest Nederland';
+80
View File
@@ -0,0 +1,80 @@
-- Foodlinkk 037: Export Intel phase B — tenders + expanded caterer matrix
CREATE TABLE IF NOT EXISTS export_tenders (
id SERIAL PRIMARY KEY,
external_id VARCHAR(128) UNIQUE NOT NULL,
title VARCHAR(512) NOT NULL,
description TEXT,
country_iso2 CHAR(2),
issuer_name VARCHAR(255),
cpv_codes JSONB DEFAULT '[]'::jsonb,
deadline_at TIMESTAMPTZ,
url VARCHAR(512),
source VARCHAR(64) DEFAULT 'ted',
status VARCHAR(32) DEFAULT 'open',
raw JSONB DEFAULT '{}'::jsonb,
created_at TIMESTAMPTZ DEFAULT NOW(),
updated_at TIMESTAMPTZ DEFAULT NOW()
);
CREATE INDEX IF NOT EXISTS idx_export_tenders_country ON export_tenders(country_iso2);
CREATE INDEX IF NOT EXISTS idx_export_tenders_status ON export_tenders(status);
-- Additional global caterer brands
INSERT INTO export_caterer_brands (code, name, parent_brand_code, hq_country_iso2, website, tier) VALUES
('newrest', 'Newrest Group', NULL, 'FR', 'https://www.newrest.eu', 1),
('ssp', 'SSP Group', NULL, 'GB', 'https://www.foodtravelexperts.com', 1),
('dussmann', 'Dussmann', NULL, 'DE', 'https://www.dussmann.de', 1),
('apetito', 'apetito', NULL, 'DE', 'https://www.apetito.de', 1),
('westbury', 'Westbury Street Holdings', NULL, 'GB', 'https://www.westburystreet.co.uk', 1),
('baxterstorey', 'BaxterStorey', 'westbury', 'GB', 'https://www.baxterstorey.com', 2),
('chco', 'CH&CO', 'compass', 'GB', 'https://www.chandco.uk', 1),
('levy', 'Levy', 'compass', 'US', 'https://www.levyrestaurants.com', 1),
('transguard', 'Transguard Group', NULL, 'AE', 'https://www.transguardgroup.com', 2),
('ecs', 'ECS Catering', NULL, 'NL', 'https://www.ecs-catering.nl', 2)
ON CONFLICT (code) DO NOTHING;
-- EU + GCC presence expansion
INSERT INTO export_caterer_presence (brand_code, country_iso2, local_legal_name, service_lines, procurement_model, supplier_entry_point)
SELECT v.brand_code, v.country_iso2, v.local_name, v.service_lines::jsonb, v.procurement_model, v.supplier_entry_point
FROM (VALUES
('compass', 'DE', 'Compass Group Germany', '["workplace","healthcare"]', 'central_national', 'national_procurement'),
('sodexo', 'DE', 'Sodexo Deutschland', '["workplace","education"]', 'central_national', 'tender_portal'),
('compass', 'BE', 'Compass Group Belgium', '["workplace"]', 'central_national', 'national_procurement'),
('sodexo', 'BE', 'Sodexo Belgium', '["workplace","healthcare"]', 'central_national', 'tender_portal'),
('elior', 'FR', 'Elior Group', '["workplace","education","healthcare"]', 'central_national', 'national_procurement'),
('aramark', 'US', 'Aramark', '["workplace","sports_leisure","education"]', 'central_national', 'national_procurement'),
('compass', 'US', 'Compass Group USA', '["workplace","sports_leisure"]', 'central_national', 'national_procurement'),
('sodexo', 'US', 'Sodexo USA', '["workplace","healthcare"]', 'central_national', 'tender_portal'),
('iss', 'DE', 'ISS Deutschland', '["integrated_fm","workplace"]', 'central_national', 'national_procurement'),
('iss', 'GB', 'ISS UK', '["integrated_fm","workplace"]', 'central_national', 'national_procurement'),
('dussmann', 'DE', 'Dussmann Service Deutschland', '["workplace","healthcare"]', 'central_national', 'national_procurement'),
('apetito', 'DE', 'apetito group', '["healthcare","hospital_patient"]', 'central_national', 'category_manager'),
('apetito', 'NL', 'apetito Nederland', '["healthcare"]', 'central_national', 'category_manager'),
('newrest', 'FR', 'Newrest France', '["travel_hospitality"]', 'central_national', 'national_procurement'),
('ssp', 'GB', 'SSP UK', '["travel_hospitality"]', 'central_national', 'national_procurement'),
('transguard', 'AE', 'Transguard Group', '["integrated_fm","workplace"]', 'central_national', 'national_procurement'),
('sodexo', 'SA', 'Sodexo Saudi Arabia', '["workplace","healthcare"]', 'central_national', 'tender_portal'),
('compass', 'AU', 'Compass Group Australia', '["workplace","sports_leisure"]', 'central_national', 'national_procurement'),
('sodexo', 'AU', 'Sodexo Australia', '["workplace","healthcare"]', 'central_national', 'tender_portal')
) AS v(brand_code, country_iso2, local_name, service_lines, procurement_model, supplier_entry_point)
WHERE NOT EXISTS (
SELECT 1 FROM export_caterer_presence p WHERE p.brand_code = v.brand_code AND p.country_iso2 = v.country_iso2
);
-- More territories (EU core)
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES
('it', 'IT', 'europe', 'Italië', 'Italy', 41.87, 12.57, 6, '[36.6,6.6,47.1,18.5]'::jsonb, 2),
('es', 'ES', 'europe', 'Spanje', 'Spain', 40.46, -3.75, 6, '[36.0,-9.3,43.8,4.3]'::jsonb, 2),
('pl', 'PL', 'europe', 'Polen', 'Poland', 51.92, 19.15, 6, '[49.0,14.1,54.9,24.2]'::jsonb, 2),
('at', 'AT', 'europe', 'Oostenrijk', 'Austria', 47.52, 14.55, 7, '[46.4,9.5,49.0,17.2]'::jsonb, 2),
('ch', 'CH', 'europe', 'Zwitserland', 'Switzerland', 46.82, 8.23, 7, '[45.8,5.9,47.8,10.5]'::jsonb, 2),
('se', 'SE', 'europe', 'Zweden', 'Sweden', 62.0, 15.0, 5, '[55.3,11.1,69.1,24.2]'::jsonb, 2),
('no', 'NO', 'europe', 'Noorwegen', 'Norway', 64.58, 17.5, 5, '[57.9,4.5,71.2,31.1]'::jsonb, 2),
('dk', 'DK', 'europe', 'Denemarken', 'Denmark', 56.0, 10.0, 7, '[54.5,8.0,57.8,15.2]'::jsonb, 2),
('kw', 'KW', 'gcc', 'Koeweit', 'Kuwait', 29.31, 47.48, 8, '[28.5,46.5,30.1,48.5]'::jsonb, 2),
('om', 'OM', 'gcc', 'Oman', 'Oman', 21.0, 57.0, 6, '[16.5,52.0,26.4,59.8]'::jsonb, 2),
('bh', 'BH', 'gcc', 'Bahrein', 'Bahrain', 26.07, 50.55, 9, '[25.8,50.45,26.3,50.7]'::jsonb, 2),
('jm', 'JM', 'caribbean', 'Jamaica', 'Jamaica', 18.11, -77.3, 8, '[17.7,-78.4,18.5,-76.2]'::jsonb, 2),
('tt', 'TT', 'caribbean', 'Trinidad en Tobago', 'Trinidad and Tobago', 10.5, -61.3, 8, '[10.0,-61.9,11.4,-60.5]'::jsonb, 2)
ON CONFLICT (code) DO NOTHING;
+135
View File
@@ -0,0 +1,135 @@
-- Foodlinkk 038: Wereldexport — Europa, Midden-Oosten, Afrika, Amerika
INSERT INTO export_regions (code, name_nl, name_en, sort_order) VALUES ('middle_east', 'Midden-Oosten', 'Middle East', 25) ON CONFLICT (code) DO NOTHING;
UPDATE export_territories SET sync_priority = 2 WHERE country_iso2 IN ('TR', 'MA', 'MY', 'ID', 'AU') AND sync_priority > 2;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('ie', 'IE', 'europe', 'Ierland', 'Ireland', 53.4, -8.0, 7, '[51.4, -10.5, 55.4, -5.5]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('pt', 'PT', 'europe', 'Portugal', 'Portugal', 39.5, -8.0, 6, '[36.9, -9.5, 42.2, -6.2]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('gr', 'GR', 'europe', 'Griekenland', 'Greece', 39.0, 22.0, 6, '[34.8, 19.4, 41.8, 29.6]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('cz', 'CZ', 'europe', 'Tsjechië', 'Czechia', 49.8, 15.5, 7, '[48.5, 12.1, 51.1, 18.9]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('sk', 'SK', 'europe', 'Slowakije', 'Slovakia', 48.7, 19.5, 7, '[47.7, 16.8, 49.6, 22.6]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('hu', 'HU', 'europe', 'Hongarije', 'Hungary', 47.2, 19.5, 7, '[45.7, 16.1, 48.6, 22.9]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('ro', 'RO', 'europe', 'Roemenië', 'Romania', 45.9, 25.0, 6, '[43.6, 20.3, 48.3, 29.7]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('bg', 'BG', 'europe', 'Bulgarije', 'Bulgaria', 42.7, 25.5, 7, '[41.2, 22.4, 44.2, 28.6]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('hr', 'HR', 'europe', 'Kroatië', 'Croatia', 45.1, 15.2, 7, '[42.4, 13.5, 46.5, 19.4]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('si', 'SI', 'europe', 'Slovenië', 'Slovenia', 46.1, 14.8, 8, '[45.4, 13.4, 46.9, 16.6]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('fi', 'FI', 'europe', 'Finland', 'Finland', 64.0, 26.0, 5, '[59.8, 20.6, 70.1, 31.6]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('ee', 'EE', 'europe', 'Estland', 'Estonia', 58.6, 25.0, 7, '[57.5, 21.8, 59.7, 28.2]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('lv', 'LV', 'europe', 'Letland', 'Latvia', 56.9, 24.6, 7, '[55.7, 21.0, 58.1, 28.2]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('lt', 'LT', 'europe', 'Litouwen', 'Lithuania', 55.2, 23.9, 7, '[53.9, 21.0, 56.4, 26.8]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('lu', 'LU', 'europe', 'Luxemburg', 'Luxembourg', 49.8, 6.1, 9, '[49.4, 5.7, 50.2, 6.5]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('mt', 'MT', 'europe', 'Malta', 'Malta', 35.9, 14.4, 10, '[35.8, 14.2, 36.1, 14.6]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('cy', 'CY', 'europe', 'Cyprus', 'Cyprus', 35.1, 33.4, 9, '[34.6, 32.3, 35.7, 34.6]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('ua', 'UA', 'europe', 'Oekraïne', 'Ukraine', 48.4, 31.2, 5, '[44.4, 22.1, 52.4, 40.2]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('rs', 'RS', 'europe', 'Servië', 'Serbia', 44.0, 21.0, 7, '[42.2, 18.8, 46.2, 23.0]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('ba', 'BA', 'europe', 'Bosnië', 'Bosnia', 44.0, 17.7, 7, '[42.6, 15.7, 45.3, 19.6]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('mk', 'MK', 'europe', 'Noord-Macedonië', 'North Macedonia', 41.6, 21.7, 8, '[40.8, 20.5, 42.4, 23.0]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('al', 'AL', 'europe', 'Albanië', 'Albania', 41.2, 20.2, 8, '[39.6, 19.3, 42.7, 21.1]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('me', 'ME', 'europe', 'Montenegro', 'Montenegro', 42.7, 19.4, 8, '[41.8, 18.4, 43.6, 20.4]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('md', 'MD', 'europe', 'Moldavië', 'Moldova', 47.0, 28.8, 7, '[45.5, 26.6, 48.5, 30.2]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('is', 'IS', 'europe', 'IJsland', 'Iceland', 64.9, -19.0, 6, '[63.3, -24.5, 66.5, -13.5]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('li', 'LI', 'europe', 'Liechtenstein', 'Liechtenstein', 47.1, 9.5, 10, '[47.0, 9.5, 47.3, 9.7]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('il', 'IL', 'middle_east', 'Israël', 'Israel', 31.5, 34.9, 7, '[29.5, 34.3, 33.3, 35.9]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('eg', 'EG', 'middle_east', 'Egypte', 'Egypt', 26.8, 30.8, 5, '[22.0, 25.0, 31.7, 35.0]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('jo', 'JO', 'middle_east', 'Jordanië', 'Jordan', 31.2, 36.8, 7, '[29.2, 34.9, 33.4, 39.3]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('lb', 'LB', 'middle_east', 'Libanon', 'Lebanon', 33.9, 35.9, 8, '[33.1, 35.1, 34.7, 36.6]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('iq', 'IQ', 'middle_east', 'Irak', 'Iraq', 33.2, 43.7, 6, '[29.1, 38.8, 37.4, 48.6]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('ir', 'IR', 'middle_east', 'Iran', 'Iran', 32.4, 53.7, 5, '[25.0, 44.0, 39.8, 63.3]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('ye', 'YE', 'middle_east', 'Jemen', 'Yemen', 15.6, 48.0, 6, '[12.1, 42.5, 19.0, 54.5]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('ps', 'PS', 'middle_east', 'Palestina', 'Palestine', 31.9, 35.2, 8, '[31.2, 34.2, 32.6, 35.6]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('sy', 'SY', 'middle_east', 'Syrië', 'Syria', 35.0, 38.5, 6, '[32.3, 35.7, 37.3, 42.4]'::jsonb, 3) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('ly', 'LY', 'middle_east', 'Libië', 'Libya', 26.3, 17.2, 5, '[19.5, 9.3, 33.2, 25.2]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('tn', 'TN', 'middle_east', 'Tunesië', 'Tunisia', 34.0, 9.5, 6, '[30.2, 7.5, 37.5, 11.6]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('dz', 'DZ', 'africa', 'Algerije', 'Algeria', 28.0, 2.6, 5, '[19.0, -8.7, 37.1, 12.0]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('za', 'ZA', 'africa', 'Zuid-Afrika', 'South Africa', -30.6, 22.9, 5, '[-34.8, 16.5, -22.1, 32.9]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('ng', 'NG', 'africa', 'Nigeria', 'Nigeria', 9.1, 8.7, 6, '[4.3, 2.7, 13.9, 14.7]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('ke', 'KE', 'africa', 'Kenia', 'Kenya', -0.02, 37.9, 6, '[-4.7, 33.9, 5.0, 41.9]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('gh', 'GH', 'africa', 'Ghana', 'Ghana', 7.9, -1.0, 6, '[4.7, -3.3, 11.2, 1.2]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('et', 'ET', 'africa', 'Ethiopië', 'Ethiopia', 9.1, 40.5, 5, '[3.4, 33.0, 14.9, 48.0]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('tz', 'TZ', 'africa', 'Tanzania', 'Tanzania', -6.4, 34.9, 6, '[-11.7, 29.3, -0.99, 40.5]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('ug', 'UG', 'africa', 'Oeganda', 'Uganda', 1.4, 32.3, 7, '[-1.5, 29.6, 4.2, 35.0]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('sn', 'SN', 'africa', 'Senegal', 'Senegal', 14.5, -14.5, 7, '[12.3, -17.5, 16.7, -11.4]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('ci', 'CI', 'africa', 'Ivoorkust', 'Côte d''Ivoire', 7.5, -5.5, 6, '[4.4, -8.6, 10.7, -2.5]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('cm', 'CM', 'africa', 'Kameroen', 'Cameroon', 6.6, 12.4, 6, '[1.7, 8.5, 13.1, 16.2]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('ao', 'AO', 'africa', 'Angola', 'Angola', -11.2, 17.9, 5, '[-18.0, 11.7, -4.4, 24.1]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('mz', 'MZ', 'africa', 'Mozambique', 'Mozambique', -18.7, 35.5, 5, '[-26.9, 30.2, -10.5, 40.8]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('zw', 'ZW', 'africa', 'Zimbabwe', 'Zimbabwe', -19.0, 29.2, 6, '[-22.4, 25.2, -15.6, 33.1]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('zm', 'ZM', 'africa', 'Zambia', 'Zambia', -13.1, 27.8, 6, '[-18.1, 22.0, -8.2, 33.7]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('rw', 'RW', 'africa', 'Rwanda', 'Rwanda', -1.9, 30.0, 8, '[-2.8, 28.9, -1.0, 30.9]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('sd', 'SD', 'africa', 'Soedan', 'Sudan', 15.5, 30.2, 5, '[8.7, 21.8, 22.2, 38.6]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('ss', 'SS', 'africa', 'Zuid-Soedan', 'South Sudan', 7.9, 30.0, 6, '[3.5, 23.9, 12.2, 35.9]'::jsonb, 3) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('cd', 'CD', 'africa', 'Congo (DRC)', 'DR Congo', -4.0, 21.8, 5, '[-13.5, 12.2, 5.4, 31.3]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('cg', 'CG', 'africa', 'Congo', 'Congo', -0.7, 15.3, 6, '[-5.0, 11.2, 3.7, 18.6]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('bf', 'BF', 'africa', 'Burkina Faso', 'Burkina Faso', 12.2, -1.6, 6, '[9.4, -5.5, 15.1, 2.4]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('ml', 'ML', 'africa', 'Mali', 'Mali', 17.6, -4.0, 5, '[10.1, -12.2, 25.0, 4.3]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('ne', 'NE', 'africa', 'Niger', 'Niger', 17.6, 8.1, 5, '[11.7, 0.2, 23.5, 16.0]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('td', 'TD', 'africa', 'Tsjaad', 'Chad', 15.5, 18.7, 5, '[7.4, 13.5, 23.5, 24.0]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('so', 'SO', 'africa', 'Somalië', 'Somalia', 5.2, 46.2, 5, '[-1.7, 41.0, 12.0, 51.4]'::jsonb, 3) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('mg', 'MG', 'africa', 'Madagascar', 'Madagascar', -18.8, 46.9, 5, '[-25.6, 43.2, -11.9, 50.5]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('mu', 'MU', 'africa', 'Mauritius', 'Mauritius', -20.3, 57.6, 9, '[-20.5, 57.3, -19.9, 63.5]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('na', 'NA', 'africa', 'Namibië', 'Namibia', -22.6, 17.1, 5, '[-28.0, 11.7, -16.9, 25.3]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('bw', 'BW', 'africa', 'Botswana', 'Botswana', -22.3, 24.7, 6, '[-26.9, 20.0, -17.8, 29.4]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('ga', 'GA', 'africa', 'Gabon', 'Gabon', -0.8, 11.6, 6, '[-4.0, 8.7, 2.3, 14.5]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('gn', 'GN', 'africa', 'Guinee', 'Guinea', 9.9, -11.7, 6, '[7.2, -15.1, 12.7, -7.6]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('bj', 'BJ', 'africa', 'Benin', 'Benin', 9.3, 2.3, 7, '[6.2, 0.8, 12.4, 3.9]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('tg', 'TG', 'africa', 'Togo', 'Togo', 8.6, 1.0, 7, '[6.1, -0.1, 11.1, 1.8]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('lr', 'LR', 'africa', 'Liberia', 'Liberia', 6.4, -9.4, 7, '[4.3, -11.5, 8.6, -7.4]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('sl', 'SL', 'africa', 'Sierra Leone', 'Sierra Leone', 8.5, -11.8, 7, '[6.9, -13.3, 10.0, -10.3]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('mr', 'MR', 'africa', 'Mauritanië', 'Mauritania', 21.0, -10.9, 5, '[14.7, -17.1, 27.3, -4.8]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('er', 'ER', 'africa', 'Eritrea', 'Eritrea', 15.2, 39.8, 7, '[12.4, 36.4, 18.0, 43.1]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('dj', 'DJ', 'africa', 'Djibouti', 'Djibouti', 11.8, 42.6, 8, '[10.9, 41.8, 12.7, 43.4]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('mw', 'MW', 'africa', 'Malawi', 'Malawi', -13.3, 34.3, 7, '[-17.1, 32.7, -9.4, 35.9]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('ls', 'LS', 'africa', 'Lesotho', 'Lesotho', -29.6, 28.2, 8, '[-30.7, 27.0, -28.6, 29.5]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('sz', 'SZ', 'africa', 'Eswatini', 'Eswatini', -26.5, 31.5, 8, '[-27.3, 30.8, -25.7, 32.1]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('cv', 'CV', 'africa', 'Kaapverdië', 'Cape Verde', 16.0, -24.0, 8, '[14.8, -25.4, 17.2, -22.7]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('gq', 'GQ', 'africa', 'Equatoriaal-Guinea', 'Equatorial Guinea', 1.7, 10.3, 8, '[0.9, 9.3, 3.8, 11.3]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('st', 'ST', 'africa', 'São Tomé', 'São Tomé', 0.3, 6.6, 9, '[0.0, 6.5, 1.7, 7.5]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('sc', 'SC', 'africa', 'Seychellen', 'Seychelles', -4.7, 55.5, 9, '[-10.0, 46.0, -3.7, 56.3]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('km', 'KM', 'africa', 'Comoren', 'Comoros', -11.9, 43.9, 9, '[-12.4, 43.2, -11.4, 44.5]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('bi', 'BI', 'africa', 'Burundi', 'Burundi', -3.4, 29.9, 8, '[-4.5, 29.0, -2.3, 30.8]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('cf', 'CF', 'africa', 'Centraal-Afrika', 'Central African Rep.', 6.6, 20.9, 6, '[2.2, 14.4, 11.0, 27.5]'::jsonb, 3) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('gm', 'GM', 'africa', 'Gambia', 'Gambia', 13.4, -15.3, 8, '[13.1, -16.8, 13.8, -13.8]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('gw', 'GW', 'africa', 'Guinee-Bissau', 'Guinea-Bissau', 11.8, -15.2, 8, '[10.9, -16.7, 12.7, -13.6]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('ca', 'CA', 'americas', 'Canada', 'Canada', 56.1, -96.8, 4, '[41.7, -141.0, 83.1, -52.6]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('mx', 'MX', 'americas', 'Mexico', 'Mexico', 23.6, -102.6, 5, '[14.5, -118.4, 32.7, -86.7]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('br', 'BR', 'americas', 'Brazilië', 'Brazil', -14.2, -51.9, 4, '[-33.8, -73.9, 5.3, -34.8]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('ar', 'AR', 'americas', 'Argentinië', 'Argentina', -38.4, -63.6, 4, '[-55.1, -73.6, -21.8, -53.6]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('co', 'CO', 'americas', 'Colombia', 'Colombia', 4.6, -74.3, 5, '[-4.2, -79.0, 12.5, -66.9]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('cl', 'CL', 'americas', 'Chili', 'Chile', -35.7, -71.5, 4, '[-55.9, -75.6, -17.5, -66.4]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('pe', 'PE', 'americas', 'Peru', 'Peru', -9.2, -75.0, 5, '[-18.3, -81.3, -0.0, -68.7]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('ve', 'VE', 'americas', 'Venezuela', 'Venezuela', 6.4, -66.6, 5, '[0.6, -73.4, 12.2, -59.8]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('ec', 'EC', 'americas', 'Ecuador', 'Ecuador', -1.8, -78.2, 6, '[-5.0, -81.1, 1.5, -75.2]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('bo', 'BO', 'americas', 'Bolivia', 'Bolivia', -16.3, -63.6, 5, '[-22.9, -69.6, -9.7, -57.5]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('py', 'PY', 'americas', 'Paraguay', 'Paraguay', -23.4, -58.4, 6, '[-27.6, -62.6, -19.3, -54.3]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('uy', 'UY', 'americas', 'Uruguay', 'Uruguay', -32.5, -55.8, 7, '[-35.0, -58.4, -30.1, -53.1]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('gt', 'GT', 'americas', 'Guatemala', 'Guatemala', 15.8, -90.2, 7, '[13.7, -92.2, 17.8, -88.2]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('hn', 'HN', 'americas', 'Honduras', 'Honduras', 14.6, -86.2, 7, '[12.9, -89.4, 16.5, -83.1]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('sv', 'SV', 'americas', 'El Salvador', 'El Salvador', 13.7, -88.9, 8, '[13.1, -90.1, 14.4, -87.7]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('ni', 'NI', 'americas', 'Nicaragua', 'Nicaragua', 12.9, -85.0, 7, '[10.7, -87.7, 15.0, -82.7]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('cr', 'CR', 'americas', 'Costa Rica', 'Costa Rica', 9.7, -84.0, 7, '[8.0, -85.9, 11.2, -82.6]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('pa', 'PA', 'americas', 'Panama', 'Panama', 8.5, -80.8, 7, '[7.2, -83.0, 9.6, -77.2]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('bz', 'BZ', 'americas', 'Belize', 'Belize', 17.2, -88.7, 8, '[15.9, -89.2, 18.5, -87.8]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('cu', 'CU', 'americas', 'Cuba', 'Cuba', 21.5, -79.0, 6, '[19.8, -84.9, 23.3, -74.1]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('do', 'DO', 'americas', 'Dominicaanse Rep.', 'Dominican Republic', 18.7, -70.2, 7, '[17.5, -72.0, 19.9, -68.3]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('ht', 'HT', 'americas', 'Haïti', 'Haiti', 18.9, -72.3, 8, '[18.0, -74.5, 20.1, -71.6]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('pr', 'PR', 'americas', 'Puerto Rico', 'Puerto Rico', 18.2, -66.5, 8, '[17.9, -67.9, 18.5, -65.2]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('bs', 'BS', 'caribbean', 'Bahama''s', 'Bahamas', 25.0, -77.4, 7, '[20.9, -78.9, 27.3, -72.7]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('bb', 'BB', 'caribbean', 'Barbados', 'Barbados', 13.2, -59.5, 10, '[13.0, -59.7, 13.3, -59.4]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('gd', 'GD', 'caribbean', 'Grenada', 'Grenada', 12.1, -61.7, 10, '[11.9, -61.8, 12.5, -61.4]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('lc', 'LC', 'caribbean', 'Saint Lucia', 'Saint Lucia', 13.9, -60.9, 10, '[13.7, -61.1, 14.1, -60.9]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('gy', 'GY', 'americas', 'Guyana', 'Guyana', 4.9, -58.9, 6, '[1.2, -61.4, 8.6, -56.5]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_territories (code, country_iso2, region_code, name_nl, name_en, lat, lon, map_zoom, bbox, sync_priority) VALUES ('sr', 'SR', 'americas', 'Suriname', 'Suriname', 3.9, -56.0, 7, '[1.8, -58.1, 6.0, -53.9]'::jsonb, 2) ON CONFLICT (code) DO UPDATE SET region_code=EXCLUDED.region_code, name_nl=EXCLUDED.name_nl, name_en=EXCLUDED.name_en, lat=EXCLUDED.lat, lon=EXCLUDED.lon, map_zoom=EXCLUDED.map_zoom, bbox=EXCLUDED.bbox, sync_priority=EXCLUDED.sync_priority, is_active=TRUE;
INSERT INTO export_caterer_presence (brand_code, country_iso2, local_legal_name, service_lines, procurement_model, supplier_entry_point)
SELECT v.brand_code, v.country_iso2, v.local_name, v.service_lines::jsonb, v.procurement_model, v.supplier_entry_point FROM (VALUES
('compass', 'ZA', 'Compass Group South Africa', '["workplace"]', 'central_national', 'national_procurement'),
('sodexo', 'ZA', 'Sodexo South Africa', '["workplace","healthcare"]', 'central_national', 'tender_portal'),
('compass', 'BR', 'Compass Group Brazil', '["workplace"]', 'central_national', 'national_procurement'),
('sodexo', 'BR', 'Sodexo Brazil', '["workplace"]', 'central_national', 'tender_portal'),
('aramark', 'MX', 'Aramark Mexico', '["workplace"]', 'central_national', 'national_procurement'),
('compass', 'CA', 'Compass Group Canada', '["workplace"]', 'central_national', 'national_procurement'),
('sodexo', 'EG', 'Sodexo Egypt', '["workplace"]', 'central_national', 'tender_portal'),
('sodexo', 'NG', 'Sodexo Nigeria', '["workplace"]', 'central_national', 'tender_portal'),
('sodexo', 'KE', 'Sodexo Kenya', '["workplace"]', 'central_national', 'tender_portal')
) AS v(brand_code, country_iso2, local_name, service_lines, procurement_model, supplier_entry_point)
WHERE NOT EXISTS (SELECT 1 FROM export_caterer_presence p WHERE p.brand_code = v.brand_code AND p.country_iso2 = v.country_iso2);
@@ -0,0 +1,12 @@
-- Export Intel: favorieten + CRM koppeling metadata
ALTER TABLE export_market_entities
ADD COLUMN IF NOT EXISTS is_favorite BOOLEAN NOT NULL DEFAULT FALSE,
ADD COLUMN IF NOT EXISTS favorited_at TIMESTAMPTZ,
ADD COLUMN IF NOT EXISTS crm_pushed_at TIMESTAMPTZ;
CREATE INDEX IF NOT EXISTS idx_export_entities_favorite
ON export_market_entities(is_favorite) WHERE is_favorite = TRUE;
CREATE INDEX IF NOT EXISTS idx_export_entities_crm_client
ON export_market_entities(client_id) WHERE client_id IS NOT NULL;