10991 lines
410 KiB
JSON
10991 lines
410 KiB
JSON
{
|
|
"schema": "public",
|
|
"extensions": [
|
|
"postgis",
|
|
"pgcrypto"
|
|
],
|
|
"tables": [
|
|
{
|
|
"name": "organizations",
|
|
"domain": "Identidade",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "name",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "name text NOT NULL",
|
|
"description": "name"
|
|
},
|
|
{
|
|
"name": "organization_type",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "organization_type text NOT NULL",
|
|
"description": "organization type"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_001000_investmoz_identity.php",
|
|
"purpose": "Registar organizações institucionais, empresariais e educativas",
|
|
"source": "A.26",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')",
|
|
"organization_type IN ('public','private','ngo','education')"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.organizations (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n name text NOT NULL,\n organization_type text NOT NULL,\n CONSTRAINT imz_organizations_pk PRIMARY KEY (id),\n CONSTRAINT imz_organizations_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_organizations_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted')),\n CONSTRAINT imz_organizations_check_03 CHECK (organization_type IN ('public','private','ngo','education'))\n);"
|
|
},
|
|
{
|
|
"name": "memberships",
|
|
"domain": "Identidade",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "user_id",
|
|
"type": "bigint",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "user_id bigint NOT NULL CONSTRAINT imz_memberships_user_id_fk REFERENCES public.users(id) ON DELETE CASCADE ON UPDATE CASCADE",
|
|
"description": "user id"
|
|
},
|
|
{
|
|
"name": "organization_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "organization_id uuid NOT NULL CONSTRAINT imz_memberships_organization_id_fk REFERENCES public.organizations(id) ON DELETE CASCADE ON UPDATE CASCADE",
|
|
"description": "organization id"
|
|
},
|
|
{
|
|
"name": "role",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "role text NOT NULL",
|
|
"description": "role"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_001000_investmoz_identity.php",
|
|
"purpose": "Associar utilizadores a organizações e ao respectivo papel",
|
|
"source": "A.26",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')",
|
|
"role IN ('admin','manager','officer','viewer')"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.memberships (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n user_id bigint NOT NULL CONSTRAINT imz_memberships_user_id_fk REFERENCES public.users(id) ON DELETE CASCADE ON UPDATE CASCADE,\n organization_id uuid NOT NULL CONSTRAINT imz_memberships_organization_id_fk REFERENCES public.organizations(id) ON DELETE CASCADE ON UPDATE CASCADE,\n role text NOT NULL,\n CONSTRAINT imz_memberships_pk PRIMARY KEY (id),\n CONSTRAINT imz_memberships_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_memberships_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted')),\n CONSTRAINT imz_memberships_check_03 CHECK (role IN ('admin','manager','officer','viewer'))\n);"
|
|
},
|
|
{
|
|
"name": "consents",
|
|
"domain": "Identidade",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "user_id",
|
|
"type": "bigint",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "user_id bigint CONSTRAINT imz_consents_user_id_fk REFERENCES public.users(id) ON DELETE SET NULL ON UPDATE CASCADE",
|
|
"description": "user id"
|
|
},
|
|
{
|
|
"name": "subject_ref",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "subject_ref text NOT NULL",
|
|
"description": "subject ref"
|
|
},
|
|
{
|
|
"name": "purpose",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "purpose text NOT NULL",
|
|
"description": "purpose"
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "status text NOT NULL",
|
|
"description": "status"
|
|
},
|
|
{
|
|
"name": "granted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "granted_at timestamptz",
|
|
"description": "granted at"
|
|
},
|
|
{
|
|
"name": "withdrawn_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "withdrawn_at timestamptz",
|
|
"description": "withdrawn at"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_001000_investmoz_identity.php",
|
|
"purpose": "Registar concessão e retirada de consentimentos por finalidade",
|
|
"source": "A.26",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')",
|
|
"status IN ('granted','withdrawn','expired')"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.consents (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n user_id bigint CONSTRAINT imz_consents_user_id_fk REFERENCES public.users(id) ON DELETE SET NULL ON UPDATE CASCADE,\n subject_ref text NOT NULL,\n purpose text NOT NULL,\n status text NOT NULL,\n granted_at timestamptz,\n withdrawn_at timestamptz,\n CONSTRAINT imz_consents_pk PRIMARY KEY (id),\n CONSTRAINT imz_consents_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_consents_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted')),\n CONSTRAINT imz_consents_check_03 CHECK (status IN ('granted','withdrawn','expired'))\n);"
|
|
},
|
|
{
|
|
"name": "documents",
|
|
"domain": "Conteúdos",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "file_name",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "file_name text NOT NULL",
|
|
"description": "file name"
|
|
},
|
|
{
|
|
"name": "media_type",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "media_type text NOT NULL",
|
|
"description": "media type"
|
|
},
|
|
{
|
|
"name": "storage_key",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "storage_key text NOT NULL",
|
|
"description": "storage key"
|
|
},
|
|
{
|
|
"name": "sha256",
|
|
"type": "char(64)",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "sha256 char(64) NOT NULL",
|
|
"description": "sha256"
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "status text NOT NULL",
|
|
"description": "status"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_002000_investmoz_content.php",
|
|
"purpose": "Catalogar ficheiros, classificação e estado de quarentena",
|
|
"source": "A.26",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')",
|
|
"status IN ('active','quarantined','deleted')",
|
|
"sha256 ~ '^[0-9a-f]{64}$'"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.documents (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n file_name text NOT NULL,\n media_type text NOT NULL,\n storage_key text NOT NULL,\n sha256 char(64) NOT NULL,\n status text NOT NULL,\n CONSTRAINT imz_documents_pk PRIMARY KEY (id),\n CONSTRAINT imz_documents_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_documents_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted')),\n CONSTRAINT imz_documents_check_03 CHECK (status IN ('active','quarantined','deleted')),\n CONSTRAINT imz_documents_check_04 CHECK (sha256 ~ '^[0-9a-f]{64}$')\n);"
|
|
},
|
|
{
|
|
"name": "geo_locations",
|
|
"domain": "Geografia",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "name",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "name text NOT NULL",
|
|
"description": "name"
|
|
},
|
|
{
|
|
"name": "location_type",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "location_type text NOT NULL",
|
|
"description": "location type"
|
|
},
|
|
{
|
|
"name": "parent_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "parent_id uuid CONSTRAINT imz_geo_locations_parent_id_fk REFERENCES public.geo_locations(id) ON DELETE RESTRICT ON UPDATE CASCADE",
|
|
"description": "parent id"
|
|
},
|
|
{
|
|
"name": "code",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "code text NOT NULL",
|
|
"description": "code"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_003000_investmoz_geography.php",
|
|
"purpose": "Representar a hierarquia territorial",
|
|
"source": "A.25",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')",
|
|
"location_type IN ('country','province','district','municipality','site')"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.geo_locations (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n name text NOT NULL,\n location_type text NOT NULL,\n parent_id uuid CONSTRAINT imz_geo_locations_parent_id_fk REFERENCES public.geo_locations(id) ON DELETE RESTRICT ON UPDATE CASCADE,\n code text NOT NULL,\n CONSTRAINT imz_geo_locations_pk PRIMARY KEY (id),\n CONSTRAINT imz_geo_locations_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_geo_locations_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted')),\n CONSTRAINT imz_geo_locations_check_03 CHECK (location_type IN ('country','province','district','municipality','site'))\n);"
|
|
},
|
|
{
|
|
"name": "geo_geometries",
|
|
"domain": "Geografia",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "geo_location_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "geo_location_id uuid NOT NULL CONSTRAINT imz_geo_geometries_geo_location_id_fk REFERENCES public.geo_locations(id) ON DELETE CASCADE ON UPDATE CASCADE",
|
|
"description": "geo location id"
|
|
},
|
|
{
|
|
"name": "geometry_type",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "geometry_type text NOT NULL",
|
|
"description": "geometry type"
|
|
},
|
|
{
|
|
"name": "geom",
|
|
"type": "geometry(Geometry,4326)",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "geom geometry(Geometry,4326) NOT NULL",
|
|
"description": "geom"
|
|
},
|
|
{
|
|
"name": "properties",
|
|
"type": "jsonb",
|
|
"nullable": false,
|
|
"default": "'{}'::jsonb",
|
|
"definition": "properties jsonb NOT NULL DEFAULT '{}'::jsonb",
|
|
"description": "properties"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_003000_investmoz_geography.php",
|
|
"purpose": "Armazenar geometrias válidas das localizações",
|
|
"source": "A.25",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')",
|
|
"geometry_type IN ('point','line','polygon','multipolygon')",
|
|
"ST_SRID(geom) = 4326",
|
|
"ST_NDims(geom) = 2",
|
|
"NOT ST_IsEmpty(geom)",
|
|
"ST_IsValid(geom)",
|
|
"(geometry_type = 'point' AND GeometryType(geom) = 'POINT') OR (geometry_type = 'line' AND GeometryType(geom) = 'LINESTRING') OR (geometry_type = 'polygon' AND GeometryType(geom) = 'POLYGON') OR (geometry_type = 'multipolygon' AND GeometryType(geom) = 'MULTIPOLYGON')",
|
|
"ST_XMin(Box3D(geom)) >= -180 AND ST_XMax(Box3D(geom)) <= 180 AND ST_YMin(Box3D(geom)) >= -90 AND ST_YMax(Box3D(geom)) <= 90"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.geo_geometries (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n geo_location_id uuid NOT NULL CONSTRAINT imz_geo_geometries_geo_location_id_fk REFERENCES public.geo_locations(id) ON DELETE CASCADE ON UPDATE CASCADE,\n geometry_type text NOT NULL,\n geom geometry(Geometry,4326) NOT NULL,\n properties jsonb NOT NULL DEFAULT '{}'::jsonb,\n CONSTRAINT imz_geo_geometries_pk PRIMARY KEY (id),\n CONSTRAINT imz_geo_geometries_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_geo_geometries_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted')),\n CONSTRAINT imz_geo_geometries_check_03 CHECK (geometry_type IN ('point','line','polygon','multipolygon')),\n CONSTRAINT imz_geo_geometries_check_04 CHECK (ST_SRID(geom) = 4326),\n CONSTRAINT imz_geo_geometries_check_05 CHECK (ST_NDims(geom) = 2),\n CONSTRAINT imz_geo_geometries_check_06 CHECK (NOT ST_IsEmpty(geom)),\n CONSTRAINT imz_geo_geometries_check_07 CHECK (ST_IsValid(geom)),\n CONSTRAINT imz_geo_geometries_check_08 CHECK ((geometry_type = 'point' AND GeometryType(geom) = 'POINT') OR (geometry_type = 'line' AND GeometryType(geom) = 'LINESTRING') OR (geometry_type = 'polygon' AND GeometryType(geom) = 'POLYGON') OR (geometry_type = 'multipolygon' AND GeometryType(geom) = 'MULTIPOLYGON')),\n CONSTRAINT imz_geo_geometries_check_09 CHECK (ST_XMin(Box3D(geom)) >= -180 AND ST_XMax(Box3D(geom)) <= 180 AND ST_YMin(Box3D(geom)) >= -90 AND ST_YMax(Box3D(geom)) <= 90)\n);"
|
|
},
|
|
{
|
|
"name": "projects",
|
|
"domain": "Projectos",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "code",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "code text NOT NULL",
|
|
"description": "code"
|
|
},
|
|
{
|
|
"name": "name",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "name text NOT NULL",
|
|
"description": "name"
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "status text NOT NULL",
|
|
"description": "status"
|
|
},
|
|
{
|
|
"name": "description",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "description text",
|
|
"description": "description"
|
|
},
|
|
{
|
|
"name": "budget_amount",
|
|
"type": "numeric(20,2)",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "budget_amount numeric(20,2)",
|
|
"description": "budget amount"
|
|
},
|
|
{
|
|
"name": "budget_currency",
|
|
"type": "char(3)",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "budget_currency char(3)",
|
|
"description": "budget currency"
|
|
},
|
|
{
|
|
"name": "start_date",
|
|
"type": "date",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "start_date date",
|
|
"description": "start date"
|
|
},
|
|
{
|
|
"name": "end_date",
|
|
"type": "date",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "end_date date",
|
|
"description": "end date"
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": "jsonb",
|
|
"nullable": false,
|
|
"default": "'{}'::jsonb",
|
|
"definition": "metadata jsonb NOT NULL DEFAULT '{}'::jsonb",
|
|
"description": "metadata"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_004000_investmoz_projects.php",
|
|
"purpose": "Registar projectos de investimento e orçamento",
|
|
"source": "A.25",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')",
|
|
"status IN ('draft','planned','active','suspended','completed','cancelled')",
|
|
"budget_amount IS NULL OR budget_amount >= 0",
|
|
"end_date IS NULL OR start_date IS NULL OR end_date >= start_date",
|
|
"(budget_amount IS NULL) = (budget_currency IS NULL)",
|
|
"budget_currency IS NULL OR budget_currency ~ '^[A-Z]{3}$'"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.projects (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n code text NOT NULL,\n name text NOT NULL,\n status text NOT NULL,\n description text,\n budget_amount numeric(20,2),\n budget_currency char(3),\n start_date date,\n end_date date,\n metadata jsonb NOT NULL DEFAULT '{}'::jsonb,\n CONSTRAINT imz_projects_pk PRIMARY KEY (id),\n CONSTRAINT imz_projects_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_projects_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted')),\n CONSTRAINT imz_projects_check_03 CHECK (status IN ('draft','planned','active','suspended','completed','cancelled')),\n CONSTRAINT imz_projects_check_04 CHECK (budget_amount IS NULL OR budget_amount >= 0),\n CONSTRAINT imz_projects_check_05 CHECK (end_date IS NULL OR start_date IS NULL OR end_date >= start_date),\n CONSTRAINT imz_projects_check_06 CHECK ((budget_amount IS NULL) = (budget_currency IS NULL)),\n CONSTRAINT imz_projects_check_07 CHECK (budget_currency IS NULL OR budget_currency ~ '^[A-Z]{3}$')\n);"
|
|
},
|
|
{
|
|
"name": "project_locations",
|
|
"domain": "Projectos",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "project_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "project_id uuid NOT NULL CONSTRAINT imz_project_locations_project_id_fk REFERENCES public.projects(id) ON DELETE CASCADE ON UPDATE CASCADE",
|
|
"description": "project id"
|
|
},
|
|
{
|
|
"name": "geo_location_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "geo_location_id uuid NOT NULL CONSTRAINT imz_project_locations_geo_location_id_fk REFERENCES public.geo_locations(id) ON DELETE RESTRICT ON UPDATE CASCADE",
|
|
"description": "geo location id"
|
|
},
|
|
{
|
|
"name": "role",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "role text NOT NULL",
|
|
"description": "role"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_004000_investmoz_projects.php",
|
|
"purpose": "Associar projectos a localizações por função",
|
|
"source": "A.25",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')",
|
|
"role IN ('primary','secondary','impact')"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.project_locations (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n project_id uuid NOT NULL CONSTRAINT imz_project_locations_project_id_fk REFERENCES public.projects(id) ON DELETE CASCADE ON UPDATE CASCADE,\n geo_location_id uuid NOT NULL CONSTRAINT imz_project_locations_geo_location_id_fk REFERENCES public.geo_locations(id) ON DELETE RESTRICT ON UPDATE CASCADE,\n role text NOT NULL,\n CONSTRAINT imz_project_locations_pk PRIMARY KEY (id),\n CONSTRAINT imz_project_locations_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_project_locations_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted')),\n CONSTRAINT imz_project_locations_check_03 CHECK (role IN ('primary','secondary','impact'))\n);"
|
|
},
|
|
{
|
|
"name": "economic_clusters",
|
|
"domain": "Clusters e cadeias",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "code",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "code text NOT NULL",
|
|
"description": "code"
|
|
},
|
|
{
|
|
"name": "name",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "name text NOT NULL",
|
|
"description": "name"
|
|
},
|
|
{
|
|
"name": "sector",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "sector text NOT NULL",
|
|
"description": "sector"
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "status text NOT NULL",
|
|
"description": "status"
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": "jsonb",
|
|
"nullable": false,
|
|
"default": "'{}'::jsonb",
|
|
"definition": "metadata jsonb NOT NULL DEFAULT '{}'::jsonb",
|
|
"description": "metadata"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php",
|
|
"purpose": "Registar clusters económicos",
|
|
"source": "A.25",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')",
|
|
"status IN ('planned','active','inactive')"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.economic_clusters (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n code text NOT NULL,\n name text NOT NULL,\n sector text NOT NULL,\n status text NOT NULL,\n metadata jsonb NOT NULL DEFAULT '{}'::jsonb,\n CONSTRAINT imz_economic_clusters_pk PRIMARY KEY (id),\n CONSTRAINT imz_economic_clusters_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_economic_clusters_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted')),\n CONSTRAINT imz_economic_clusters_check_03 CHECK (status IN ('planned','active','inactive'))\n);"
|
|
},
|
|
{
|
|
"name": "value_chains",
|
|
"domain": "Clusters e cadeias",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "cluster_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "cluster_id uuid NOT NULL CONSTRAINT imz_value_chains_cluster_id_fk REFERENCES public.economic_clusters(id) ON DELETE CASCADE ON UPDATE CASCADE",
|
|
"description": "cluster id"
|
|
},
|
|
{
|
|
"name": "code",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "code text NOT NULL",
|
|
"description": "code"
|
|
},
|
|
{
|
|
"name": "name",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "name text NOT NULL",
|
|
"description": "name"
|
|
},
|
|
{
|
|
"name": "stage",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "stage text NOT NULL",
|
|
"description": "stage"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php",
|
|
"purpose": "Registar cadeias de valor de cada cluster",
|
|
"source": "A.25",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')",
|
|
"stage IN ('input','production','processing','logistics','market')"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.value_chains (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n cluster_id uuid NOT NULL CONSTRAINT imz_value_chains_cluster_id_fk REFERENCES public.economic_clusters(id) ON DELETE CASCADE ON UPDATE CASCADE,\n code text NOT NULL,\n name text NOT NULL,\n stage text NOT NULL,\n CONSTRAINT imz_value_chains_pk PRIMARY KEY (id),\n CONSTRAINT imz_value_chains_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_value_chains_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted')),\n CONSTRAINT imz_value_chains_check_03 CHECK (stage IN ('input','production','processing','logistics','market'))\n);"
|
|
},
|
|
{
|
|
"name": "value_chain_links",
|
|
"domain": "Clusters e cadeias",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "from_value_chain_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "from_value_chain_id uuid NOT NULL CONSTRAINT imz_value_chain_links_from_value_chain_id_fk REFERENCES public.value_chains(id) ON DELETE CASCADE ON UPDATE CASCADE",
|
|
"description": "from value chain id"
|
|
},
|
|
{
|
|
"name": "to_value_chain_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "to_value_chain_id uuid NOT NULL CONSTRAINT imz_value_chain_links_to_value_chain_id_fk REFERENCES public.value_chains(id) ON DELETE CASCADE ON UPDATE CASCADE",
|
|
"description": "to value chain id"
|
|
},
|
|
{
|
|
"name": "link_type",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "link_type text NOT NULL",
|
|
"description": "link type"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php",
|
|
"purpose": "Associar cadeias por tipo de ligação",
|
|
"source": "A.25",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')",
|
|
"link_type IN ('supplies','processes','distributes','supports')",
|
|
"from_value_chain_id <> to_value_chain_id"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.value_chain_links (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n from_value_chain_id uuid NOT NULL CONSTRAINT imz_value_chain_links_from_value_chain_id_fk REFERENCES public.value_chains(id) ON DELETE CASCADE ON UPDATE CASCADE,\n to_value_chain_id uuid NOT NULL CONSTRAINT imz_value_chain_links_to_value_chain_id_fk REFERENCES public.value_chains(id) ON DELETE CASCADE ON UPDATE CASCADE,\n link_type text NOT NULL,\n CONSTRAINT imz_value_chain_links_pk PRIMARY KEY (id),\n CONSTRAINT imz_value_chain_links_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_value_chain_links_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted')),\n CONSTRAINT imz_value_chain_links_check_03 CHECK (link_type IN ('supplies','processes','distributes','supports')),\n CONSTRAINT imz_value_chain_links_check_04 CHECK (from_value_chain_id <> to_value_chain_id)\n);"
|
|
},
|
|
{
|
|
"name": "cluster_projects",
|
|
"domain": "Clusters e cadeias",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "cluster_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "cluster_id uuid NOT NULL CONSTRAINT imz_cluster_projects_cluster_id_fk REFERENCES public.economic_clusters(id) ON DELETE CASCADE ON UPDATE CASCADE",
|
|
"description": "cluster id"
|
|
},
|
|
{
|
|
"name": "project_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "project_id uuid NOT NULL CONSTRAINT imz_cluster_projects_project_id_fk REFERENCES public.projects(id) ON DELETE CASCADE ON UPDATE CASCADE",
|
|
"description": "project id"
|
|
},
|
|
{
|
|
"name": "role",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "role text NOT NULL",
|
|
"description": "role"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php",
|
|
"purpose": "Associar projectos a clusters",
|
|
"source": "A.25",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')",
|
|
"role IN ('anchor','complementary','supporting')"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.cluster_projects (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n cluster_id uuid NOT NULL CONSTRAINT imz_cluster_projects_cluster_id_fk REFERENCES public.economic_clusters(id) ON DELETE CASCADE ON UPDATE CASCADE,\n project_id uuid NOT NULL CONSTRAINT imz_cluster_projects_project_id_fk REFERENCES public.projects(id) ON DELETE CASCADE ON UPDATE CASCADE,\n role text NOT NULL,\n CONSTRAINT imz_cluster_projects_pk PRIMARY KEY (id),\n CONSTRAINT imz_cluster_projects_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_cluster_projects_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted')),\n CONSTRAINT imz_cluster_projects_check_03 CHECK (role IN ('anchor','complementary','supporting'))\n);"
|
|
},
|
|
{
|
|
"name": "anchor_project_links",
|
|
"domain": "Clusters e cadeias",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "anchor_project_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "anchor_project_id uuid NOT NULL CONSTRAINT imz_anchor_project_links_anchor_project_id_fk REFERENCES public.projects(id) ON DELETE CASCADE ON UPDATE CASCADE",
|
|
"description": "anchor project id"
|
|
},
|
|
{
|
|
"name": "cluster_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "cluster_id uuid NOT NULL CONSTRAINT imz_anchor_project_links_cluster_id_fk REFERENCES public.economic_clusters(id) ON DELETE CASCADE ON UPDATE CASCADE",
|
|
"description": "cluster id"
|
|
},
|
|
{
|
|
"name": "rationale",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "rationale text NOT NULL",
|
|
"description": "rationale"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php",
|
|
"purpose": "Justificar projectos âncora de clusters",
|
|
"source": "A.25",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.anchor_project_links (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n anchor_project_id uuid NOT NULL CONSTRAINT imz_anchor_project_links_anchor_project_id_fk REFERENCES public.projects(id) ON DELETE CASCADE ON UPDATE CASCADE,\n cluster_id uuid NOT NULL CONSTRAINT imz_anchor_project_links_cluster_id_fk REFERENCES public.economic_clusters(id) ON DELETE CASCADE ON UPDATE CASCADE,\n rationale text NOT NULL,\n CONSTRAINT imz_anchor_project_links_pk PRIMARY KEY (id),\n CONSTRAINT imz_anchor_project_links_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_anchor_project_links_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted'))\n);"
|
|
},
|
|
{
|
|
"name": "complementary_project_links",
|
|
"domain": "Clusters e cadeias",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "anchor_project_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "anchor_project_id uuid NOT NULL CONSTRAINT imz_complementary_project_links_anchor_project_id_fk REFERENCES public.projects(id) ON DELETE CASCADE ON UPDATE CASCADE",
|
|
"description": "anchor project id"
|
|
},
|
|
{
|
|
"name": "complementary_project_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "complementary_project_id uuid NOT NULL CONSTRAINT imz_complementary_project_links_complementary_project_id_fk REFERENCES public.projects(id) ON DELETE CASCADE ON UPDATE CASCADE",
|
|
"description": "complementary project id"
|
|
},
|
|
{
|
|
"name": "relation_type",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "relation_type text NOT NULL",
|
|
"description": "relation type"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php",
|
|
"purpose": "Relacionar projectos âncora e complementares",
|
|
"source": "A.25",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')",
|
|
"relation_type IN ('dependency','enabler','supplier','market')",
|
|
"anchor_project_id<>complementary_project_id"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.complementary_project_links (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n anchor_project_id uuid NOT NULL CONSTRAINT imz_complementary_project_links_anchor_project_id_fk REFERENCES public.projects(id) ON DELETE CASCADE ON UPDATE CASCADE,\n complementary_project_id uuid NOT NULL CONSTRAINT imz_complementary_project_links_complementary_project_id_fk REFERENCES public.projects(id) ON DELETE CASCADE ON UPDATE CASCADE,\n relation_type text NOT NULL,\n CONSTRAINT imz_complementary_project_links_pk PRIMARY KEY (id),\n CONSTRAINT imz_complementary_project_links_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_complementary_project_links_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted')),\n CONSTRAINT imz_complementary_project_links_check_03 CHECK (relation_type IN ('dependency','enabler','supplier','market')),\n CONSTRAINT imz_complementary_project_links_check_04 CHECK (anchor_project_id<>complementary_project_id)\n);"
|
|
},
|
|
{
|
|
"name": "development_corridors",
|
|
"domain": "Corredores",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "code",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "code text NOT NULL",
|
|
"description": "code"
|
|
},
|
|
{
|
|
"name": "name",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "name text NOT NULL",
|
|
"description": "name"
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "status text NOT NULL",
|
|
"description": "status"
|
|
},
|
|
{
|
|
"name": "description",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "description text",
|
|
"description": "description"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_006000_investmoz_corridors.php",
|
|
"purpose": "Registar corredores de desenvolvimento",
|
|
"source": "A.25",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')",
|
|
"status IN ('proposed','active','closed')"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.development_corridors (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n code text NOT NULL,\n name text NOT NULL,\n status text NOT NULL,\n description text,\n CONSTRAINT imz_development_corridors_pk PRIMARY KEY (id),\n CONSTRAINT imz_development_corridors_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_development_corridors_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted')),\n CONSTRAINT imz_development_corridors_check_03 CHECK (status IN ('proposed','active','closed'))\n);"
|
|
},
|
|
{
|
|
"name": "corridor_locations",
|
|
"domain": "Corredores",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "corridor_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "corridor_id uuid NOT NULL CONSTRAINT imz_corridor_locations_corridor_id_fk REFERENCES public.development_corridors(id) ON DELETE CASCADE ON UPDATE CASCADE",
|
|
"description": "corridor id"
|
|
},
|
|
{
|
|
"name": "geo_location_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "geo_location_id uuid NOT NULL CONSTRAINT imz_corridor_locations_geo_location_id_fk REFERENCES public.geo_locations(id) ON DELETE RESTRICT ON UPDATE CASCADE",
|
|
"description": "geo location id"
|
|
},
|
|
{
|
|
"name": "sequence_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "sequence_no integer NOT NULL",
|
|
"description": "sequence no"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_006000_investmoz_corridors.php",
|
|
"purpose": "Ordenar localizações de corredores",
|
|
"source": "A.25",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')",
|
|
"sequence_no>0"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.corridor_locations (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n corridor_id uuid NOT NULL CONSTRAINT imz_corridor_locations_corridor_id_fk REFERENCES public.development_corridors(id) ON DELETE CASCADE ON UPDATE CASCADE,\n geo_location_id uuid NOT NULL CONSTRAINT imz_corridor_locations_geo_location_id_fk REFERENCES public.geo_locations(id) ON DELETE RESTRICT ON UPDATE CASCADE,\n sequence_no integer NOT NULL,\n CONSTRAINT imz_corridor_locations_pk PRIMARY KEY (id),\n CONSTRAINT imz_corridor_locations_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_corridor_locations_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted')),\n CONSTRAINT imz_corridor_locations_check_03 CHECK (sequence_no>0)\n);"
|
|
},
|
|
{
|
|
"name": "corridor_projects",
|
|
"domain": "Corredores",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "corridor_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "corridor_id uuid NOT NULL CONSTRAINT imz_corridor_projects_corridor_id_fk REFERENCES public.development_corridors(id) ON DELETE CASCADE ON UPDATE CASCADE",
|
|
"description": "corridor id"
|
|
},
|
|
{
|
|
"name": "project_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "project_id uuid NOT NULL CONSTRAINT imz_corridor_projects_project_id_fk REFERENCES public.projects(id) ON DELETE CASCADE ON UPDATE CASCADE",
|
|
"description": "project id"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_006000_investmoz_corridors.php",
|
|
"purpose": "Associar corredores e projectos",
|
|
"source": "A.25",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.corridor_projects (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n corridor_id uuid NOT NULL CONSTRAINT imz_corridor_projects_corridor_id_fk REFERENCES public.development_corridors(id) ON DELETE CASCADE ON UPDATE CASCADE,\n project_id uuid NOT NULL CONSTRAINT imz_corridor_projects_project_id_fk REFERENCES public.projects(id) ON DELETE CASCADE ON UPDATE CASCADE,\n CONSTRAINT imz_corridor_projects_pk PRIMARY KEY (id),\n CONSTRAINT imz_corridor_projects_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_corridor_projects_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted'))\n);"
|
|
},
|
|
{
|
|
"name": "corridor_clusters",
|
|
"domain": "Corredores",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "corridor_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "corridor_id uuid NOT NULL CONSTRAINT imz_corridor_clusters_corridor_id_fk REFERENCES public.development_corridors(id) ON DELETE CASCADE ON UPDATE CASCADE",
|
|
"description": "corridor id"
|
|
},
|
|
{
|
|
"name": "cluster_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "cluster_id uuid NOT NULL CONSTRAINT imz_corridor_clusters_cluster_id_fk REFERENCES public.economic_clusters(id) ON DELETE CASCADE ON UPDATE CASCADE",
|
|
"description": "cluster id"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_006000_investmoz_corridors.php",
|
|
"purpose": "Associar corredores e clusters",
|
|
"source": "A.25",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.corridor_clusters (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n corridor_id uuid NOT NULL CONSTRAINT imz_corridor_clusters_corridor_id_fk REFERENCES public.development_corridors(id) ON DELETE CASCADE ON UPDATE CASCADE,\n cluster_id uuid NOT NULL CONSTRAINT imz_corridor_clusters_cluster_id_fk REFERENCES public.economic_clusters(id) ON DELETE CASCADE ON UPDATE CASCADE,\n CONSTRAINT imz_corridor_clusters_pk PRIMARY KEY (id),\n CONSTRAINT imz_corridor_clusters_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_corridor_clusters_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted'))\n);"
|
|
},
|
|
{
|
|
"name": "investors",
|
|
"domain": "CRM",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "organization_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "organization_id uuid CONSTRAINT imz_investors_organization_id_fk REFERENCES public.organizations(id) ON DELETE SET NULL ON UPDATE CASCADE",
|
|
"description": "organization id"
|
|
},
|
|
{
|
|
"name": "legal_name",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "legal_name text NOT NULL",
|
|
"description": "legal name"
|
|
},
|
|
{
|
|
"name": "investor_type",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "investor_type text NOT NULL",
|
|
"description": "investor type"
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "status text NOT NULL",
|
|
"description": "status"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php",
|
|
"purpose": "Registar investidores e o seu enquadramento institucional",
|
|
"source": "A.26",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')",
|
|
"investor_type IN ('domestic','foreign','institutional','individual')",
|
|
"status IN ('prospect','active','inactive')"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.investors (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n organization_id uuid CONSTRAINT imz_investors_organization_id_fk REFERENCES public.organizations(id) ON DELETE SET NULL ON UPDATE CASCADE,\n legal_name text NOT NULL,\n investor_type text NOT NULL,\n status text NOT NULL,\n CONSTRAINT imz_investors_pk PRIMARY KEY (id),\n CONSTRAINT imz_investors_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_investors_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted')),\n CONSTRAINT imz_investors_check_03 CHECK (investor_type IN ('domestic','foreign','institutional','individual')),\n CONSTRAINT imz_investors_check_04 CHECK (status IN ('prospect','active','inactive'))\n);"
|
|
},
|
|
{
|
|
"name": "contacts",
|
|
"domain": "CRM",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "full_name",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "full_name text NOT NULL",
|
|
"description": "full name"
|
|
},
|
|
{
|
|
"name": "email",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "email text",
|
|
"description": "email"
|
|
},
|
|
{
|
|
"name": "phone",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "phone text",
|
|
"description": "phone"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php",
|
|
"purpose": "Registar contactos partilháveis entre investidores",
|
|
"source": "A.26",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.contacts (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n full_name text NOT NULL,\n email text,\n phone text,\n CONSTRAINT imz_contacts_pk PRIMARY KEY (id),\n CONSTRAINT imz_contacts_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_contacts_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted'))\n);"
|
|
},
|
|
{
|
|
"name": "investor_contacts",
|
|
"domain": "CRM",
|
|
"columns": [
|
|
{
|
|
"name": "investor_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "investor_id uuid NOT NULL CONSTRAINT imz_investor_contacts_investor_id_fk REFERENCES public.investors(id) ON DELETE CASCADE ON UPDATE CASCADE",
|
|
"description": "investor id"
|
|
},
|
|
{
|
|
"name": "contact_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "contact_id uuid NOT NULL CONSTRAINT imz_investor_contacts_contact_id_fk REFERENCES public.contacts(id) ON DELETE CASCADE ON UPDATE CASCADE",
|
|
"description": "contact id"
|
|
},
|
|
{
|
|
"name": "is_primary",
|
|
"type": "boolean",
|
|
"nullable": false,
|
|
"default": "false",
|
|
"definition": "is_primary boolean NOT NULL DEFAULT false",
|
|
"description": "is primary"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
}
|
|
],
|
|
"pk": [
|
|
"investor_id",
|
|
"contact_id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php",
|
|
"purpose": "Associar investidores e contactos com indicação de contacto principal",
|
|
"source": "A.26",
|
|
"checks": [],
|
|
"soft_delete": false,
|
|
"sql": "CREATE TABLE public.investor_contacts (\n investor_id uuid NOT NULL CONSTRAINT imz_investor_contacts_investor_id_fk REFERENCES public.investors(id) ON DELETE CASCADE ON UPDATE CASCADE,\n contact_id uuid NOT NULL CONSTRAINT imz_investor_contacts_contact_id_fk REFERENCES public.contacts(id) ON DELETE CASCADE ON UPDATE CASCADE,\n is_primary boolean NOT NULL DEFAULT false,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n CONSTRAINT imz_investor_contacts_pk PRIMARY KEY (investor_id, contact_id)\n);"
|
|
},
|
|
{
|
|
"name": "leads",
|
|
"domain": "CRM",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "investor_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "investor_id uuid CONSTRAINT imz_leads_investor_id_fk REFERENCES public.investors(id) ON DELETE SET NULL ON UPDATE CASCADE",
|
|
"description": "investor id"
|
|
},
|
|
{
|
|
"name": "owner_user_id",
|
|
"type": "bigint",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "owner_user_id bigint CONSTRAINT imz_leads_owner_user_id_fk REFERENCES public.users(id) ON DELETE SET NULL ON UPDATE CASCADE",
|
|
"description": "owner user id"
|
|
},
|
|
{
|
|
"name": "title",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "title text NOT NULL",
|
|
"description": "title"
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "status text NOT NULL",
|
|
"description": "status"
|
|
},
|
|
{
|
|
"name": "estimated_amount",
|
|
"type": "numeric(20,2)",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "estimated_amount numeric(20,2)",
|
|
"description": "estimated amount"
|
|
},
|
|
{
|
|
"name": "currency",
|
|
"type": "char(3)",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "currency char(3)",
|
|
"description": "currency"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php",
|
|
"purpose": "Qualificar potenciais negócios no CRM",
|
|
"source": "A.26",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')",
|
|
"status IN ('new','qualified','disqualified','converted')",
|
|
"(estimated_amount IS NULL)=(currency IS NULL)",
|
|
"estimated_amount IS NULL OR estimated_amount >= 0",
|
|
"currency IS NULL OR currency ~ '^[A-Z]{3}$'"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.leads (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n investor_id uuid CONSTRAINT imz_leads_investor_id_fk REFERENCES public.investors(id) ON DELETE SET NULL ON UPDATE CASCADE,\n owner_user_id bigint CONSTRAINT imz_leads_owner_user_id_fk REFERENCES public.users(id) ON DELETE SET NULL ON UPDATE CASCADE,\n title text NOT NULL,\n status text NOT NULL,\n estimated_amount numeric(20,2),\n currency char(3),\n CONSTRAINT imz_leads_pk PRIMARY KEY (id),\n CONSTRAINT imz_leads_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_leads_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted')),\n CONSTRAINT imz_leads_check_03 CHECK (status IN ('new','qualified','disqualified','converted')),\n CONSTRAINT imz_leads_check_04 CHECK ((estimated_amount IS NULL)=(currency IS NULL)),\n CONSTRAINT imz_leads_check_05 CHECK (estimated_amount IS NULL OR estimated_amount >= 0),\n CONSTRAINT imz_leads_check_06 CHECK (currency IS NULL OR currency ~ '^[A-Z]{3}$')\n);"
|
|
},
|
|
{
|
|
"name": "crm_opportunities",
|
|
"domain": "CRM",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "lead_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "lead_id uuid CONSTRAINT imz_crm_opportunities_lead_id_fk REFERENCES public.leads(id) ON DELETE SET NULL ON UPDATE CASCADE",
|
|
"description": "lead id"
|
|
},
|
|
{
|
|
"name": "project_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "project_id uuid CONSTRAINT imz_crm_opportunities_project_id_fk REFERENCES public.projects(id) ON DELETE SET NULL ON UPDATE CASCADE",
|
|
"description": "project id"
|
|
},
|
|
{
|
|
"name": "owner_user_id",
|
|
"type": "bigint",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "owner_user_id bigint CONSTRAINT imz_crm_opportunities_owner_user_id_fk REFERENCES public.users(id) ON DELETE SET NULL ON UPDATE CASCADE",
|
|
"description": "owner user id"
|
|
},
|
|
{
|
|
"name": "stage",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "stage text NOT NULL",
|
|
"description": "stage"
|
|
},
|
|
{
|
|
"name": "amount",
|
|
"type": "numeric(20,2)",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "amount numeric(20,2)",
|
|
"description": "amount"
|
|
},
|
|
{
|
|
"name": "currency",
|
|
"type": "char(3)",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "currency char(3)",
|
|
"description": "currency"
|
|
},
|
|
{
|
|
"name": "probability",
|
|
"type": "numeric(5,2)",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "probability numeric(5,2)",
|
|
"description": "probability"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php",
|
|
"purpose": "Gerir negociações CRM, separadas do catálogo público opportunities",
|
|
"source": "A.26",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')",
|
|
"stage IN ('discovery','assessment','negotiation','approved','lost')",
|
|
"probability BETWEEN 0 AND 100",
|
|
"(amount IS NULL)=(currency IS NULL)",
|
|
"amount IS NULL OR amount >= 0",
|
|
"currency IS NULL OR currency ~ '^[A-Z]{3}$'"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.crm_opportunities (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n lead_id uuid CONSTRAINT imz_crm_opportunities_lead_id_fk REFERENCES public.leads(id) ON DELETE SET NULL ON UPDATE CASCADE,\n project_id uuid CONSTRAINT imz_crm_opportunities_project_id_fk REFERENCES public.projects(id) ON DELETE SET NULL ON UPDATE CASCADE,\n owner_user_id bigint CONSTRAINT imz_crm_opportunities_owner_user_id_fk REFERENCES public.users(id) ON DELETE SET NULL ON UPDATE CASCADE,\n stage text NOT NULL,\n amount numeric(20,2),\n currency char(3),\n probability numeric(5,2),\n CONSTRAINT imz_crm_opportunities_pk PRIMARY KEY (id),\n CONSTRAINT imz_crm_opportunities_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_crm_opportunities_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted')),\n CONSTRAINT imz_crm_opportunities_check_03 CHECK (stage IN ('discovery','assessment','negotiation','approved','lost')),\n CONSTRAINT imz_crm_opportunities_check_04 CHECK (probability BETWEEN 0 AND 100),\n CONSTRAINT imz_crm_opportunities_check_05 CHECK ((amount IS NULL)=(currency IS NULL)),\n CONSTRAINT imz_crm_opportunities_check_06 CHECK (amount IS NULL OR amount >= 0),\n CONSTRAINT imz_crm_opportunities_check_07 CHECK (currency IS NULL OR currency ~ '^[A-Z]{3}$')\n);"
|
|
},
|
|
{
|
|
"name": "activities",
|
|
"domain": "CRM",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "investor_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "investor_id uuid CONSTRAINT imz_activities_investor_id_fk REFERENCES public.investors(id) ON DELETE CASCADE ON UPDATE CASCADE",
|
|
"description": "investor id"
|
|
},
|
|
{
|
|
"name": "opportunity_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "opportunity_id uuid CONSTRAINT imz_activities_opportunity_id_fk REFERENCES public.crm_opportunities(id) ON DELETE SET NULL ON UPDATE CASCADE",
|
|
"description": "opportunity id"
|
|
},
|
|
{
|
|
"name": "actor_user_id",
|
|
"type": "bigint",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "actor_user_id bigint CONSTRAINT imz_activities_actor_user_id_fk REFERENCES public.users(id) ON DELETE SET NULL ON UPDATE CASCADE",
|
|
"description": "actor user id"
|
|
},
|
|
{
|
|
"name": "activity_type",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "activity_type text NOT NULL",
|
|
"description": "activity type"
|
|
},
|
|
{
|
|
"name": "occurred_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "occurred_at timestamptz NOT NULL",
|
|
"description": "occurred at"
|
|
},
|
|
{
|
|
"name": "summary",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "summary text NOT NULL",
|
|
"description": "summary"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php",
|
|
"purpose": "Registar interacções CRM",
|
|
"source": "A.26",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')",
|
|
"activity_type IN ('call','meeting','email','note')"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.activities (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n investor_id uuid CONSTRAINT imz_activities_investor_id_fk REFERENCES public.investors(id) ON DELETE CASCADE ON UPDATE CASCADE,\n opportunity_id uuid CONSTRAINT imz_activities_opportunity_id_fk REFERENCES public.crm_opportunities(id) ON DELETE SET NULL ON UPDATE CASCADE,\n actor_user_id bigint CONSTRAINT imz_activities_actor_user_id_fk REFERENCES public.users(id) ON DELETE SET NULL ON UPDATE CASCADE,\n activity_type text NOT NULL,\n occurred_at timestamptz NOT NULL,\n summary text NOT NULL,\n CONSTRAINT imz_activities_pk PRIMARY KEY (id),\n CONSTRAINT imz_activities_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_activities_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted')),\n CONSTRAINT imz_activities_check_03 CHECK (activity_type IN ('call','meeting','email','note'))\n);"
|
|
},
|
|
{
|
|
"name": "tasks",
|
|
"domain": "CRM",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "assignee_user_id",
|
|
"type": "bigint",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "assignee_user_id bigint CONSTRAINT imz_tasks_assignee_user_id_fk REFERENCES public.users(id) ON DELETE SET NULL ON UPDATE CASCADE",
|
|
"description": "assignee user id"
|
|
},
|
|
{
|
|
"name": "opportunity_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "opportunity_id uuid CONSTRAINT imz_tasks_opportunity_id_fk REFERENCES public.crm_opportunities(id) ON DELETE CASCADE ON UPDATE CASCADE",
|
|
"description": "opportunity id"
|
|
},
|
|
{
|
|
"name": "title",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "title text NOT NULL",
|
|
"description": "title"
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "status text NOT NULL",
|
|
"description": "status"
|
|
},
|
|
{
|
|
"name": "due_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "due_at timestamptz",
|
|
"description": "due at"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php",
|
|
"purpose": "Acompanhar tarefas e prazos CRM",
|
|
"source": "A.26",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')",
|
|
"status IN ('open','in_progress','done','cancelled')"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.tasks (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n assignee_user_id bigint CONSTRAINT imz_tasks_assignee_user_id_fk REFERENCES public.users(id) ON DELETE SET NULL ON UPDATE CASCADE,\n opportunity_id uuid CONSTRAINT imz_tasks_opportunity_id_fk REFERENCES public.crm_opportunities(id) ON DELETE CASCADE ON UPDATE CASCADE,\n title text NOT NULL,\n status text NOT NULL,\n due_at timestamptz,\n CONSTRAINT imz_tasks_pk PRIMARY KEY (id),\n CONSTRAINT imz_tasks_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_tasks_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted')),\n CONSTRAINT imz_tasks_check_03 CHECK (status IN ('open','in_progress','done','cancelled'))\n);"
|
|
},
|
|
{
|
|
"name": "investor_journeys",
|
|
"domain": "Jornada e aftercare",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "investor_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "investor_id uuid NOT NULL CONSTRAINT imz_investor_journeys_investor_id_fk REFERENCES public.investors(id) ON DELETE CASCADE ON UPDATE CASCADE",
|
|
"description": "investor id"
|
|
},
|
|
{
|
|
"name": "opportunity_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "opportunity_id uuid CONSTRAINT imz_investor_journeys_opportunity_id_fk REFERENCES public.crm_opportunities(id) ON DELETE SET NULL ON UPDATE CASCADE",
|
|
"description": "opportunity id"
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "status text NOT NULL",
|
|
"description": "status"
|
|
},
|
|
{
|
|
"name": "started_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "started_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "started at"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php",
|
|
"purpose": "Acompanhar jornadas dos investidores",
|
|
"source": "A.26",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')",
|
|
"status IN ('started','active','completed','cancelled')"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.investor_journeys (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n investor_id uuid NOT NULL CONSTRAINT imz_investor_journeys_investor_id_fk REFERENCES public.investors(id) ON DELETE CASCADE ON UPDATE CASCADE,\n opportunity_id uuid CONSTRAINT imz_investor_journeys_opportunity_id_fk REFERENCES public.crm_opportunities(id) ON DELETE SET NULL ON UPDATE CASCADE,\n status text NOT NULL,\n started_at timestamptz NOT NULL DEFAULT now(),\n CONSTRAINT imz_investor_journeys_pk PRIMARY KEY (id),\n CONSTRAINT imz_investor_journeys_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_investor_journeys_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted')),\n CONSTRAINT imz_investor_journeys_check_03 CHECK (status IN ('started','active','completed','cancelled'))\n);"
|
|
},
|
|
{
|
|
"name": "journey_steps",
|
|
"domain": "Jornada e aftercare",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "journey_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "journey_id uuid NOT NULL CONSTRAINT imz_journey_steps_journey_id_fk REFERENCES public.investor_journeys(id) ON DELETE CASCADE ON UPDATE CASCADE",
|
|
"description": "journey id"
|
|
},
|
|
{
|
|
"name": "step_code",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "step_code text NOT NULL",
|
|
"description": "step code"
|
|
},
|
|
{
|
|
"name": "sequence_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "sequence_no integer NOT NULL",
|
|
"description": "sequence no"
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "status text NOT NULL",
|
|
"description": "status"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php",
|
|
"purpose": "Ordenar etapas de uma jornada",
|
|
"source": "A.26",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')",
|
|
"sequence_no>0",
|
|
"status IN ('pending','active','completed','blocked')"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.journey_steps (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n journey_id uuid NOT NULL CONSTRAINT imz_journey_steps_journey_id_fk REFERENCES public.investor_journeys(id) ON DELETE CASCADE ON UPDATE CASCADE,\n step_code text NOT NULL,\n sequence_no integer NOT NULL,\n status text NOT NULL,\n CONSTRAINT imz_journey_steps_pk PRIMARY KEY (id),\n CONSTRAINT imz_journey_steps_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_journey_steps_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted')),\n CONSTRAINT imz_journey_steps_check_03 CHECK (sequence_no>0),\n CONSTRAINT imz_journey_steps_check_04 CHECK (status IN ('pending','active','completed','blocked'))\n);"
|
|
},
|
|
{
|
|
"name": "submissions",
|
|
"domain": "Jornada e aftercare",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "journey_step_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "journey_step_id uuid NOT NULL CONSTRAINT imz_submissions_journey_step_id_fk REFERENCES public.journey_steps(id) ON DELETE CASCADE ON UPDATE CASCADE",
|
|
"description": "journey step id"
|
|
},
|
|
{
|
|
"name": "submitted_by",
|
|
"type": "bigint",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "submitted_by bigint CONSTRAINT imz_submissions_submitted_by_fk REFERENCES public.users(id) ON DELETE SET NULL ON UPDATE CASCADE",
|
|
"description": "submitted by"
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "status text NOT NULL",
|
|
"description": "status"
|
|
},
|
|
{
|
|
"name": "payload",
|
|
"type": "jsonb",
|
|
"nullable": false,
|
|
"default": "'{}'::jsonb",
|
|
"definition": "payload jsonb NOT NULL DEFAULT '{}'::jsonb",
|
|
"description": "payload"
|
|
},
|
|
{
|
|
"name": "submitted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "submitted_at timestamptz",
|
|
"description": "submitted at"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php",
|
|
"purpose": "Registar submissões nas etapas",
|
|
"source": "A.26",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')",
|
|
"status IN ('draft','submitted','accepted','rejected')"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.submissions (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n journey_step_id uuid NOT NULL CONSTRAINT imz_submissions_journey_step_id_fk REFERENCES public.journey_steps(id) ON DELETE CASCADE ON UPDATE CASCADE,\n submitted_by bigint CONSTRAINT imz_submissions_submitted_by_fk REFERENCES public.users(id) ON DELETE SET NULL ON UPDATE CASCADE,\n status text NOT NULL,\n payload jsonb NOT NULL DEFAULT '{}'::jsonb,\n submitted_at timestamptz,\n CONSTRAINT imz_submissions_pk PRIMARY KEY (id),\n CONSTRAINT imz_submissions_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_submissions_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted')),\n CONSTRAINT imz_submissions_check_03 CHECK (status IN ('draft','submitted','accepted','rejected'))\n);"
|
|
},
|
|
{
|
|
"name": "aftercare_plans",
|
|
"domain": "Jornada e aftercare",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "investor_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "investor_id uuid NOT NULL CONSTRAINT imz_aftercare_plans_investor_id_fk REFERENCES public.investors(id) ON DELETE CASCADE ON UPDATE CASCADE",
|
|
"description": "investor id"
|
|
},
|
|
{
|
|
"name": "project_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "project_id uuid CONSTRAINT imz_aftercare_plans_project_id_fk REFERENCES public.projects(id) ON DELETE SET NULL ON UPDATE CASCADE",
|
|
"description": "project id"
|
|
},
|
|
{
|
|
"name": "owner_user_id",
|
|
"type": "bigint",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "owner_user_id bigint CONSTRAINT imz_aftercare_plans_owner_user_id_fk REFERENCES public.users(id) ON DELETE SET NULL ON UPDATE CASCADE",
|
|
"description": "owner user id"
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "status text NOT NULL",
|
|
"description": "status"
|
|
},
|
|
{
|
|
"name": "review_date",
|
|
"type": "date",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "review_date date",
|
|
"description": "review date"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php",
|
|
"purpose": "Acompanhar planos de pós-investimento",
|
|
"source": "A.26",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')",
|
|
"status IN ('draft','active','closed')"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.aftercare_plans (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n investor_id uuid NOT NULL CONSTRAINT imz_aftercare_plans_investor_id_fk REFERENCES public.investors(id) ON DELETE CASCADE ON UPDATE CASCADE,\n project_id uuid CONSTRAINT imz_aftercare_plans_project_id_fk REFERENCES public.projects(id) ON DELETE SET NULL ON UPDATE CASCADE,\n owner_user_id bigint CONSTRAINT imz_aftercare_plans_owner_user_id_fk REFERENCES public.users(id) ON DELETE SET NULL ON UPDATE CASCADE,\n status text NOT NULL,\n review_date date,\n CONSTRAINT imz_aftercare_plans_pk PRIMARY KEY (id),\n CONSTRAINT imz_aftercare_plans_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_aftercare_plans_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted')),\n CONSTRAINT imz_aftercare_plans_check_03 CHECK (status IN ('draft','active','closed'))\n);"
|
|
},
|
|
{
|
|
"name": "constraints",
|
|
"domain": "Jornada e aftercare",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "aftercare_plan_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "aftercare_plan_id uuid NOT NULL CONSTRAINT imz_constraints_aftercare_plan_id_fk REFERENCES public.aftercare_plans(id) ON DELETE CASCADE ON UPDATE CASCADE",
|
|
"description": "aftercare plan id"
|
|
},
|
|
{
|
|
"name": "category",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "category text NOT NULL",
|
|
"description": "category"
|
|
},
|
|
{
|
|
"name": "description",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "description text NOT NULL",
|
|
"description": "description"
|
|
},
|
|
{
|
|
"name": "severity",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "severity text NOT NULL",
|
|
"description": "severity"
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "status text NOT NULL",
|
|
"description": "status"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php",
|
|
"purpose": "Registar constrangimentos de pós-investimento",
|
|
"source": "A.26",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')",
|
|
"severity IN ('low','medium','high','critical')",
|
|
"status IN ('open','mitigating','resolved')"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.constraints (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n aftercare_plan_id uuid NOT NULL CONSTRAINT imz_constraints_aftercare_plan_id_fk REFERENCES public.aftercare_plans(id) ON DELETE CASCADE ON UPDATE CASCADE,\n category text NOT NULL,\n description text NOT NULL,\n severity text NOT NULL,\n status text NOT NULL,\n CONSTRAINT imz_constraints_pk PRIMARY KEY (id),\n CONSTRAINT imz_constraints_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_constraints_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted')),\n CONSTRAINT imz_constraints_check_03 CHECK (severity IN ('low','medium','high','critical')),\n CONSTRAINT imz_constraints_check_04 CHECK (status IN ('open','mitigating','resolved'))\n);"
|
|
},
|
|
{
|
|
"name": "escalations",
|
|
"domain": "Jornada e aftercare",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "constraint_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "constraint_id uuid NOT NULL CONSTRAINT imz_escalations_constraint_id_fk REFERENCES public.constraints(id) ON DELETE CASCADE ON UPDATE CASCADE",
|
|
"description": "constraint id"
|
|
},
|
|
{
|
|
"name": "escalated_by",
|
|
"type": "bigint",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "escalated_by bigint CONSTRAINT imz_escalations_escalated_by_fk REFERENCES public.users(id) ON DELETE SET NULL ON UPDATE CASCADE",
|
|
"description": "escalated by"
|
|
},
|
|
{
|
|
"name": "level",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "level text NOT NULL",
|
|
"description": "level"
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "status text NOT NULL",
|
|
"description": "status"
|
|
},
|
|
{
|
|
"name": "escalated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "escalated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "escalated at"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php",
|
|
"purpose": "Registar escalonamentos de constrangimentos",
|
|
"source": "A.26",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')",
|
|
"level IN ('operational','management','executive')",
|
|
"status IN ('open','acknowledged','closed')"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.escalations (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n constraint_id uuid NOT NULL CONSTRAINT imz_escalations_constraint_id_fk REFERENCES public.constraints(id) ON DELETE CASCADE ON UPDATE CASCADE,\n escalated_by bigint CONSTRAINT imz_escalations_escalated_by_fk REFERENCES public.users(id) ON DELETE SET NULL ON UPDATE CASCADE,\n level text NOT NULL,\n status text NOT NULL,\n escalated_at timestamptz NOT NULL DEFAULT now(),\n CONSTRAINT imz_escalations_pk PRIMARY KEY (id),\n CONSTRAINT imz_escalations_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_escalations_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted')),\n CONSTRAINT imz_escalations_check_03 CHECK (level IN ('operational','management','executive')),\n CONSTRAINT imz_escalations_check_04 CHECK (status IN ('open','acknowledged','closed'))\n);"
|
|
},
|
|
{
|
|
"name": "skills",
|
|
"domain": "Educação",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "code",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "code text NOT NULL",
|
|
"description": "code"
|
|
},
|
|
{
|
|
"name": "name",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "name text NOT NULL",
|
|
"description": "name"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php",
|
|
"purpose": "Catalogar competências",
|
|
"source": "A.26",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.skills (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n code text NOT NULL,\n name text NOT NULL,\n CONSTRAINT imz_skills_pk PRIMARY KEY (id),\n CONSTRAINT imz_skills_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_skills_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted'))\n);"
|
|
},
|
|
{
|
|
"name": "occupations",
|
|
"domain": "Educação",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "code",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "code text NOT NULL",
|
|
"description": "code"
|
|
},
|
|
{
|
|
"name": "name",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "name text NOT NULL",
|
|
"description": "name"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php",
|
|
"purpose": "Catalogar ocupações",
|
|
"source": "A.26",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.occupations (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n code text NOT NULL,\n name text NOT NULL,\n CONSTRAINT imz_occupations_pk PRIMARY KEY (id),\n CONSTRAINT imz_occupations_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_occupations_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted'))\n);"
|
|
},
|
|
{
|
|
"name": "training_needs",
|
|
"domain": "Educação",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "project_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "project_id uuid CONSTRAINT imz_training_needs_project_id_fk REFERENCES public.projects(id) ON DELETE SET NULL ON UPDATE CASCADE",
|
|
"description": "project id"
|
|
},
|
|
{
|
|
"name": "occupation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "occupation_id uuid CONSTRAINT imz_training_needs_occupation_id_fk REFERENCES public.occupations(id) ON DELETE RESTRICT ON UPDATE CASCADE",
|
|
"description": "occupation id"
|
|
},
|
|
{
|
|
"name": "skill_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "skill_id uuid CONSTRAINT imz_training_needs_skill_id_fk REFERENCES public.skills(id) ON DELETE RESTRICT ON UPDATE CASCADE",
|
|
"description": "skill id"
|
|
},
|
|
{
|
|
"name": "quantity",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "quantity integer NOT NULL",
|
|
"description": "quantity"
|
|
},
|
|
{
|
|
"name": "priority",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "priority text NOT NULL",
|
|
"description": "priority"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php",
|
|
"purpose": "Quantificar necessidades de formação",
|
|
"source": "A.26",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')",
|
|
"quantity>0",
|
|
"priority IN ('Must','Should','Could')"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.training_needs (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n project_id uuid CONSTRAINT imz_training_needs_project_id_fk REFERENCES public.projects(id) ON DELETE SET NULL ON UPDATE CASCADE,\n occupation_id uuid CONSTRAINT imz_training_needs_occupation_id_fk REFERENCES public.occupations(id) ON DELETE RESTRICT ON UPDATE CASCADE,\n skill_id uuid CONSTRAINT imz_training_needs_skill_id_fk REFERENCES public.skills(id) ON DELETE RESTRICT ON UPDATE CASCADE,\n quantity integer NOT NULL,\n priority text NOT NULL,\n CONSTRAINT imz_training_needs_pk PRIMARY KEY (id),\n CONSTRAINT imz_training_needs_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_training_needs_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted')),\n CONSTRAINT imz_training_needs_check_03 CHECK (quantity>0),\n CONSTRAINT imz_training_needs_check_04 CHECK (priority IN ('Must','Should','Could'))\n);"
|
|
},
|
|
{
|
|
"name": "training_providers",
|
|
"domain": "Educação",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "organization_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "organization_id uuid CONSTRAINT imz_training_providers_organization_id_fk REFERENCES public.organizations(id) ON DELETE SET NULL ON UPDATE CASCADE",
|
|
"description": "organization id"
|
|
},
|
|
{
|
|
"name": "name",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "name text NOT NULL",
|
|
"description": "name"
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "status text NOT NULL",
|
|
"description": "status"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php",
|
|
"purpose": "Registar prestadores de formação",
|
|
"source": "A.26",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')",
|
|
"status IN ('candidate','approved','inactive')"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.training_providers (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n organization_id uuid CONSTRAINT imz_training_providers_organization_id_fk REFERENCES public.organizations(id) ON DELETE SET NULL ON UPDATE CASCADE,\n name text NOT NULL,\n status text NOT NULL,\n CONSTRAINT imz_training_providers_pk PRIMARY KEY (id),\n CONSTRAINT imz_training_providers_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_training_providers_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted')),\n CONSTRAINT imz_training_providers_check_03 CHECK (status IN ('candidate','approved','inactive'))\n);"
|
|
},
|
|
{
|
|
"name": "courses",
|
|
"domain": "Educação",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "provider_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "provider_id uuid NOT NULL CONSTRAINT imz_courses_provider_id_fk REFERENCES public.training_providers(id) ON DELETE CASCADE ON UPDATE CASCADE",
|
|
"description": "provider id"
|
|
},
|
|
{
|
|
"name": "code",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "code text NOT NULL",
|
|
"description": "code"
|
|
},
|
|
{
|
|
"name": "title",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "title text NOT NULL",
|
|
"description": "title"
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "status text NOT NULL",
|
|
"description": "status"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php",
|
|
"purpose": "Catalogar cursos por prestador",
|
|
"source": "A.26",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')",
|
|
"status IN ('draft','published','retired')"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.courses (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n provider_id uuid NOT NULL CONSTRAINT imz_courses_provider_id_fk REFERENCES public.training_providers(id) ON DELETE CASCADE ON UPDATE CASCADE,\n code text NOT NULL,\n title text NOT NULL,\n status text NOT NULL,\n CONSTRAINT imz_courses_pk PRIMARY KEY (id),\n CONSTRAINT imz_courses_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_courses_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted')),\n CONSTRAINT imz_courses_check_03 CHECK (status IN ('draft','published','retired'))\n);"
|
|
},
|
|
{
|
|
"name": "education_opportunities",
|
|
"domain": "Educação",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "course_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "course_id uuid NOT NULL CONSTRAINT imz_education_opportunities_course_id_fk REFERENCES public.courses(id) ON DELETE CASCADE ON UPDATE CASCADE",
|
|
"description": "course id"
|
|
},
|
|
{
|
|
"name": "geo_location_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "geo_location_id uuid CONSTRAINT imz_education_opportunities_geo_location_id_fk REFERENCES public.geo_locations(id) ON DELETE SET NULL ON UPDATE CASCADE",
|
|
"description": "geo location id"
|
|
},
|
|
{
|
|
"name": "start_date",
|
|
"type": "date",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "start_date date NOT NULL",
|
|
"description": "start date"
|
|
},
|
|
{
|
|
"name": "end_date",
|
|
"type": "date",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "end_date date",
|
|
"description": "end date"
|
|
},
|
|
{
|
|
"name": "capacity",
|
|
"type": "integer",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "capacity integer",
|
|
"description": "capacity"
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "status text NOT NULL",
|
|
"description": "status"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php",
|
|
"purpose": "Publicar ofertas educativas com datas e capacidade",
|
|
"source": "A.26",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')",
|
|
"capacity>=0",
|
|
"status IN ('planned','open','closed','cancelled')",
|
|
"end_date IS NULL OR end_date>=start_date"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.education_opportunities (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n course_id uuid NOT NULL CONSTRAINT imz_education_opportunities_course_id_fk REFERENCES public.courses(id) ON DELETE CASCADE ON UPDATE CASCADE,\n geo_location_id uuid CONSTRAINT imz_education_opportunities_geo_location_id_fk REFERENCES public.geo_locations(id) ON DELETE SET NULL ON UPDATE CASCADE,\n start_date date NOT NULL,\n end_date date,\n capacity integer,\n status text NOT NULL,\n CONSTRAINT imz_education_opportunities_pk PRIMARY KEY (id),\n CONSTRAINT imz_education_opportunities_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_education_opportunities_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted')),\n CONSTRAINT imz_education_opportunities_check_03 CHECK (capacity>=0),\n CONSTRAINT imz_education_opportunities_check_04 CHECK (status IN ('planned','open','closed','cancelled')),\n CONSTRAINT imz_education_opportunities_check_05 CHECK (end_date IS NULL OR end_date>=start_date)\n);"
|
|
},
|
|
{
|
|
"name": "project_documents",
|
|
"domain": "Conteúdos — ligações tipadas",
|
|
"columns": [
|
|
{
|
|
"name": "project_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "project_id uuid NOT NULL CONSTRAINT imz_project_documents_project_id_fk REFERENCES public.projects(id) ON DELETE CASCADE ON UPDATE CASCADE",
|
|
"description": "project id"
|
|
},
|
|
{
|
|
"name": "document_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "document_id uuid NOT NULL CONSTRAINT imz_project_documents_document_id_fk REFERENCES public.documents(id) ON DELETE RESTRICT ON UPDATE CASCADE",
|
|
"description": "document id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
}
|
|
],
|
|
"pk": [
|
|
"project_id",
|
|
"document_id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_009500_investmoz_document_links.php",
|
|
"purpose": "Associar documentos a projects com integridade referencial",
|
|
"source": "A.26",
|
|
"checks": [],
|
|
"soft_delete": false,
|
|
"sql": "CREATE TABLE public.project_documents (\n project_id uuid NOT NULL CONSTRAINT imz_project_documents_project_id_fk REFERENCES public.projects(id) ON DELETE CASCADE ON UPDATE CASCADE,\n document_id uuid NOT NULL CONSTRAINT imz_project_documents_document_id_fk REFERENCES public.documents(id) ON DELETE RESTRICT ON UPDATE CASCADE,\n created_at timestamptz NOT NULL DEFAULT now(),\n CONSTRAINT imz_project_documents_pk PRIMARY KEY (project_id, document_id)\n);"
|
|
},
|
|
{
|
|
"name": "investor_documents",
|
|
"domain": "Conteúdos — ligações tipadas",
|
|
"columns": [
|
|
{
|
|
"name": "investor_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "investor_id uuid NOT NULL CONSTRAINT imz_investor_documents_investor_id_fk REFERENCES public.investors(id) ON DELETE CASCADE ON UPDATE CASCADE",
|
|
"description": "investor id"
|
|
},
|
|
{
|
|
"name": "document_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "document_id uuid NOT NULL CONSTRAINT imz_investor_documents_document_id_fk REFERENCES public.documents(id) ON DELETE RESTRICT ON UPDATE CASCADE",
|
|
"description": "document id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
}
|
|
],
|
|
"pk": [
|
|
"investor_id",
|
|
"document_id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_009500_investmoz_document_links.php",
|
|
"purpose": "Associar documentos a investors com integridade referencial",
|
|
"source": "A.26",
|
|
"checks": [],
|
|
"soft_delete": false,
|
|
"sql": "CREATE TABLE public.investor_documents (\n investor_id uuid NOT NULL CONSTRAINT imz_investor_documents_investor_id_fk REFERENCES public.investors(id) ON DELETE CASCADE ON UPDATE CASCADE,\n document_id uuid NOT NULL CONSTRAINT imz_investor_documents_document_id_fk REFERENCES public.documents(id) ON DELETE RESTRICT ON UPDATE CASCADE,\n created_at timestamptz NOT NULL DEFAULT now(),\n CONSTRAINT imz_investor_documents_pk PRIMARY KEY (investor_id, document_id)\n);"
|
|
},
|
|
{
|
|
"name": "journey_documents",
|
|
"domain": "Conteúdos — ligações tipadas",
|
|
"columns": [
|
|
{
|
|
"name": "journey_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "journey_id uuid NOT NULL CONSTRAINT imz_journey_documents_journey_id_fk REFERENCES public.investor_journeys(id) ON DELETE CASCADE ON UPDATE CASCADE",
|
|
"description": "journey id"
|
|
},
|
|
{
|
|
"name": "document_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "document_id uuid NOT NULL CONSTRAINT imz_journey_documents_document_id_fk REFERENCES public.documents(id) ON DELETE RESTRICT ON UPDATE CASCADE",
|
|
"description": "document id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
}
|
|
],
|
|
"pk": [
|
|
"journey_id",
|
|
"document_id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_009500_investmoz_document_links.php",
|
|
"purpose": "Associar documentos a investor_journeys com integridade referencial",
|
|
"source": "A.26",
|
|
"checks": [],
|
|
"soft_delete": false,
|
|
"sql": "CREATE TABLE public.journey_documents (\n journey_id uuid NOT NULL CONSTRAINT imz_journey_documents_journey_id_fk REFERENCES public.investor_journeys(id) ON DELETE CASCADE ON UPDATE CASCADE,\n document_id uuid NOT NULL CONSTRAINT imz_journey_documents_document_id_fk REFERENCES public.documents(id) ON DELETE RESTRICT ON UPDATE CASCADE,\n created_at timestamptz NOT NULL DEFAULT now(),\n CONSTRAINT imz_journey_documents_pk PRIMARY KEY (journey_id, document_id)\n);"
|
|
},
|
|
{
|
|
"name": "aftercare_documents",
|
|
"domain": "Conteúdos — ligações tipadas",
|
|
"columns": [
|
|
{
|
|
"name": "aftercare_plan_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "aftercare_plan_id uuid NOT NULL CONSTRAINT imz_aftercare_documents_aftercare_plan_id_fk REFERENCES public.aftercare_plans(id) ON DELETE CASCADE ON UPDATE CASCADE",
|
|
"description": "aftercare plan id"
|
|
},
|
|
{
|
|
"name": "document_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "document_id uuid NOT NULL CONSTRAINT imz_aftercare_documents_document_id_fk REFERENCES public.documents(id) ON DELETE RESTRICT ON UPDATE CASCADE",
|
|
"description": "document id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
}
|
|
],
|
|
"pk": [
|
|
"aftercare_plan_id",
|
|
"document_id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_009500_investmoz_document_links.php",
|
|
"purpose": "Associar documentos a aftercare_plans com integridade referencial",
|
|
"source": "A.26",
|
|
"checks": [],
|
|
"soft_delete": false,
|
|
"sql": "CREATE TABLE public.aftercare_documents (\n aftercare_plan_id uuid NOT NULL CONSTRAINT imz_aftercare_documents_aftercare_plan_id_fk REFERENCES public.aftercare_plans(id) ON DELETE CASCADE ON UPDATE CASCADE,\n document_id uuid NOT NULL CONSTRAINT imz_aftercare_documents_document_id_fk REFERENCES public.documents(id) ON DELETE RESTRICT ON UPDATE CASCADE,\n created_at timestamptz NOT NULL DEFAULT now(),\n CONSTRAINT imz_aftercare_documents_pk PRIMARY KEY (aftercare_plan_id, document_id)\n);"
|
|
},
|
|
{
|
|
"name": "education_documents",
|
|
"domain": "Conteúdos — ligações tipadas",
|
|
"columns": [
|
|
{
|
|
"name": "education_opportunity_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "education_opportunity_id uuid NOT NULL CONSTRAINT imz_education_documents_education_opportunity_id_fk REFERENCES public.education_opportunities(id) ON DELETE CASCADE ON UPDATE CASCADE",
|
|
"description": "education opportunity id"
|
|
},
|
|
{
|
|
"name": "document_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "document_id uuid NOT NULL CONSTRAINT imz_education_documents_document_id_fk REFERENCES public.documents(id) ON DELETE RESTRICT ON UPDATE CASCADE",
|
|
"description": "document id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
}
|
|
],
|
|
"pk": [
|
|
"education_opportunity_id",
|
|
"document_id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_009500_investmoz_document_links.php",
|
|
"purpose": "Associar documentos a education_opportunities com integridade referencial",
|
|
"source": "A.26",
|
|
"checks": [],
|
|
"soft_delete": false,
|
|
"sql": "CREATE TABLE public.education_documents (\n education_opportunity_id uuid NOT NULL CONSTRAINT imz_education_documents_education_opportunity_id_fk REFERENCES public.education_opportunities(id) ON DELETE CASCADE ON UPDATE CASCADE,\n document_id uuid NOT NULL CONSTRAINT imz_education_documents_document_id_fk REFERENCES public.documents(id) ON DELETE RESTRICT ON UPDATE CASCADE,\n created_at timestamptz NOT NULL DEFAULT now(),\n CONSTRAINT imz_education_documents_pk PRIMARY KEY (education_opportunity_id, document_id)\n);"
|
|
},
|
|
{
|
|
"name": "audit_events",
|
|
"domain": "Governação e auditoria",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "actor_user_id",
|
|
"type": "bigint",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "actor_user_id bigint CONSTRAINT imz_audit_events_actor_user_id_fk REFERENCES public.users(id) ON DELETE RESTRICT ON UPDATE RESTRICT",
|
|
"description": "actor user id"
|
|
},
|
|
{
|
|
"name": "entity_type",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "entity_type text NOT NULL",
|
|
"description": "entity type"
|
|
},
|
|
{
|
|
"name": "entity_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "entity_id uuid",
|
|
"description": "entity id"
|
|
},
|
|
{
|
|
"name": "action",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "action text NOT NULL",
|
|
"description": "action"
|
|
},
|
|
{
|
|
"name": "occurred_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "occurred_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "occurred at"
|
|
},
|
|
{
|
|
"name": "before_data",
|
|
"type": "jsonb",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "before_data jsonb",
|
|
"description": "before data"
|
|
},
|
|
{
|
|
"name": "after_data",
|
|
"type": "jsonb",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "after_data jsonb",
|
|
"description": "after data"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_010000_investmoz_governance_ai.php",
|
|
"purpose": "Preservar eventos de auditoria sem actualização, eliminação ou truncagem",
|
|
"source": "A.26",
|
|
"checks": [
|
|
"data_classification IN ('public','internal','confidential','restricted')"
|
|
],
|
|
"soft_delete": false,
|
|
"sql": "CREATE TABLE public.audit_events (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n actor_user_id bigint CONSTRAINT imz_audit_events_actor_user_id_fk REFERENCES public.users(id) ON DELETE RESTRICT ON UPDATE RESTRICT,\n entity_type text NOT NULL,\n entity_id uuid,\n action text NOT NULL,\n occurred_at timestamptz NOT NULL DEFAULT now(),\n before_data jsonb,\n after_data jsonb,\n CONSTRAINT imz_audit_events_pk PRIMARY KEY (id),\n CONSTRAINT imz_audit_events_check_01 CHECK (data_classification IN ('public','internal','confidential','restricted'))\n);"
|
|
},
|
|
{
|
|
"name": "outbox_events",
|
|
"domain": "Integrações e eventos",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "aggregate_type",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "aggregate_type text NOT NULL",
|
|
"description": "aggregate type"
|
|
},
|
|
{
|
|
"name": "aggregate_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "aggregate_id uuid NOT NULL",
|
|
"description": "aggregate id"
|
|
},
|
|
{
|
|
"name": "event_type",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "event_type text NOT NULL",
|
|
"description": "event type"
|
|
},
|
|
{
|
|
"name": "payload",
|
|
"type": "jsonb",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "payload jsonb NOT NULL",
|
|
"description": "payload"
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "status text NOT NULL",
|
|
"description": "status"
|
|
},
|
|
{
|
|
"name": "available_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "available_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "available at"
|
|
},
|
|
{
|
|
"name": "published_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "published_at timestamptz",
|
|
"description": "published at"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_011000_investmoz_integrations.php",
|
|
"purpose": "Registar eventos de saída e estado de entrega",
|
|
"source": "A.26",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')",
|
|
"status IN ('pending','published','failed')"
|
|
],
|
|
"soft_delete": false,
|
|
"sql": "CREATE TABLE public.outbox_events (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n aggregate_type text NOT NULL,\n aggregate_id uuid NOT NULL,\n event_type text NOT NULL,\n payload jsonb NOT NULL,\n status text NOT NULL,\n available_at timestamptz NOT NULL DEFAULT now(),\n published_at timestamptz,\n CONSTRAINT imz_outbox_events_pk PRIMARY KEY (id),\n CONSTRAINT imz_outbox_events_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_outbox_events_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted')),\n CONSTRAINT imz_outbox_events_check_03 CHECK (status IN ('pending','published','failed'))\n);"
|
|
},
|
|
{
|
|
"name": "inbox_events",
|
|
"domain": "Integrações e eventos",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "message_id",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "message_id text NOT NULL",
|
|
"description": "message id"
|
|
},
|
|
{
|
|
"name": "event_type",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "event_type text NOT NULL",
|
|
"description": "event type"
|
|
},
|
|
{
|
|
"name": "payload",
|
|
"type": "jsonb",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "payload jsonb NOT NULL",
|
|
"description": "payload"
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "status text NOT NULL",
|
|
"description": "status"
|
|
},
|
|
{
|
|
"name": "received_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "received_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "received at"
|
|
},
|
|
{
|
|
"name": "processed_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "processed_at timestamptz",
|
|
"description": "processed at"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_011000_investmoz_integrations.php",
|
|
"purpose": "Deduplicar mensagens de entrada e acompanhar processamento",
|
|
"source": "A.26",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')",
|
|
"status IN ('received','processed','failed')"
|
|
],
|
|
"soft_delete": false,
|
|
"sql": "CREATE TABLE public.inbox_events (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n message_id text NOT NULL,\n event_type text NOT NULL,\n payload jsonb NOT NULL,\n status text NOT NULL,\n received_at timestamptz NOT NULL DEFAULT now(),\n processed_at timestamptz,\n CONSTRAINT imz_inbox_events_pk PRIMARY KEY (id),\n CONSTRAINT imz_inbox_events_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_inbox_events_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted')),\n CONSTRAINT imz_inbox_events_check_03 CHECK (status IN ('received','processed','failed'))\n);"
|
|
},
|
|
{
|
|
"name": "sync_runs",
|
|
"domain": "Integrações e eventos",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "integration_name",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "integration_name text NOT NULL",
|
|
"description": "integration name"
|
|
},
|
|
{
|
|
"name": "direction",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "direction text NOT NULL",
|
|
"description": "direction"
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "status text NOT NULL",
|
|
"description": "status"
|
|
},
|
|
{
|
|
"name": "started_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "started_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "started at"
|
|
},
|
|
{
|
|
"name": "ended_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "ended_at timestamptz",
|
|
"description": "ended at"
|
|
},
|
|
{
|
|
"name": "totals",
|
|
"type": "jsonb",
|
|
"nullable": false,
|
|
"default": "'{}'::jsonb",
|
|
"definition": "totals jsonb NOT NULL DEFAULT '{}'::jsonb",
|
|
"description": "totals"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_011000_investmoz_integrations.php",
|
|
"purpose": "Acompanhar execuções de integração",
|
|
"source": "A.26",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')",
|
|
"direction IN ('inbound','outbound')",
|
|
"status IN ('running','succeeded','failed','cancelled')"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.sync_runs (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n integration_name text NOT NULL,\n direction text NOT NULL,\n status text NOT NULL,\n started_at timestamptz NOT NULL DEFAULT now(),\n ended_at timestamptz,\n totals jsonb NOT NULL DEFAULT '{}'::jsonb,\n CONSTRAINT imz_sync_runs_pk PRIMARY KEY (id),\n CONSTRAINT imz_sync_runs_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_sync_runs_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted')),\n CONSTRAINT imz_sync_runs_check_03 CHECK (direction IN ('inbound','outbound')),\n CONSTRAINT imz_sync_runs_check_04 CHECK (status IN ('running','succeeded','failed','cancelled'))\n);"
|
|
},
|
|
{
|
|
"name": "reconciliation_issues",
|
|
"domain": "Integrações e eventos",
|
|
"columns": [
|
|
{
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": "gen_random_uuid()",
|
|
"definition": "id uuid DEFAULT gen_random_uuid() NOT NULL",
|
|
"description": "id"
|
|
},
|
|
{
|
|
"name": "source_system",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'investmoz'",
|
|
"definition": "source_system text NOT NULL DEFAULT 'investmoz'",
|
|
"description": "source system"
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id text",
|
|
"description": "external id"
|
|
},
|
|
{
|
|
"name": "version_no",
|
|
"type": "integer",
|
|
"nullable": false,
|
|
"default": "1",
|
|
"definition": "version_no integer NOT NULL DEFAULT 1",
|
|
"description": "version no"
|
|
},
|
|
{
|
|
"name": "data_classification",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": "'internal'",
|
|
"definition": "data_classification text NOT NULL DEFAULT 'internal'",
|
|
"description": "data classification"
|
|
},
|
|
{
|
|
"name": "correlation_id",
|
|
"type": "uuid",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "correlation_id uuid",
|
|
"description": "correlation id"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "created_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "created at"
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "timestamptz",
|
|
"nullable": false,
|
|
"default": "now()",
|
|
"definition": "updated_at timestamptz NOT NULL DEFAULT now()",
|
|
"description": "updated at"
|
|
},
|
|
{
|
|
"name": "deleted_at",
|
|
"type": "timestamptz",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "deleted_at timestamptz",
|
|
"description": "deleted at"
|
|
},
|
|
{
|
|
"name": "sync_run_id",
|
|
"type": "uuid",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "sync_run_id uuid NOT NULL CONSTRAINT imz_reconciliation_issues_sync_run_id_fk REFERENCES public.sync_runs(id) ON DELETE CASCADE ON UPDATE CASCADE",
|
|
"description": "sync run id"
|
|
},
|
|
{
|
|
"name": "entity_type",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "entity_type text NOT NULL",
|
|
"description": "entity type"
|
|
},
|
|
{
|
|
"name": "external_id_ref",
|
|
"type": "text",
|
|
"nullable": true,
|
|
"default": null,
|
|
"definition": "external_id_ref text",
|
|
"description": "external id ref"
|
|
},
|
|
{
|
|
"name": "issue_type",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "issue_type text NOT NULL",
|
|
"description": "issue type"
|
|
},
|
|
{
|
|
"name": "severity",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "severity text NOT NULL",
|
|
"description": "severity"
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "text",
|
|
"nullable": false,
|
|
"default": null,
|
|
"definition": "status text NOT NULL",
|
|
"description": "status"
|
|
},
|
|
{
|
|
"name": "details",
|
|
"type": "jsonb",
|
|
"nullable": false,
|
|
"default": "'{}'::jsonb",
|
|
"definition": "details jsonb NOT NULL DEFAULT '{}'::jsonb",
|
|
"description": "details"
|
|
}
|
|
],
|
|
"pk": [
|
|
"id"
|
|
],
|
|
"migration": "database/migrations/2026_09_24_011000_investmoz_integrations.php",
|
|
"purpose": "Registar divergências de reconciliação",
|
|
"source": "A.26",
|
|
"checks": [
|
|
"version_no > 0",
|
|
"data_classification IN ('public','internal','confidential','restricted')",
|
|
"issue_type IN ('missing','duplicate','orphan','checksum','geometry','value')",
|
|
"severity IN ('warning','error')",
|
|
"status IN ('open','accepted','resolved')"
|
|
],
|
|
"soft_delete": true,
|
|
"sql": "CREATE TABLE public.reconciliation_issues (\n id uuid DEFAULT gen_random_uuid() NOT NULL,\n source_system text NOT NULL DEFAULT 'investmoz',\n external_id text,\n version_no integer NOT NULL DEFAULT 1,\n data_classification text NOT NULL DEFAULT 'internal',\n correlation_id uuid,\n created_at timestamptz NOT NULL DEFAULT now(),\n updated_at timestamptz NOT NULL DEFAULT now(),\n deleted_at timestamptz,\n sync_run_id uuid NOT NULL CONSTRAINT imz_reconciliation_issues_sync_run_id_fk REFERENCES public.sync_runs(id) ON DELETE CASCADE ON UPDATE CASCADE,\n entity_type text NOT NULL,\n external_id_ref text,\n issue_type text NOT NULL,\n severity text NOT NULL,\n status text NOT NULL,\n details jsonb NOT NULL DEFAULT '{}'::jsonb,\n CONSTRAINT imz_reconciliation_issues_pk PRIMARY KEY (id),\n CONSTRAINT imz_reconciliation_issues_check_01 CHECK (version_no > 0),\n CONSTRAINT imz_reconciliation_issues_check_02 CHECK (data_classification IN ('public','internal','confidential','restricted')),\n CONSTRAINT imz_reconciliation_issues_check_03 CHECK (issue_type IN ('missing','duplicate','orphan','checksum','geometry','value')),\n CONSTRAINT imz_reconciliation_issues_check_04 CHECK (severity IN ('warning','error')),\n CONSTRAINT imz_reconciliation_issues_check_05 CHECK (status IN ('open','accepted','resolved'))\n);"
|
|
}
|
|
],
|
|
"relationships": [
|
|
{
|
|
"table": "memberships",
|
|
"column": "user_id",
|
|
"target": "users",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "CASCADE",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_memberships_user_id_fk",
|
|
"migration": "database/migrations/2026_09_24_001000_investmoz_identity.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "memberships",
|
|
"column": "organization_id",
|
|
"target": "organizations",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "CASCADE",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_memberships_organization_id_fk",
|
|
"migration": "database/migrations/2026_09_24_001000_investmoz_identity.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "consents",
|
|
"column": "user_id",
|
|
"target": "users",
|
|
"target_column": "id",
|
|
"nullable": true,
|
|
"on_delete": "SET NULL",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_consents_user_id_fk",
|
|
"migration": "database/migrations/2026_09_24_001000_investmoz_identity.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "geo_locations",
|
|
"column": "parent_id",
|
|
"target": "geo_locations",
|
|
"target_column": "id",
|
|
"nullable": true,
|
|
"on_delete": "RESTRICT",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_geo_locations_parent_id_fk",
|
|
"migration": "database/migrations/2026_09_24_003000_investmoz_geography.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "geo_geometries",
|
|
"column": "geo_location_id",
|
|
"target": "geo_locations",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "CASCADE",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_geo_geometries_geo_location_id_fk",
|
|
"migration": "database/migrations/2026_09_24_003000_investmoz_geography.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "project_locations",
|
|
"column": "project_id",
|
|
"target": "projects",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "CASCADE",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_project_locations_project_id_fk",
|
|
"migration": "database/migrations/2026_09_24_004000_investmoz_projects.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "project_locations",
|
|
"column": "geo_location_id",
|
|
"target": "geo_locations",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "RESTRICT",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_project_locations_geo_location_id_fk",
|
|
"migration": "database/migrations/2026_09_24_004000_investmoz_projects.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "value_chains",
|
|
"column": "cluster_id",
|
|
"target": "economic_clusters",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "CASCADE",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_value_chains_cluster_id_fk",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "value_chain_links",
|
|
"column": "from_value_chain_id",
|
|
"target": "value_chains",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "CASCADE",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_value_chain_links_from_value_chain_id_fk",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "value_chain_links",
|
|
"column": "to_value_chain_id",
|
|
"target": "value_chains",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "CASCADE",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_value_chain_links_to_value_chain_id_fk",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "cluster_projects",
|
|
"column": "cluster_id",
|
|
"target": "economic_clusters",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "CASCADE",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_cluster_projects_cluster_id_fk",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "cluster_projects",
|
|
"column": "project_id",
|
|
"target": "projects",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "CASCADE",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_cluster_projects_project_id_fk",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "anchor_project_links",
|
|
"column": "anchor_project_id",
|
|
"target": "projects",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "CASCADE",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_anchor_project_links_anchor_project_id_fk",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "anchor_project_links",
|
|
"column": "cluster_id",
|
|
"target": "economic_clusters",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "CASCADE",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_anchor_project_links_cluster_id_fk",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "complementary_project_links",
|
|
"column": "anchor_project_id",
|
|
"target": "projects",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "CASCADE",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_complementary_project_links_anchor_project_id_fk",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "complementary_project_links",
|
|
"column": "complementary_project_id",
|
|
"target": "projects",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "CASCADE",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_complementary_project_links_complementary_project_id_fk",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "corridor_locations",
|
|
"column": "corridor_id",
|
|
"target": "development_corridors",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "CASCADE",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_corridor_locations_corridor_id_fk",
|
|
"migration": "database/migrations/2026_09_24_006000_investmoz_corridors.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "corridor_locations",
|
|
"column": "geo_location_id",
|
|
"target": "geo_locations",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "RESTRICT",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_corridor_locations_geo_location_id_fk",
|
|
"migration": "database/migrations/2026_09_24_006000_investmoz_corridors.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "corridor_projects",
|
|
"column": "corridor_id",
|
|
"target": "development_corridors",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "CASCADE",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_corridor_projects_corridor_id_fk",
|
|
"migration": "database/migrations/2026_09_24_006000_investmoz_corridors.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "corridor_projects",
|
|
"column": "project_id",
|
|
"target": "projects",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "CASCADE",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_corridor_projects_project_id_fk",
|
|
"migration": "database/migrations/2026_09_24_006000_investmoz_corridors.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "corridor_clusters",
|
|
"column": "corridor_id",
|
|
"target": "development_corridors",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "CASCADE",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_corridor_clusters_corridor_id_fk",
|
|
"migration": "database/migrations/2026_09_24_006000_investmoz_corridors.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "corridor_clusters",
|
|
"column": "cluster_id",
|
|
"target": "economic_clusters",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "CASCADE",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_corridor_clusters_cluster_id_fk",
|
|
"migration": "database/migrations/2026_09_24_006000_investmoz_corridors.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "investors",
|
|
"column": "organization_id",
|
|
"target": "organizations",
|
|
"target_column": "id",
|
|
"nullable": true,
|
|
"on_delete": "SET NULL",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_investors_organization_id_fk",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "investor_contacts",
|
|
"column": "investor_id",
|
|
"target": "investors",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "CASCADE",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_investor_contacts_investor_id_fk",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "investor_contacts",
|
|
"column": "contact_id",
|
|
"target": "contacts",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "CASCADE",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_investor_contacts_contact_id_fk",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "leads",
|
|
"column": "investor_id",
|
|
"target": "investors",
|
|
"target_column": "id",
|
|
"nullable": true,
|
|
"on_delete": "SET NULL",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_leads_investor_id_fk",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "leads",
|
|
"column": "owner_user_id",
|
|
"target": "users",
|
|
"target_column": "id",
|
|
"nullable": true,
|
|
"on_delete": "SET NULL",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_leads_owner_user_id_fk",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "crm_opportunities",
|
|
"column": "lead_id",
|
|
"target": "leads",
|
|
"target_column": "id",
|
|
"nullable": true,
|
|
"on_delete": "SET NULL",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_crm_opportunities_lead_id_fk",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "crm_opportunities",
|
|
"column": "project_id",
|
|
"target": "projects",
|
|
"target_column": "id",
|
|
"nullable": true,
|
|
"on_delete": "SET NULL",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_crm_opportunities_project_id_fk",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "crm_opportunities",
|
|
"column": "owner_user_id",
|
|
"target": "users",
|
|
"target_column": "id",
|
|
"nullable": true,
|
|
"on_delete": "SET NULL",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_crm_opportunities_owner_user_id_fk",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "activities",
|
|
"column": "investor_id",
|
|
"target": "investors",
|
|
"target_column": "id",
|
|
"nullable": true,
|
|
"on_delete": "CASCADE",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_activities_investor_id_fk",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "activities",
|
|
"column": "opportunity_id",
|
|
"target": "crm_opportunities",
|
|
"target_column": "id",
|
|
"nullable": true,
|
|
"on_delete": "SET NULL",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_activities_opportunity_id_fk",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "activities",
|
|
"column": "actor_user_id",
|
|
"target": "users",
|
|
"target_column": "id",
|
|
"nullable": true,
|
|
"on_delete": "SET NULL",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_activities_actor_user_id_fk",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "tasks",
|
|
"column": "assignee_user_id",
|
|
"target": "users",
|
|
"target_column": "id",
|
|
"nullable": true,
|
|
"on_delete": "SET NULL",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_tasks_assignee_user_id_fk",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "tasks",
|
|
"column": "opportunity_id",
|
|
"target": "crm_opportunities",
|
|
"target_column": "id",
|
|
"nullable": true,
|
|
"on_delete": "CASCADE",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_tasks_opportunity_id_fk",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "investor_journeys",
|
|
"column": "investor_id",
|
|
"target": "investors",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "CASCADE",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_investor_journeys_investor_id_fk",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "investor_journeys",
|
|
"column": "opportunity_id",
|
|
"target": "crm_opportunities",
|
|
"target_column": "id",
|
|
"nullable": true,
|
|
"on_delete": "SET NULL",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_investor_journeys_opportunity_id_fk",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "journey_steps",
|
|
"column": "journey_id",
|
|
"target": "investor_journeys",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "CASCADE",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_journey_steps_journey_id_fk",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "submissions",
|
|
"column": "journey_step_id",
|
|
"target": "journey_steps",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "CASCADE",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_submissions_journey_step_id_fk",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "submissions",
|
|
"column": "submitted_by",
|
|
"target": "users",
|
|
"target_column": "id",
|
|
"nullable": true,
|
|
"on_delete": "SET NULL",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_submissions_submitted_by_fk",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "aftercare_plans",
|
|
"column": "investor_id",
|
|
"target": "investors",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "CASCADE",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_aftercare_plans_investor_id_fk",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "aftercare_plans",
|
|
"column": "project_id",
|
|
"target": "projects",
|
|
"target_column": "id",
|
|
"nullable": true,
|
|
"on_delete": "SET NULL",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_aftercare_plans_project_id_fk",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "aftercare_plans",
|
|
"column": "owner_user_id",
|
|
"target": "users",
|
|
"target_column": "id",
|
|
"nullable": true,
|
|
"on_delete": "SET NULL",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_aftercare_plans_owner_user_id_fk",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "constraints",
|
|
"column": "aftercare_plan_id",
|
|
"target": "aftercare_plans",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "CASCADE",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_constraints_aftercare_plan_id_fk",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "escalations",
|
|
"column": "constraint_id",
|
|
"target": "constraints",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "CASCADE",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_escalations_constraint_id_fk",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "escalations",
|
|
"column": "escalated_by",
|
|
"target": "users",
|
|
"target_column": "id",
|
|
"nullable": true,
|
|
"on_delete": "SET NULL",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_escalations_escalated_by_fk",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "training_needs",
|
|
"column": "project_id",
|
|
"target": "projects",
|
|
"target_column": "id",
|
|
"nullable": true,
|
|
"on_delete": "SET NULL",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_training_needs_project_id_fk",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "training_needs",
|
|
"column": "occupation_id",
|
|
"target": "occupations",
|
|
"target_column": "id",
|
|
"nullable": true,
|
|
"on_delete": "RESTRICT",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_training_needs_occupation_id_fk",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "training_needs",
|
|
"column": "skill_id",
|
|
"target": "skills",
|
|
"target_column": "id",
|
|
"nullable": true,
|
|
"on_delete": "RESTRICT",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_training_needs_skill_id_fk",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "training_providers",
|
|
"column": "organization_id",
|
|
"target": "organizations",
|
|
"target_column": "id",
|
|
"nullable": true,
|
|
"on_delete": "SET NULL",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_training_providers_organization_id_fk",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "courses",
|
|
"column": "provider_id",
|
|
"target": "training_providers",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "CASCADE",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_courses_provider_id_fk",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "education_opportunities",
|
|
"column": "course_id",
|
|
"target": "courses",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "CASCADE",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_education_opportunities_course_id_fk",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "education_opportunities",
|
|
"column": "geo_location_id",
|
|
"target": "geo_locations",
|
|
"target_column": "id",
|
|
"nullable": true,
|
|
"on_delete": "SET NULL",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_education_opportunities_geo_location_id_fk",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "project_documents",
|
|
"column": "project_id",
|
|
"target": "projects",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "CASCADE",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_project_documents_project_id_fk",
|
|
"migration": "database/migrations/2026_09_24_009500_investmoz_document_links.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "project_documents",
|
|
"column": "document_id",
|
|
"target": "documents",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "RESTRICT",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_project_documents_document_id_fk",
|
|
"migration": "database/migrations/2026_09_24_009500_investmoz_document_links.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "investor_documents",
|
|
"column": "investor_id",
|
|
"target": "investors",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "CASCADE",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_investor_documents_investor_id_fk",
|
|
"migration": "database/migrations/2026_09_24_009500_investmoz_document_links.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "investor_documents",
|
|
"column": "document_id",
|
|
"target": "documents",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "RESTRICT",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_investor_documents_document_id_fk",
|
|
"migration": "database/migrations/2026_09_24_009500_investmoz_document_links.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "journey_documents",
|
|
"column": "journey_id",
|
|
"target": "investor_journeys",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "CASCADE",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_journey_documents_journey_id_fk",
|
|
"migration": "database/migrations/2026_09_24_009500_investmoz_document_links.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "journey_documents",
|
|
"column": "document_id",
|
|
"target": "documents",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "RESTRICT",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_journey_documents_document_id_fk",
|
|
"migration": "database/migrations/2026_09_24_009500_investmoz_document_links.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "aftercare_documents",
|
|
"column": "aftercare_plan_id",
|
|
"target": "aftercare_plans",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "CASCADE",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_aftercare_documents_aftercare_plan_id_fk",
|
|
"migration": "database/migrations/2026_09_24_009500_investmoz_document_links.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "aftercare_documents",
|
|
"column": "document_id",
|
|
"target": "documents",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "RESTRICT",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_aftercare_documents_document_id_fk",
|
|
"migration": "database/migrations/2026_09_24_009500_investmoz_document_links.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "education_documents",
|
|
"column": "education_opportunity_id",
|
|
"target": "education_opportunities",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "CASCADE",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_education_documents_education_opportunity_id_fk",
|
|
"migration": "database/migrations/2026_09_24_009500_investmoz_document_links.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "education_documents",
|
|
"column": "document_id",
|
|
"target": "documents",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "RESTRICT",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_education_documents_document_id_fk",
|
|
"migration": "database/migrations/2026_09_24_009500_investmoz_document_links.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "audit_events",
|
|
"column": "actor_user_id",
|
|
"target": "users",
|
|
"target_column": "id",
|
|
"nullable": true,
|
|
"on_delete": "RESTRICT",
|
|
"on_update": "RESTRICT",
|
|
"name": "imz_audit_events_actor_user_id_fk",
|
|
"migration": "database/migrations/2026_09_24_010000_investmoz_governance_ai.php",
|
|
"logical": false
|
|
},
|
|
{
|
|
"table": "reconciliation_issues",
|
|
"column": "sync_run_id",
|
|
"target": "sync_runs",
|
|
"target_column": "id",
|
|
"nullable": false,
|
|
"on_delete": "CASCADE",
|
|
"on_update": "CASCADE",
|
|
"name": "imz_reconciliation_issues_sync_run_id_fk",
|
|
"migration": "database/migrations/2026_09_24_011000_investmoz_integrations.php",
|
|
"logical": false
|
|
}
|
|
],
|
|
"constraints": [
|
|
{
|
|
"name": "imz_organizations_pk",
|
|
"table": "organizations",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_001000_investmoz_identity.php"
|
|
},
|
|
{
|
|
"name": "imz_organizations_check_01",
|
|
"table": "organizations",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_001000_investmoz_identity.php"
|
|
},
|
|
{
|
|
"name": "imz_organizations_check_02",
|
|
"table": "organizations",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_001000_investmoz_identity.php"
|
|
},
|
|
{
|
|
"name": "imz_organizations_check_03",
|
|
"table": "organizations",
|
|
"kind": "CHECK",
|
|
"expression": "organization_type IN ('public','private','ngo','education')",
|
|
"migration": "database/migrations/2026_09_24_001000_investmoz_identity.php"
|
|
},
|
|
{
|
|
"name": "imz_memberships_user_id_fk",
|
|
"table": "memberships",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "user_id -> users.id",
|
|
"migration": "database/migrations/2026_09_24_001000_investmoz_identity.php"
|
|
},
|
|
{
|
|
"name": "imz_memberships_organization_id_fk",
|
|
"table": "memberships",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "organization_id -> organizations.id",
|
|
"migration": "database/migrations/2026_09_24_001000_investmoz_identity.php"
|
|
},
|
|
{
|
|
"name": "imz_memberships_pk",
|
|
"table": "memberships",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_001000_investmoz_identity.php"
|
|
},
|
|
{
|
|
"name": "imz_memberships_check_01",
|
|
"table": "memberships",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_001000_investmoz_identity.php"
|
|
},
|
|
{
|
|
"name": "imz_memberships_check_02",
|
|
"table": "memberships",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_001000_investmoz_identity.php"
|
|
},
|
|
{
|
|
"name": "imz_memberships_check_03",
|
|
"table": "memberships",
|
|
"kind": "CHECK",
|
|
"expression": "role IN ('admin','manager','officer','viewer')",
|
|
"migration": "database/migrations/2026_09_24_001000_investmoz_identity.php"
|
|
},
|
|
{
|
|
"name": "imz_consents_user_id_fk",
|
|
"table": "consents",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "user_id -> users.id",
|
|
"migration": "database/migrations/2026_09_24_001000_investmoz_identity.php"
|
|
},
|
|
{
|
|
"name": "imz_consents_pk",
|
|
"table": "consents",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_001000_investmoz_identity.php"
|
|
},
|
|
{
|
|
"name": "imz_consents_check_01",
|
|
"table": "consents",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_001000_investmoz_identity.php"
|
|
},
|
|
{
|
|
"name": "imz_consents_check_02",
|
|
"table": "consents",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_001000_investmoz_identity.php"
|
|
},
|
|
{
|
|
"name": "imz_consents_check_03",
|
|
"table": "consents",
|
|
"kind": "CHECK",
|
|
"expression": "status IN ('granted','withdrawn','expired')",
|
|
"migration": "database/migrations/2026_09_24_001000_investmoz_identity.php"
|
|
},
|
|
{
|
|
"name": "imz_documents_pk",
|
|
"table": "documents",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_002000_investmoz_content.php"
|
|
},
|
|
{
|
|
"name": "imz_documents_check_01",
|
|
"table": "documents",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_002000_investmoz_content.php"
|
|
},
|
|
{
|
|
"name": "imz_documents_check_02",
|
|
"table": "documents",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_002000_investmoz_content.php"
|
|
},
|
|
{
|
|
"name": "imz_documents_check_03",
|
|
"table": "documents",
|
|
"kind": "CHECK",
|
|
"expression": "status IN ('active','quarantined','deleted')",
|
|
"migration": "database/migrations/2026_09_24_002000_investmoz_content.php"
|
|
},
|
|
{
|
|
"name": "imz_documents_check_04",
|
|
"table": "documents",
|
|
"kind": "CHECK",
|
|
"expression": "sha256 ~ '^[0-9a-f]{64}$'",
|
|
"migration": "database/migrations/2026_09_24_002000_investmoz_content.php"
|
|
},
|
|
{
|
|
"name": "imz_geo_locations_parent_id_fk",
|
|
"table": "geo_locations",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "parent_id -> geo_locations.id",
|
|
"migration": "database/migrations/2026_09_24_003000_investmoz_geography.php"
|
|
},
|
|
{
|
|
"name": "imz_geo_locations_pk",
|
|
"table": "geo_locations",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_003000_investmoz_geography.php"
|
|
},
|
|
{
|
|
"name": "imz_geo_locations_check_01",
|
|
"table": "geo_locations",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_003000_investmoz_geography.php"
|
|
},
|
|
{
|
|
"name": "imz_geo_locations_check_02",
|
|
"table": "geo_locations",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_003000_investmoz_geography.php"
|
|
},
|
|
{
|
|
"name": "imz_geo_locations_check_03",
|
|
"table": "geo_locations",
|
|
"kind": "CHECK",
|
|
"expression": "location_type IN ('country','province','district','municipality','site')",
|
|
"migration": "database/migrations/2026_09_24_003000_investmoz_geography.php"
|
|
},
|
|
{
|
|
"name": "imz_geo_geometries_geo_location_id_fk",
|
|
"table": "geo_geometries",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "geo_location_id -> geo_locations.id",
|
|
"migration": "database/migrations/2026_09_24_003000_investmoz_geography.php"
|
|
},
|
|
{
|
|
"name": "imz_geo_geometries_pk",
|
|
"table": "geo_geometries",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_003000_investmoz_geography.php"
|
|
},
|
|
{
|
|
"name": "imz_geo_geometries_check_01",
|
|
"table": "geo_geometries",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_003000_investmoz_geography.php"
|
|
},
|
|
{
|
|
"name": "imz_geo_geometries_check_02",
|
|
"table": "geo_geometries",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_003000_investmoz_geography.php"
|
|
},
|
|
{
|
|
"name": "imz_geo_geometries_check_03",
|
|
"table": "geo_geometries",
|
|
"kind": "CHECK",
|
|
"expression": "geometry_type IN ('point','line','polygon','multipolygon')",
|
|
"migration": "database/migrations/2026_09_24_003000_investmoz_geography.php"
|
|
},
|
|
{
|
|
"name": "imz_geo_geometries_check_04",
|
|
"table": "geo_geometries",
|
|
"kind": "CHECK",
|
|
"expression": "ST_SRID(geom) = 4326",
|
|
"migration": "database/migrations/2026_09_24_003000_investmoz_geography.php"
|
|
},
|
|
{
|
|
"name": "imz_geo_geometries_check_05",
|
|
"table": "geo_geometries",
|
|
"kind": "CHECK",
|
|
"expression": "ST_NDims(geom) = 2",
|
|
"migration": "database/migrations/2026_09_24_003000_investmoz_geography.php"
|
|
},
|
|
{
|
|
"name": "imz_geo_geometries_check_06",
|
|
"table": "geo_geometries",
|
|
"kind": "CHECK",
|
|
"expression": "NOT ST_IsEmpty(geom)",
|
|
"migration": "database/migrations/2026_09_24_003000_investmoz_geography.php"
|
|
},
|
|
{
|
|
"name": "imz_geo_geometries_check_07",
|
|
"table": "geo_geometries",
|
|
"kind": "CHECK",
|
|
"expression": "ST_IsValid(geom)",
|
|
"migration": "database/migrations/2026_09_24_003000_investmoz_geography.php"
|
|
},
|
|
{
|
|
"name": "imz_geo_geometries_check_08",
|
|
"table": "geo_geometries",
|
|
"kind": "CHECK",
|
|
"expression": "(geometry_type = 'point' AND GeometryType(geom) = 'POINT') OR (geometry_type = 'line' AND GeometryType(geom) = 'LINESTRING') OR (geometry_type = 'polygon' AND GeometryType(geom) = 'POLYGON') OR (geometry_type = 'multipolygon' AND GeometryType(geom) = 'MULTIPOLYGON')",
|
|
"migration": "database/migrations/2026_09_24_003000_investmoz_geography.php"
|
|
},
|
|
{
|
|
"name": "imz_geo_geometries_check_09",
|
|
"table": "geo_geometries",
|
|
"kind": "CHECK",
|
|
"expression": "ST_XMin(Box3D(geom)) >= -180 AND ST_XMax(Box3D(geom)) <= 180 AND ST_YMin(Box3D(geom)) >= -90 AND ST_YMax(Box3D(geom)) <= 90",
|
|
"migration": "database/migrations/2026_09_24_003000_investmoz_geography.php"
|
|
},
|
|
{
|
|
"name": "imz_projects_pk",
|
|
"table": "projects",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_004000_investmoz_projects.php"
|
|
},
|
|
{
|
|
"name": "imz_projects_check_01",
|
|
"table": "projects",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_004000_investmoz_projects.php"
|
|
},
|
|
{
|
|
"name": "imz_projects_check_02",
|
|
"table": "projects",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_004000_investmoz_projects.php"
|
|
},
|
|
{
|
|
"name": "imz_projects_check_03",
|
|
"table": "projects",
|
|
"kind": "CHECK",
|
|
"expression": "status IN ('draft','planned','active','suspended','completed','cancelled')",
|
|
"migration": "database/migrations/2026_09_24_004000_investmoz_projects.php"
|
|
},
|
|
{
|
|
"name": "imz_projects_check_04",
|
|
"table": "projects",
|
|
"kind": "CHECK",
|
|
"expression": "budget_amount IS NULL OR budget_amount >= 0",
|
|
"migration": "database/migrations/2026_09_24_004000_investmoz_projects.php"
|
|
},
|
|
{
|
|
"name": "imz_projects_check_05",
|
|
"table": "projects",
|
|
"kind": "CHECK",
|
|
"expression": "end_date IS NULL OR start_date IS NULL OR end_date >= start_date",
|
|
"migration": "database/migrations/2026_09_24_004000_investmoz_projects.php"
|
|
},
|
|
{
|
|
"name": "imz_projects_check_06",
|
|
"table": "projects",
|
|
"kind": "CHECK",
|
|
"expression": "(budget_amount IS NULL) = (budget_currency IS NULL)",
|
|
"migration": "database/migrations/2026_09_24_004000_investmoz_projects.php"
|
|
},
|
|
{
|
|
"name": "imz_projects_check_07",
|
|
"table": "projects",
|
|
"kind": "CHECK",
|
|
"expression": "budget_currency IS NULL OR budget_currency ~ '^[A-Z]{3}$'",
|
|
"migration": "database/migrations/2026_09_24_004000_investmoz_projects.php"
|
|
},
|
|
{
|
|
"name": "imz_project_locations_project_id_fk",
|
|
"table": "project_locations",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "project_id -> projects.id",
|
|
"migration": "database/migrations/2026_09_24_004000_investmoz_projects.php"
|
|
},
|
|
{
|
|
"name": "imz_project_locations_geo_location_id_fk",
|
|
"table": "project_locations",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "geo_location_id -> geo_locations.id",
|
|
"migration": "database/migrations/2026_09_24_004000_investmoz_projects.php"
|
|
},
|
|
{
|
|
"name": "imz_project_locations_pk",
|
|
"table": "project_locations",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_004000_investmoz_projects.php"
|
|
},
|
|
{
|
|
"name": "imz_project_locations_check_01",
|
|
"table": "project_locations",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_004000_investmoz_projects.php"
|
|
},
|
|
{
|
|
"name": "imz_project_locations_check_02",
|
|
"table": "project_locations",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_004000_investmoz_projects.php"
|
|
},
|
|
{
|
|
"name": "imz_project_locations_check_03",
|
|
"table": "project_locations",
|
|
"kind": "CHECK",
|
|
"expression": "role IN ('primary','secondary','impact')",
|
|
"migration": "database/migrations/2026_09_24_004000_investmoz_projects.php"
|
|
},
|
|
{
|
|
"name": "imz_economic_clusters_pk",
|
|
"table": "economic_clusters",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php"
|
|
},
|
|
{
|
|
"name": "imz_economic_clusters_check_01",
|
|
"table": "economic_clusters",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php"
|
|
},
|
|
{
|
|
"name": "imz_economic_clusters_check_02",
|
|
"table": "economic_clusters",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php"
|
|
},
|
|
{
|
|
"name": "imz_economic_clusters_check_03",
|
|
"table": "economic_clusters",
|
|
"kind": "CHECK",
|
|
"expression": "status IN ('planned','active','inactive')",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php"
|
|
},
|
|
{
|
|
"name": "imz_value_chains_cluster_id_fk",
|
|
"table": "value_chains",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "cluster_id -> economic_clusters.id",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php"
|
|
},
|
|
{
|
|
"name": "imz_value_chains_pk",
|
|
"table": "value_chains",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php"
|
|
},
|
|
{
|
|
"name": "imz_value_chains_check_01",
|
|
"table": "value_chains",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php"
|
|
},
|
|
{
|
|
"name": "imz_value_chains_check_02",
|
|
"table": "value_chains",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php"
|
|
},
|
|
{
|
|
"name": "imz_value_chains_check_03",
|
|
"table": "value_chains",
|
|
"kind": "CHECK",
|
|
"expression": "stage IN ('input','production','processing','logistics','market')",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php"
|
|
},
|
|
{
|
|
"name": "imz_value_chain_links_from_value_chain_id_fk",
|
|
"table": "value_chain_links",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "from_value_chain_id -> value_chains.id",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php"
|
|
},
|
|
{
|
|
"name": "imz_value_chain_links_to_value_chain_id_fk",
|
|
"table": "value_chain_links",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "to_value_chain_id -> value_chains.id",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php"
|
|
},
|
|
{
|
|
"name": "imz_value_chain_links_pk",
|
|
"table": "value_chain_links",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php"
|
|
},
|
|
{
|
|
"name": "imz_value_chain_links_check_01",
|
|
"table": "value_chain_links",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php"
|
|
},
|
|
{
|
|
"name": "imz_value_chain_links_check_02",
|
|
"table": "value_chain_links",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php"
|
|
},
|
|
{
|
|
"name": "imz_value_chain_links_check_03",
|
|
"table": "value_chain_links",
|
|
"kind": "CHECK",
|
|
"expression": "link_type IN ('supplies','processes','distributes','supports')",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php"
|
|
},
|
|
{
|
|
"name": "imz_value_chain_links_check_04",
|
|
"table": "value_chain_links",
|
|
"kind": "CHECK",
|
|
"expression": "from_value_chain_id <> to_value_chain_id",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php"
|
|
},
|
|
{
|
|
"name": "imz_cluster_projects_cluster_id_fk",
|
|
"table": "cluster_projects",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "cluster_id -> economic_clusters.id",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php"
|
|
},
|
|
{
|
|
"name": "imz_cluster_projects_project_id_fk",
|
|
"table": "cluster_projects",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "project_id -> projects.id",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php"
|
|
},
|
|
{
|
|
"name": "imz_cluster_projects_pk",
|
|
"table": "cluster_projects",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php"
|
|
},
|
|
{
|
|
"name": "imz_cluster_projects_check_01",
|
|
"table": "cluster_projects",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php"
|
|
},
|
|
{
|
|
"name": "imz_cluster_projects_check_02",
|
|
"table": "cluster_projects",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php"
|
|
},
|
|
{
|
|
"name": "imz_cluster_projects_check_03",
|
|
"table": "cluster_projects",
|
|
"kind": "CHECK",
|
|
"expression": "role IN ('anchor','complementary','supporting')",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php"
|
|
},
|
|
{
|
|
"name": "imz_anchor_project_links_anchor_project_id_fk",
|
|
"table": "anchor_project_links",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "anchor_project_id -> projects.id",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php"
|
|
},
|
|
{
|
|
"name": "imz_anchor_project_links_cluster_id_fk",
|
|
"table": "anchor_project_links",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "cluster_id -> economic_clusters.id",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php"
|
|
},
|
|
{
|
|
"name": "imz_anchor_project_links_pk",
|
|
"table": "anchor_project_links",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php"
|
|
},
|
|
{
|
|
"name": "imz_anchor_project_links_check_01",
|
|
"table": "anchor_project_links",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php"
|
|
},
|
|
{
|
|
"name": "imz_anchor_project_links_check_02",
|
|
"table": "anchor_project_links",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php"
|
|
},
|
|
{
|
|
"name": "imz_complementary_project_links_anchor_project_id_fk",
|
|
"table": "complementary_project_links",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "anchor_project_id -> projects.id",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php"
|
|
},
|
|
{
|
|
"name": "imz_complementary_project_links_complementary_project_id_fk",
|
|
"table": "complementary_project_links",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "complementary_project_id -> projects.id",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php"
|
|
},
|
|
{
|
|
"name": "imz_complementary_project_links_pk",
|
|
"table": "complementary_project_links",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php"
|
|
},
|
|
{
|
|
"name": "imz_complementary_project_links_check_01",
|
|
"table": "complementary_project_links",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php"
|
|
},
|
|
{
|
|
"name": "imz_complementary_project_links_check_02",
|
|
"table": "complementary_project_links",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php"
|
|
},
|
|
{
|
|
"name": "imz_complementary_project_links_check_03",
|
|
"table": "complementary_project_links",
|
|
"kind": "CHECK",
|
|
"expression": "relation_type IN ('dependency','enabler','supplier','market')",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php"
|
|
},
|
|
{
|
|
"name": "imz_complementary_project_links_check_04",
|
|
"table": "complementary_project_links",
|
|
"kind": "CHECK",
|
|
"expression": "anchor_project_id<>complementary_project_id",
|
|
"migration": "database/migrations/2026_09_24_005000_investmoz_clusters.php"
|
|
},
|
|
{
|
|
"name": "imz_development_corridors_pk",
|
|
"table": "development_corridors",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_006000_investmoz_corridors.php"
|
|
},
|
|
{
|
|
"name": "imz_development_corridors_check_01",
|
|
"table": "development_corridors",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_006000_investmoz_corridors.php"
|
|
},
|
|
{
|
|
"name": "imz_development_corridors_check_02",
|
|
"table": "development_corridors",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_006000_investmoz_corridors.php"
|
|
},
|
|
{
|
|
"name": "imz_development_corridors_check_03",
|
|
"table": "development_corridors",
|
|
"kind": "CHECK",
|
|
"expression": "status IN ('proposed','active','closed')",
|
|
"migration": "database/migrations/2026_09_24_006000_investmoz_corridors.php"
|
|
},
|
|
{
|
|
"name": "imz_corridor_locations_corridor_id_fk",
|
|
"table": "corridor_locations",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "corridor_id -> development_corridors.id",
|
|
"migration": "database/migrations/2026_09_24_006000_investmoz_corridors.php"
|
|
},
|
|
{
|
|
"name": "imz_corridor_locations_geo_location_id_fk",
|
|
"table": "corridor_locations",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "geo_location_id -> geo_locations.id",
|
|
"migration": "database/migrations/2026_09_24_006000_investmoz_corridors.php"
|
|
},
|
|
{
|
|
"name": "imz_corridor_locations_pk",
|
|
"table": "corridor_locations",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_006000_investmoz_corridors.php"
|
|
},
|
|
{
|
|
"name": "imz_corridor_locations_check_01",
|
|
"table": "corridor_locations",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_006000_investmoz_corridors.php"
|
|
},
|
|
{
|
|
"name": "imz_corridor_locations_check_02",
|
|
"table": "corridor_locations",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_006000_investmoz_corridors.php"
|
|
},
|
|
{
|
|
"name": "imz_corridor_locations_check_03",
|
|
"table": "corridor_locations",
|
|
"kind": "CHECK",
|
|
"expression": "sequence_no>0",
|
|
"migration": "database/migrations/2026_09_24_006000_investmoz_corridors.php"
|
|
},
|
|
{
|
|
"name": "imz_corridor_projects_corridor_id_fk",
|
|
"table": "corridor_projects",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "corridor_id -> development_corridors.id",
|
|
"migration": "database/migrations/2026_09_24_006000_investmoz_corridors.php"
|
|
},
|
|
{
|
|
"name": "imz_corridor_projects_project_id_fk",
|
|
"table": "corridor_projects",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "project_id -> projects.id",
|
|
"migration": "database/migrations/2026_09_24_006000_investmoz_corridors.php"
|
|
},
|
|
{
|
|
"name": "imz_corridor_projects_pk",
|
|
"table": "corridor_projects",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_006000_investmoz_corridors.php"
|
|
},
|
|
{
|
|
"name": "imz_corridor_projects_check_01",
|
|
"table": "corridor_projects",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_006000_investmoz_corridors.php"
|
|
},
|
|
{
|
|
"name": "imz_corridor_projects_check_02",
|
|
"table": "corridor_projects",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_006000_investmoz_corridors.php"
|
|
},
|
|
{
|
|
"name": "imz_corridor_clusters_corridor_id_fk",
|
|
"table": "corridor_clusters",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "corridor_id -> development_corridors.id",
|
|
"migration": "database/migrations/2026_09_24_006000_investmoz_corridors.php"
|
|
},
|
|
{
|
|
"name": "imz_corridor_clusters_cluster_id_fk",
|
|
"table": "corridor_clusters",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "cluster_id -> economic_clusters.id",
|
|
"migration": "database/migrations/2026_09_24_006000_investmoz_corridors.php"
|
|
},
|
|
{
|
|
"name": "imz_corridor_clusters_pk",
|
|
"table": "corridor_clusters",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_006000_investmoz_corridors.php"
|
|
},
|
|
{
|
|
"name": "imz_corridor_clusters_check_01",
|
|
"table": "corridor_clusters",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_006000_investmoz_corridors.php"
|
|
},
|
|
{
|
|
"name": "imz_corridor_clusters_check_02",
|
|
"table": "corridor_clusters",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_006000_investmoz_corridors.php"
|
|
},
|
|
{
|
|
"name": "imz_investors_organization_id_fk",
|
|
"table": "investors",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "organization_id -> organizations.id",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_investors_pk",
|
|
"table": "investors",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_investors_check_01",
|
|
"table": "investors",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_investors_check_02",
|
|
"table": "investors",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_investors_check_03",
|
|
"table": "investors",
|
|
"kind": "CHECK",
|
|
"expression": "investor_type IN ('domestic','foreign','institutional','individual')",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_investors_check_04",
|
|
"table": "investors",
|
|
"kind": "CHECK",
|
|
"expression": "status IN ('prospect','active','inactive')",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_contacts_pk",
|
|
"table": "contacts",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_contacts_check_01",
|
|
"table": "contacts",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_contacts_check_02",
|
|
"table": "contacts",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_investor_contacts_investor_id_fk",
|
|
"table": "investor_contacts",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "investor_id -> investors.id",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_investor_contacts_contact_id_fk",
|
|
"table": "investor_contacts",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "contact_id -> contacts.id",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_investor_contacts_pk",
|
|
"table": "investor_contacts",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "investor_id, contact_id",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_leads_investor_id_fk",
|
|
"table": "leads",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "investor_id -> investors.id",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_leads_owner_user_id_fk",
|
|
"table": "leads",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "owner_user_id -> users.id",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_leads_pk",
|
|
"table": "leads",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_leads_check_01",
|
|
"table": "leads",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_leads_check_02",
|
|
"table": "leads",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_leads_check_03",
|
|
"table": "leads",
|
|
"kind": "CHECK",
|
|
"expression": "status IN ('new','qualified','disqualified','converted')",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_leads_check_04",
|
|
"table": "leads",
|
|
"kind": "CHECK",
|
|
"expression": "(estimated_amount IS NULL)=(currency IS NULL)",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_leads_check_05",
|
|
"table": "leads",
|
|
"kind": "CHECK",
|
|
"expression": "estimated_amount IS NULL OR estimated_amount >= 0",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_leads_check_06",
|
|
"table": "leads",
|
|
"kind": "CHECK",
|
|
"expression": "currency IS NULL OR currency ~ '^[A-Z]{3}$'",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_crm_opportunities_lead_id_fk",
|
|
"table": "crm_opportunities",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "lead_id -> leads.id",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_crm_opportunities_project_id_fk",
|
|
"table": "crm_opportunities",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "project_id -> projects.id",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_crm_opportunities_owner_user_id_fk",
|
|
"table": "crm_opportunities",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "owner_user_id -> users.id",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_crm_opportunities_pk",
|
|
"table": "crm_opportunities",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_crm_opportunities_check_01",
|
|
"table": "crm_opportunities",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_crm_opportunities_check_02",
|
|
"table": "crm_opportunities",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_crm_opportunities_check_03",
|
|
"table": "crm_opportunities",
|
|
"kind": "CHECK",
|
|
"expression": "stage IN ('discovery','assessment','negotiation','approved','lost')",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_crm_opportunities_check_04",
|
|
"table": "crm_opportunities",
|
|
"kind": "CHECK",
|
|
"expression": "probability BETWEEN 0 AND 100",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_crm_opportunities_check_05",
|
|
"table": "crm_opportunities",
|
|
"kind": "CHECK",
|
|
"expression": "(amount IS NULL)=(currency IS NULL)",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_crm_opportunities_check_06",
|
|
"table": "crm_opportunities",
|
|
"kind": "CHECK",
|
|
"expression": "amount IS NULL OR amount >= 0",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_crm_opportunities_check_07",
|
|
"table": "crm_opportunities",
|
|
"kind": "CHECK",
|
|
"expression": "currency IS NULL OR currency ~ '^[A-Z]{3}$'",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_activities_investor_id_fk",
|
|
"table": "activities",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "investor_id -> investors.id",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_activities_opportunity_id_fk",
|
|
"table": "activities",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "opportunity_id -> crm_opportunities.id",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_activities_actor_user_id_fk",
|
|
"table": "activities",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "actor_user_id -> users.id",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_activities_pk",
|
|
"table": "activities",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_activities_check_01",
|
|
"table": "activities",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_activities_check_02",
|
|
"table": "activities",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_activities_check_03",
|
|
"table": "activities",
|
|
"kind": "CHECK",
|
|
"expression": "activity_type IN ('call','meeting','email','note')",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_tasks_assignee_user_id_fk",
|
|
"table": "tasks",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "assignee_user_id -> users.id",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_tasks_opportunity_id_fk",
|
|
"table": "tasks",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "opportunity_id -> crm_opportunities.id",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_tasks_pk",
|
|
"table": "tasks",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_tasks_check_01",
|
|
"table": "tasks",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_tasks_check_02",
|
|
"table": "tasks",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_tasks_check_03",
|
|
"table": "tasks",
|
|
"kind": "CHECK",
|
|
"expression": "status IN ('open','in_progress','done','cancelled')",
|
|
"migration": "database/migrations/2026_09_24_007000_investmoz_crm.php"
|
|
},
|
|
{
|
|
"name": "imz_investor_journeys_investor_id_fk",
|
|
"table": "investor_journeys",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "investor_id -> investors.id",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_investor_journeys_opportunity_id_fk",
|
|
"table": "investor_journeys",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "opportunity_id -> crm_opportunities.id",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_investor_journeys_pk",
|
|
"table": "investor_journeys",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_investor_journeys_check_01",
|
|
"table": "investor_journeys",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_investor_journeys_check_02",
|
|
"table": "investor_journeys",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_investor_journeys_check_03",
|
|
"table": "investor_journeys",
|
|
"kind": "CHECK",
|
|
"expression": "status IN ('started','active','completed','cancelled')",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_journey_steps_journey_id_fk",
|
|
"table": "journey_steps",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "journey_id -> investor_journeys.id",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_journey_steps_pk",
|
|
"table": "journey_steps",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_journey_steps_check_01",
|
|
"table": "journey_steps",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_journey_steps_check_02",
|
|
"table": "journey_steps",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_journey_steps_check_03",
|
|
"table": "journey_steps",
|
|
"kind": "CHECK",
|
|
"expression": "sequence_no>0",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_journey_steps_check_04",
|
|
"table": "journey_steps",
|
|
"kind": "CHECK",
|
|
"expression": "status IN ('pending','active','completed','blocked')",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_submissions_journey_step_id_fk",
|
|
"table": "submissions",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "journey_step_id -> journey_steps.id",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_submissions_submitted_by_fk",
|
|
"table": "submissions",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "submitted_by -> users.id",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_submissions_pk",
|
|
"table": "submissions",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_submissions_check_01",
|
|
"table": "submissions",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_submissions_check_02",
|
|
"table": "submissions",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_submissions_check_03",
|
|
"table": "submissions",
|
|
"kind": "CHECK",
|
|
"expression": "status IN ('draft','submitted','accepted','rejected')",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_aftercare_plans_investor_id_fk",
|
|
"table": "aftercare_plans",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "investor_id -> investors.id",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_aftercare_plans_project_id_fk",
|
|
"table": "aftercare_plans",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "project_id -> projects.id",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_aftercare_plans_owner_user_id_fk",
|
|
"table": "aftercare_plans",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "owner_user_id -> users.id",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_aftercare_plans_pk",
|
|
"table": "aftercare_plans",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_aftercare_plans_check_01",
|
|
"table": "aftercare_plans",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_aftercare_plans_check_02",
|
|
"table": "aftercare_plans",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_aftercare_plans_check_03",
|
|
"table": "aftercare_plans",
|
|
"kind": "CHECK",
|
|
"expression": "status IN ('draft','active','closed')",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_constraints_aftercare_plan_id_fk",
|
|
"table": "constraints",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "aftercare_plan_id -> aftercare_plans.id",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_constraints_pk",
|
|
"table": "constraints",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_constraints_check_01",
|
|
"table": "constraints",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_constraints_check_02",
|
|
"table": "constraints",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_constraints_check_03",
|
|
"table": "constraints",
|
|
"kind": "CHECK",
|
|
"expression": "severity IN ('low','medium','high','critical')",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_constraints_check_04",
|
|
"table": "constraints",
|
|
"kind": "CHECK",
|
|
"expression": "status IN ('open','mitigating','resolved')",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_escalations_constraint_id_fk",
|
|
"table": "escalations",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "constraint_id -> constraints.id",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_escalations_escalated_by_fk",
|
|
"table": "escalations",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "escalated_by -> users.id",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_escalations_pk",
|
|
"table": "escalations",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_escalations_check_01",
|
|
"table": "escalations",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_escalations_check_02",
|
|
"table": "escalations",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_escalations_check_03",
|
|
"table": "escalations",
|
|
"kind": "CHECK",
|
|
"expression": "level IN ('operational','management','executive')",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_escalations_check_04",
|
|
"table": "escalations",
|
|
"kind": "CHECK",
|
|
"expression": "status IN ('open','acknowledged','closed')",
|
|
"migration": "database/migrations/2026_09_24_008000_investmoz_journey_aftercare.php"
|
|
},
|
|
{
|
|
"name": "imz_skills_pk",
|
|
"table": "skills",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php"
|
|
},
|
|
{
|
|
"name": "imz_skills_check_01",
|
|
"table": "skills",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php"
|
|
},
|
|
{
|
|
"name": "imz_skills_check_02",
|
|
"table": "skills",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php"
|
|
},
|
|
{
|
|
"name": "imz_occupations_pk",
|
|
"table": "occupations",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php"
|
|
},
|
|
{
|
|
"name": "imz_occupations_check_01",
|
|
"table": "occupations",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php"
|
|
},
|
|
{
|
|
"name": "imz_occupations_check_02",
|
|
"table": "occupations",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php"
|
|
},
|
|
{
|
|
"name": "imz_training_needs_project_id_fk",
|
|
"table": "training_needs",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "project_id -> projects.id",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php"
|
|
},
|
|
{
|
|
"name": "imz_training_needs_occupation_id_fk",
|
|
"table": "training_needs",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "occupation_id -> occupations.id",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php"
|
|
},
|
|
{
|
|
"name": "imz_training_needs_skill_id_fk",
|
|
"table": "training_needs",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "skill_id -> skills.id",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php"
|
|
},
|
|
{
|
|
"name": "imz_training_needs_pk",
|
|
"table": "training_needs",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php"
|
|
},
|
|
{
|
|
"name": "imz_training_needs_check_01",
|
|
"table": "training_needs",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php"
|
|
},
|
|
{
|
|
"name": "imz_training_needs_check_02",
|
|
"table": "training_needs",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php"
|
|
},
|
|
{
|
|
"name": "imz_training_needs_check_03",
|
|
"table": "training_needs",
|
|
"kind": "CHECK",
|
|
"expression": "quantity>0",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php"
|
|
},
|
|
{
|
|
"name": "imz_training_needs_check_04",
|
|
"table": "training_needs",
|
|
"kind": "CHECK",
|
|
"expression": "priority IN ('Must','Should','Could')",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php"
|
|
},
|
|
{
|
|
"name": "imz_training_providers_organization_id_fk",
|
|
"table": "training_providers",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "organization_id -> organizations.id",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php"
|
|
},
|
|
{
|
|
"name": "imz_training_providers_pk",
|
|
"table": "training_providers",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php"
|
|
},
|
|
{
|
|
"name": "imz_training_providers_check_01",
|
|
"table": "training_providers",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php"
|
|
},
|
|
{
|
|
"name": "imz_training_providers_check_02",
|
|
"table": "training_providers",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php"
|
|
},
|
|
{
|
|
"name": "imz_training_providers_check_03",
|
|
"table": "training_providers",
|
|
"kind": "CHECK",
|
|
"expression": "status IN ('candidate','approved','inactive')",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php"
|
|
},
|
|
{
|
|
"name": "imz_courses_provider_id_fk",
|
|
"table": "courses",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "provider_id -> training_providers.id",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php"
|
|
},
|
|
{
|
|
"name": "imz_courses_pk",
|
|
"table": "courses",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php"
|
|
},
|
|
{
|
|
"name": "imz_courses_check_01",
|
|
"table": "courses",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php"
|
|
},
|
|
{
|
|
"name": "imz_courses_check_02",
|
|
"table": "courses",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php"
|
|
},
|
|
{
|
|
"name": "imz_courses_check_03",
|
|
"table": "courses",
|
|
"kind": "CHECK",
|
|
"expression": "status IN ('draft','published','retired')",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php"
|
|
},
|
|
{
|
|
"name": "imz_education_opportunities_course_id_fk",
|
|
"table": "education_opportunities",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "course_id -> courses.id",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php"
|
|
},
|
|
{
|
|
"name": "imz_education_opportunities_geo_location_id_fk",
|
|
"table": "education_opportunities",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "geo_location_id -> geo_locations.id",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php"
|
|
},
|
|
{
|
|
"name": "imz_education_opportunities_pk",
|
|
"table": "education_opportunities",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php"
|
|
},
|
|
{
|
|
"name": "imz_education_opportunities_check_01",
|
|
"table": "education_opportunities",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php"
|
|
},
|
|
{
|
|
"name": "imz_education_opportunities_check_02",
|
|
"table": "education_opportunities",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php"
|
|
},
|
|
{
|
|
"name": "imz_education_opportunities_check_03",
|
|
"table": "education_opportunities",
|
|
"kind": "CHECK",
|
|
"expression": "capacity>=0",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php"
|
|
},
|
|
{
|
|
"name": "imz_education_opportunities_check_04",
|
|
"table": "education_opportunities",
|
|
"kind": "CHECK",
|
|
"expression": "status IN ('planned','open','closed','cancelled')",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php"
|
|
},
|
|
{
|
|
"name": "imz_education_opportunities_check_05",
|
|
"table": "education_opportunities",
|
|
"kind": "CHECK",
|
|
"expression": "end_date IS NULL OR end_date>=start_date",
|
|
"migration": "database/migrations/2026_09_24_009000_investmoz_education.php"
|
|
},
|
|
{
|
|
"name": "imz_project_documents_project_id_fk",
|
|
"table": "project_documents",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "project_id -> projects.id",
|
|
"migration": "database/migrations/2026_09_24_009500_investmoz_document_links.php"
|
|
},
|
|
{
|
|
"name": "imz_project_documents_document_id_fk",
|
|
"table": "project_documents",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "document_id -> documents.id",
|
|
"migration": "database/migrations/2026_09_24_009500_investmoz_document_links.php"
|
|
},
|
|
{
|
|
"name": "imz_project_documents_pk",
|
|
"table": "project_documents",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "project_id, document_id",
|
|
"migration": "database/migrations/2026_09_24_009500_investmoz_document_links.php"
|
|
},
|
|
{
|
|
"name": "imz_investor_documents_investor_id_fk",
|
|
"table": "investor_documents",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "investor_id -> investors.id",
|
|
"migration": "database/migrations/2026_09_24_009500_investmoz_document_links.php"
|
|
},
|
|
{
|
|
"name": "imz_investor_documents_document_id_fk",
|
|
"table": "investor_documents",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "document_id -> documents.id",
|
|
"migration": "database/migrations/2026_09_24_009500_investmoz_document_links.php"
|
|
},
|
|
{
|
|
"name": "imz_investor_documents_pk",
|
|
"table": "investor_documents",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "investor_id, document_id",
|
|
"migration": "database/migrations/2026_09_24_009500_investmoz_document_links.php"
|
|
},
|
|
{
|
|
"name": "imz_journey_documents_journey_id_fk",
|
|
"table": "journey_documents",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "journey_id -> investor_journeys.id",
|
|
"migration": "database/migrations/2026_09_24_009500_investmoz_document_links.php"
|
|
},
|
|
{
|
|
"name": "imz_journey_documents_document_id_fk",
|
|
"table": "journey_documents",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "document_id -> documents.id",
|
|
"migration": "database/migrations/2026_09_24_009500_investmoz_document_links.php"
|
|
},
|
|
{
|
|
"name": "imz_journey_documents_pk",
|
|
"table": "journey_documents",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "journey_id, document_id",
|
|
"migration": "database/migrations/2026_09_24_009500_investmoz_document_links.php"
|
|
},
|
|
{
|
|
"name": "imz_aftercare_documents_aftercare_plan_id_fk",
|
|
"table": "aftercare_documents",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "aftercare_plan_id -> aftercare_plans.id",
|
|
"migration": "database/migrations/2026_09_24_009500_investmoz_document_links.php"
|
|
},
|
|
{
|
|
"name": "imz_aftercare_documents_document_id_fk",
|
|
"table": "aftercare_documents",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "document_id -> documents.id",
|
|
"migration": "database/migrations/2026_09_24_009500_investmoz_document_links.php"
|
|
},
|
|
{
|
|
"name": "imz_aftercare_documents_pk",
|
|
"table": "aftercare_documents",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "aftercare_plan_id, document_id",
|
|
"migration": "database/migrations/2026_09_24_009500_investmoz_document_links.php"
|
|
},
|
|
{
|
|
"name": "imz_education_documents_education_opportunity_id_fk",
|
|
"table": "education_documents",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "education_opportunity_id -> education_opportunities.id",
|
|
"migration": "database/migrations/2026_09_24_009500_investmoz_document_links.php"
|
|
},
|
|
{
|
|
"name": "imz_education_documents_document_id_fk",
|
|
"table": "education_documents",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "document_id -> documents.id",
|
|
"migration": "database/migrations/2026_09_24_009500_investmoz_document_links.php"
|
|
},
|
|
{
|
|
"name": "imz_education_documents_pk",
|
|
"table": "education_documents",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "education_opportunity_id, document_id",
|
|
"migration": "database/migrations/2026_09_24_009500_investmoz_document_links.php"
|
|
},
|
|
{
|
|
"name": "imz_audit_events_actor_user_id_fk",
|
|
"table": "audit_events",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "actor_user_id -> users.id",
|
|
"migration": "database/migrations/2026_09_24_010000_investmoz_governance_ai.php"
|
|
},
|
|
{
|
|
"name": "imz_audit_events_pk",
|
|
"table": "audit_events",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_010000_investmoz_governance_ai.php"
|
|
},
|
|
{
|
|
"name": "imz_audit_events_check_01",
|
|
"table": "audit_events",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_010000_investmoz_governance_ai.php"
|
|
},
|
|
{
|
|
"name": "imz_outbox_events_pk",
|
|
"table": "outbox_events",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_011000_investmoz_integrations.php"
|
|
},
|
|
{
|
|
"name": "imz_outbox_events_check_01",
|
|
"table": "outbox_events",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_011000_investmoz_integrations.php"
|
|
},
|
|
{
|
|
"name": "imz_outbox_events_check_02",
|
|
"table": "outbox_events",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_011000_investmoz_integrations.php"
|
|
},
|
|
{
|
|
"name": "imz_outbox_events_check_03",
|
|
"table": "outbox_events",
|
|
"kind": "CHECK",
|
|
"expression": "status IN ('pending','published','failed')",
|
|
"migration": "database/migrations/2026_09_24_011000_investmoz_integrations.php"
|
|
},
|
|
{
|
|
"name": "imz_inbox_events_pk",
|
|
"table": "inbox_events",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_011000_investmoz_integrations.php"
|
|
},
|
|
{
|
|
"name": "imz_inbox_events_check_01",
|
|
"table": "inbox_events",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_011000_investmoz_integrations.php"
|
|
},
|
|
{
|
|
"name": "imz_inbox_events_check_02",
|
|
"table": "inbox_events",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_011000_investmoz_integrations.php"
|
|
},
|
|
{
|
|
"name": "imz_inbox_events_check_03",
|
|
"table": "inbox_events",
|
|
"kind": "CHECK",
|
|
"expression": "status IN ('received','processed','failed')",
|
|
"migration": "database/migrations/2026_09_24_011000_investmoz_integrations.php"
|
|
},
|
|
{
|
|
"name": "imz_sync_runs_pk",
|
|
"table": "sync_runs",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_011000_investmoz_integrations.php"
|
|
},
|
|
{
|
|
"name": "imz_sync_runs_check_01",
|
|
"table": "sync_runs",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_011000_investmoz_integrations.php"
|
|
},
|
|
{
|
|
"name": "imz_sync_runs_check_02",
|
|
"table": "sync_runs",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_011000_investmoz_integrations.php"
|
|
},
|
|
{
|
|
"name": "imz_sync_runs_check_03",
|
|
"table": "sync_runs",
|
|
"kind": "CHECK",
|
|
"expression": "direction IN ('inbound','outbound')",
|
|
"migration": "database/migrations/2026_09_24_011000_investmoz_integrations.php"
|
|
},
|
|
{
|
|
"name": "imz_sync_runs_check_04",
|
|
"table": "sync_runs",
|
|
"kind": "CHECK",
|
|
"expression": "status IN ('running','succeeded','failed','cancelled')",
|
|
"migration": "database/migrations/2026_09_24_011000_investmoz_integrations.php"
|
|
},
|
|
{
|
|
"name": "imz_reconciliation_issues_sync_run_id_fk",
|
|
"table": "reconciliation_issues",
|
|
"kind": "FOREIGN KEY",
|
|
"expression": "sync_run_id -> sync_runs.id",
|
|
"migration": "database/migrations/2026_09_24_011000_investmoz_integrations.php"
|
|
},
|
|
{
|
|
"name": "imz_reconciliation_issues_pk",
|
|
"table": "reconciliation_issues",
|
|
"kind": "PRIMARY KEY",
|
|
"expression": "id",
|
|
"migration": "database/migrations/2026_09_24_011000_investmoz_integrations.php"
|
|
},
|
|
{
|
|
"name": "imz_reconciliation_issues_check_01",
|
|
"table": "reconciliation_issues",
|
|
"kind": "CHECK",
|
|
"expression": "version_no > 0",
|
|
"migration": "database/migrations/2026_09_24_011000_investmoz_integrations.php"
|
|
},
|
|
{
|
|
"name": "imz_reconciliation_issues_check_02",
|
|
"table": "reconciliation_issues",
|
|
"kind": "CHECK",
|
|
"expression": "data_classification IN ('public','internal','confidential','restricted')",
|
|
"migration": "database/migrations/2026_09_24_011000_investmoz_integrations.php"
|
|
},
|
|
{
|
|
"name": "imz_reconciliation_issues_check_03",
|
|
"table": "reconciliation_issues",
|
|
"kind": "CHECK",
|
|
"expression": "issue_type IN ('missing','duplicate','orphan','checksum','geometry','value')",
|
|
"migration": "database/migrations/2026_09_24_011000_investmoz_integrations.php"
|
|
},
|
|
{
|
|
"name": "imz_reconciliation_issues_check_04",
|
|
"table": "reconciliation_issues",
|
|
"kind": "CHECK",
|
|
"expression": "severity IN ('warning','error')",
|
|
"migration": "database/migrations/2026_09_24_011000_investmoz_integrations.php"
|
|
},
|
|
{
|
|
"name": "imz_reconciliation_issues_check_05",
|
|
"table": "reconciliation_issues",
|
|
"kind": "CHECK",
|
|
"expression": "status IN ('open','accepted','resolved')",
|
|
"migration": "database/migrations/2026_09_24_011000_investmoz_integrations.php"
|
|
}
|
|
],
|
|
"indexes": [
|
|
{
|
|
"name": "imz_organizations_source_system_external_id_uq",
|
|
"table": "organizations",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_organizations_source_system_external_id_uq ON public.organizations USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_organizations_updated_at_idx",
|
|
"table": "organizations",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_organizations_updated_at_idx ON public.organizations USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_memberships_user_id_idx",
|
|
"table": "memberships",
|
|
"columns": [
|
|
"user_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_memberships_user_id_idx ON public.memberships USING btree (user_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_memberships_organization_id_idx",
|
|
"table": "memberships",
|
|
"columns": [
|
|
"organization_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_memberships_organization_id_idx ON public.memberships USING btree (organization_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_memberships_user_id_organization_id_uq",
|
|
"table": "memberships",
|
|
"columns": [
|
|
"user_id",
|
|
"organization_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "deleted_at IS NULL",
|
|
"method": "btree",
|
|
"reason": "Unicidade activa",
|
|
"sql": "CREATE UNIQUE INDEX imz_memberships_user_id_organization_id_uq ON public.memberships USING btree (user_id, organization_id) WHERE deleted_at IS NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_memberships_source_system_external_id_uq",
|
|
"table": "memberships",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_memberships_source_system_external_id_uq ON public.memberships USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_memberships_updated_at_idx",
|
|
"table": "memberships",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_memberships_updated_at_idx ON public.memberships USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_consents_user_id_idx",
|
|
"table": "consents",
|
|
"columns": [
|
|
"user_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_consents_user_id_idx ON public.consents USING btree (user_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_consents_source_system_external_id_uq",
|
|
"table": "consents",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_consents_source_system_external_id_uq ON public.consents USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_consents_updated_at_idx",
|
|
"table": "consents",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_consents_updated_at_idx ON public.consents USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_consents_status_idx",
|
|
"table": "consents",
|
|
"columns": [
|
|
"status"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_consents_status_idx ON public.consents USING btree (status);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_documents_storage_key_uq",
|
|
"table": "documents",
|
|
"columns": [
|
|
"storage_key"
|
|
],
|
|
"unique": true,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Unicidade de negócio",
|
|
"sql": "CREATE UNIQUE INDEX imz_documents_storage_key_uq ON public.documents USING btree (storage_key);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_documents_source_system_external_id_uq",
|
|
"table": "documents",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_documents_source_system_external_id_uq ON public.documents USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_documents_updated_at_idx",
|
|
"table": "documents",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_documents_updated_at_idx ON public.documents USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_documents_status_idx",
|
|
"table": "documents",
|
|
"columns": [
|
|
"status"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_documents_status_idx ON public.documents USING btree (status);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_geo_locations_parent_id_idx",
|
|
"table": "geo_locations",
|
|
"columns": [
|
|
"parent_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_geo_locations_parent_id_idx ON public.geo_locations USING btree (parent_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_geo_locations_source_system_external_id_uq",
|
|
"table": "geo_locations",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_geo_locations_source_system_external_id_uq ON public.geo_locations USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_geo_locations_location_type_code_uq",
|
|
"table": "geo_locations",
|
|
"columns": [
|
|
"location_type",
|
|
"code"
|
|
],
|
|
"unique": true,
|
|
"predicate": "deleted_at IS NULL",
|
|
"method": "btree",
|
|
"reason": "Unicidade activa",
|
|
"sql": "CREATE UNIQUE INDEX imz_geo_locations_location_type_code_uq ON public.geo_locations USING btree (location_type, code) WHERE deleted_at IS NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_geo_locations_updated_at_idx",
|
|
"table": "geo_locations",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_geo_locations_updated_at_idx ON public.geo_locations USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_geo_geometries_geo_location_id_idx",
|
|
"table": "geo_geometries",
|
|
"columns": [
|
|
"geo_location_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_geo_geometries_geo_location_id_idx ON public.geo_geometries USING btree (geo_location_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_geo_geometries_geo_location_id_geometry_type_uq",
|
|
"table": "geo_geometries",
|
|
"columns": [
|
|
"geo_location_id",
|
|
"geometry_type"
|
|
],
|
|
"unique": true,
|
|
"predicate": "deleted_at IS NULL",
|
|
"method": "btree",
|
|
"reason": "Unicidade activa",
|
|
"sql": "CREATE UNIQUE INDEX imz_geo_geometries_geo_location_id_geometry_type_uq ON public.geo_geometries USING btree (geo_location_id, geometry_type) WHERE deleted_at IS NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_geo_geometries_source_system_external_id_uq",
|
|
"table": "geo_geometries",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_geo_geometries_source_system_external_id_uq ON public.geo_geometries USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_geo_geometries_geom_idx",
|
|
"table": "geo_geometries",
|
|
"columns": [
|
|
"geom"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "gist",
|
|
"reason": "Intersecção e proximidade espacial SRID 4326",
|
|
"sql": "CREATE INDEX imz_geo_geometries_geom_idx ON public.geo_geometries USING gist (geom);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_geo_geometries_updated_at_idx",
|
|
"table": "geo_geometries",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_geo_geometries_updated_at_idx ON public.geo_geometries USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_projects_code_uq",
|
|
"table": "projects",
|
|
"columns": [
|
|
"code"
|
|
],
|
|
"unique": true,
|
|
"predicate": "deleted_at IS NULL",
|
|
"method": "btree",
|
|
"reason": "Unicidade de negócio",
|
|
"sql": "CREATE UNIQUE INDEX imz_projects_code_uq ON public.projects USING btree (code) WHERE deleted_at IS NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_projects_source_system_external_id_uq",
|
|
"table": "projects",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_projects_source_system_external_id_uq ON public.projects USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_projects_updated_at_idx",
|
|
"table": "projects",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_projects_updated_at_idx ON public.projects USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_projects_status_idx",
|
|
"table": "projects",
|
|
"columns": [
|
|
"status"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_projects_status_idx ON public.projects USING btree (status);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_project_locations_project_id_idx",
|
|
"table": "project_locations",
|
|
"columns": [
|
|
"project_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_project_locations_project_id_idx ON public.project_locations USING btree (project_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_project_locations_geo_location_id_idx",
|
|
"table": "project_locations",
|
|
"columns": [
|
|
"geo_location_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_project_locations_geo_location_id_idx ON public.project_locations USING btree (geo_location_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_project_locations_project_id_geo_location_id_role_uq",
|
|
"table": "project_locations",
|
|
"columns": [
|
|
"project_id",
|
|
"geo_location_id",
|
|
"role"
|
|
],
|
|
"unique": true,
|
|
"predicate": "deleted_at IS NULL",
|
|
"method": "btree",
|
|
"reason": "Unicidade activa",
|
|
"sql": "CREATE UNIQUE INDEX imz_project_locations_project_id_geo_location_id_role_uq ON public.project_locations USING btree (project_id, geo_location_id, role) WHERE deleted_at IS NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_project_locations_source_system_external_id_uq",
|
|
"table": "project_locations",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_project_locations_source_system_external_id_uq ON public.project_locations USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_project_locations_updated_at_idx",
|
|
"table": "project_locations",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_project_locations_updated_at_idx ON public.project_locations USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_economic_clusters_code_uq",
|
|
"table": "economic_clusters",
|
|
"columns": [
|
|
"code"
|
|
],
|
|
"unique": true,
|
|
"predicate": "deleted_at IS NULL",
|
|
"method": "btree",
|
|
"reason": "Unicidade de negócio",
|
|
"sql": "CREATE UNIQUE INDEX imz_economic_clusters_code_uq ON public.economic_clusters USING btree (code) WHERE deleted_at IS NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_economic_clusters_source_system_external_id_uq",
|
|
"table": "economic_clusters",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_economic_clusters_source_system_external_id_uq ON public.economic_clusters USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_economic_clusters_updated_at_idx",
|
|
"table": "economic_clusters",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_economic_clusters_updated_at_idx ON public.economic_clusters USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_economic_clusters_status_idx",
|
|
"table": "economic_clusters",
|
|
"columns": [
|
|
"status"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_economic_clusters_status_idx ON public.economic_clusters USING btree (status);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_value_chains_cluster_id_idx",
|
|
"table": "value_chains",
|
|
"columns": [
|
|
"cluster_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_value_chains_cluster_id_idx ON public.value_chains USING btree (cluster_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_value_chains_cluster_id_code_uq",
|
|
"table": "value_chains",
|
|
"columns": [
|
|
"cluster_id",
|
|
"code"
|
|
],
|
|
"unique": true,
|
|
"predicate": "deleted_at IS NULL",
|
|
"method": "btree",
|
|
"reason": "Unicidade activa",
|
|
"sql": "CREATE UNIQUE INDEX imz_value_chains_cluster_id_code_uq ON public.value_chains USING btree (cluster_id, code) WHERE deleted_at IS NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_value_chains_source_system_external_id_uq",
|
|
"table": "value_chains",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_value_chains_source_system_external_id_uq ON public.value_chains USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_value_chains_updated_at_idx",
|
|
"table": "value_chains",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_value_chains_updated_at_idx ON public.value_chains USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_value_chain_links_from_value_chain_id_idx",
|
|
"table": "value_chain_links",
|
|
"columns": [
|
|
"from_value_chain_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_value_chain_links_from_value_chain_id_idx ON public.value_chain_links USING btree (from_value_chain_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_value_chain_links_to_value_chain_id_idx",
|
|
"table": "value_chain_links",
|
|
"columns": [
|
|
"to_value_chain_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_value_chain_links_to_value_chain_id_idx ON public.value_chain_links USING btree (to_value_chain_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_value_chain_links_from_value_chain_id_to_value_c_f6a1a6162c",
|
|
"table": "value_chain_links",
|
|
"columns": [
|
|
"from_value_chain_id",
|
|
"to_value_chain_id",
|
|
"link_type"
|
|
],
|
|
"unique": true,
|
|
"predicate": "deleted_at IS NULL",
|
|
"method": "btree",
|
|
"reason": "Unicidade activa",
|
|
"sql": "CREATE UNIQUE INDEX imz_value_chain_links_from_value_chain_id_to_value_c_f6a1a6162c ON public.value_chain_links USING btree (from_value_chain_id, to_value_chain_id, link_type) WHERE deleted_at IS NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_value_chain_links_source_system_external_id_uq",
|
|
"table": "value_chain_links",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_value_chain_links_source_system_external_id_uq ON public.value_chain_links USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_value_chain_links_updated_at_idx",
|
|
"table": "value_chain_links",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_value_chain_links_updated_at_idx ON public.value_chain_links USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_cluster_projects_cluster_id_idx",
|
|
"table": "cluster_projects",
|
|
"columns": [
|
|
"cluster_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_cluster_projects_cluster_id_idx ON public.cluster_projects USING btree (cluster_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_cluster_projects_project_id_idx",
|
|
"table": "cluster_projects",
|
|
"columns": [
|
|
"project_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_cluster_projects_project_id_idx ON public.cluster_projects USING btree (project_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_cluster_projects_cluster_id_project_id_uq",
|
|
"table": "cluster_projects",
|
|
"columns": [
|
|
"cluster_id",
|
|
"project_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "deleted_at IS NULL",
|
|
"method": "btree",
|
|
"reason": "Unicidade activa",
|
|
"sql": "CREATE UNIQUE INDEX imz_cluster_projects_cluster_id_project_id_uq ON public.cluster_projects USING btree (cluster_id, project_id) WHERE deleted_at IS NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_cluster_projects_source_system_external_id_uq",
|
|
"table": "cluster_projects",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_cluster_projects_source_system_external_id_uq ON public.cluster_projects USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_cluster_projects_updated_at_idx",
|
|
"table": "cluster_projects",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_cluster_projects_updated_at_idx ON public.cluster_projects USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_anchor_project_links_anchor_project_id_idx",
|
|
"table": "anchor_project_links",
|
|
"columns": [
|
|
"anchor_project_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_anchor_project_links_anchor_project_id_idx ON public.anchor_project_links USING btree (anchor_project_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_anchor_project_links_cluster_id_idx",
|
|
"table": "anchor_project_links",
|
|
"columns": [
|
|
"cluster_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_anchor_project_links_cluster_id_idx ON public.anchor_project_links USING btree (cluster_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_anchor_project_links_anchor_project_id_cluster_id_uq",
|
|
"table": "anchor_project_links",
|
|
"columns": [
|
|
"anchor_project_id",
|
|
"cluster_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "deleted_at IS NULL",
|
|
"method": "btree",
|
|
"reason": "Unicidade activa",
|
|
"sql": "CREATE UNIQUE INDEX imz_anchor_project_links_anchor_project_id_cluster_id_uq ON public.anchor_project_links USING btree (anchor_project_id, cluster_id) WHERE deleted_at IS NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_anchor_project_links_source_system_external_id_uq",
|
|
"table": "anchor_project_links",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_anchor_project_links_source_system_external_id_uq ON public.anchor_project_links USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_anchor_project_links_updated_at_idx",
|
|
"table": "anchor_project_links",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_anchor_project_links_updated_at_idx ON public.anchor_project_links USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_complementary_project_links_anchor_project_id_idx",
|
|
"table": "complementary_project_links",
|
|
"columns": [
|
|
"anchor_project_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_complementary_project_links_anchor_project_id_idx ON public.complementary_project_links USING btree (anchor_project_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_complementary_project_links_complementary_project_id_idx",
|
|
"table": "complementary_project_links",
|
|
"columns": [
|
|
"complementary_project_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_complementary_project_links_complementary_project_id_idx ON public.complementary_project_links USING btree (complementary_project_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_complementary_project_links_anchor_project_id_co_90eddcd25a",
|
|
"table": "complementary_project_links",
|
|
"columns": [
|
|
"anchor_project_id",
|
|
"complementary_project_id",
|
|
"relation_type"
|
|
],
|
|
"unique": true,
|
|
"predicate": "deleted_at IS NULL",
|
|
"method": "btree",
|
|
"reason": "Unicidade activa",
|
|
"sql": "CREATE UNIQUE INDEX imz_complementary_project_links_anchor_project_id_co_90eddcd25a ON public.complementary_project_links USING btree (anchor_project_id, complementary_project_id, relation_type) WHERE deleted_at IS NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_complementary_project_links_source_system_external_id_uq",
|
|
"table": "complementary_project_links",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_complementary_project_links_source_system_external_id_uq ON public.complementary_project_links USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_complementary_project_links_updated_at_idx",
|
|
"table": "complementary_project_links",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_complementary_project_links_updated_at_idx ON public.complementary_project_links USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_development_corridors_code_uq",
|
|
"table": "development_corridors",
|
|
"columns": [
|
|
"code"
|
|
],
|
|
"unique": true,
|
|
"predicate": "deleted_at IS NULL",
|
|
"method": "btree",
|
|
"reason": "Unicidade de negócio",
|
|
"sql": "CREATE UNIQUE INDEX imz_development_corridors_code_uq ON public.development_corridors USING btree (code) WHERE deleted_at IS NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_development_corridors_source_system_external_id_uq",
|
|
"table": "development_corridors",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_development_corridors_source_system_external_id_uq ON public.development_corridors USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_development_corridors_updated_at_idx",
|
|
"table": "development_corridors",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_development_corridors_updated_at_idx ON public.development_corridors USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_development_corridors_status_idx",
|
|
"table": "development_corridors",
|
|
"columns": [
|
|
"status"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_development_corridors_status_idx ON public.development_corridors USING btree (status);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_corridor_locations_corridor_id_idx",
|
|
"table": "corridor_locations",
|
|
"columns": [
|
|
"corridor_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_corridor_locations_corridor_id_idx ON public.corridor_locations USING btree (corridor_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_corridor_locations_geo_location_id_idx",
|
|
"table": "corridor_locations",
|
|
"columns": [
|
|
"geo_location_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_corridor_locations_geo_location_id_idx ON public.corridor_locations USING btree (geo_location_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_corridor_locations_corridor_id_geo_location_id_uq",
|
|
"table": "corridor_locations",
|
|
"columns": [
|
|
"corridor_id",
|
|
"geo_location_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "deleted_at IS NULL",
|
|
"method": "btree",
|
|
"reason": "Unicidade activa",
|
|
"sql": "CREATE UNIQUE INDEX imz_corridor_locations_corridor_id_geo_location_id_uq ON public.corridor_locations USING btree (corridor_id, geo_location_id) WHERE deleted_at IS NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_corridor_locations_corridor_id_sequence_no_uq",
|
|
"table": "corridor_locations",
|
|
"columns": [
|
|
"corridor_id",
|
|
"sequence_no"
|
|
],
|
|
"unique": true,
|
|
"predicate": "deleted_at IS NULL",
|
|
"method": "btree",
|
|
"reason": "Unicidade activa",
|
|
"sql": "CREATE UNIQUE INDEX imz_corridor_locations_corridor_id_sequence_no_uq ON public.corridor_locations USING btree (corridor_id, sequence_no) WHERE deleted_at IS NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_corridor_locations_source_system_external_id_uq",
|
|
"table": "corridor_locations",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_corridor_locations_source_system_external_id_uq ON public.corridor_locations USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_corridor_locations_updated_at_idx",
|
|
"table": "corridor_locations",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_corridor_locations_updated_at_idx ON public.corridor_locations USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_corridor_projects_corridor_id_idx",
|
|
"table": "corridor_projects",
|
|
"columns": [
|
|
"corridor_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_corridor_projects_corridor_id_idx ON public.corridor_projects USING btree (corridor_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_corridor_projects_project_id_idx",
|
|
"table": "corridor_projects",
|
|
"columns": [
|
|
"project_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_corridor_projects_project_id_idx ON public.corridor_projects USING btree (project_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_corridor_projects_corridor_id_project_id_uq",
|
|
"table": "corridor_projects",
|
|
"columns": [
|
|
"corridor_id",
|
|
"project_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "deleted_at IS NULL",
|
|
"method": "btree",
|
|
"reason": "Unicidade activa",
|
|
"sql": "CREATE UNIQUE INDEX imz_corridor_projects_corridor_id_project_id_uq ON public.corridor_projects USING btree (corridor_id, project_id) WHERE deleted_at IS NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_corridor_projects_source_system_external_id_uq",
|
|
"table": "corridor_projects",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_corridor_projects_source_system_external_id_uq ON public.corridor_projects USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_corridor_projects_updated_at_idx",
|
|
"table": "corridor_projects",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_corridor_projects_updated_at_idx ON public.corridor_projects USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_corridor_clusters_corridor_id_idx",
|
|
"table": "corridor_clusters",
|
|
"columns": [
|
|
"corridor_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_corridor_clusters_corridor_id_idx ON public.corridor_clusters USING btree (corridor_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_corridor_clusters_cluster_id_idx",
|
|
"table": "corridor_clusters",
|
|
"columns": [
|
|
"cluster_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_corridor_clusters_cluster_id_idx ON public.corridor_clusters USING btree (cluster_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_corridor_clusters_corridor_id_cluster_id_uq",
|
|
"table": "corridor_clusters",
|
|
"columns": [
|
|
"corridor_id",
|
|
"cluster_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "deleted_at IS NULL",
|
|
"method": "btree",
|
|
"reason": "Unicidade activa",
|
|
"sql": "CREATE UNIQUE INDEX imz_corridor_clusters_corridor_id_cluster_id_uq ON public.corridor_clusters USING btree (corridor_id, cluster_id) WHERE deleted_at IS NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_corridor_clusters_source_system_external_id_uq",
|
|
"table": "corridor_clusters",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_corridor_clusters_source_system_external_id_uq ON public.corridor_clusters USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_corridor_clusters_updated_at_idx",
|
|
"table": "corridor_clusters",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_corridor_clusters_updated_at_idx ON public.corridor_clusters USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_investors_organization_id_idx",
|
|
"table": "investors",
|
|
"columns": [
|
|
"organization_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_investors_organization_id_idx ON public.investors USING btree (organization_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_investors_source_system_external_id_uq",
|
|
"table": "investors",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_investors_source_system_external_id_uq ON public.investors USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_investors_updated_at_idx",
|
|
"table": "investors",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_investors_updated_at_idx ON public.investors USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_investors_status_idx",
|
|
"table": "investors",
|
|
"columns": [
|
|
"status"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_investors_status_idx ON public.investors USING btree (status);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_contacts_source_system_external_id_uq",
|
|
"table": "contacts",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_contacts_source_system_external_id_uq ON public.contacts USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_contacts_updated_at_idx",
|
|
"table": "contacts",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_contacts_updated_at_idx ON public.contacts USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_investor_contacts_investor_id_idx",
|
|
"table": "investor_contacts",
|
|
"columns": [
|
|
"investor_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_investor_contacts_investor_id_idx ON public.investor_contacts USING btree (investor_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_investor_contacts_contact_id_idx",
|
|
"table": "investor_contacts",
|
|
"columns": [
|
|
"contact_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_investor_contacts_contact_id_idx ON public.investor_contacts USING btree (contact_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_investor_contacts_updated_at_idx",
|
|
"table": "investor_contacts",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_investor_contacts_updated_at_idx ON public.investor_contacts USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_leads_investor_id_idx",
|
|
"table": "leads",
|
|
"columns": [
|
|
"investor_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_leads_investor_id_idx ON public.leads USING btree (investor_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_leads_owner_user_id_idx",
|
|
"table": "leads",
|
|
"columns": [
|
|
"owner_user_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_leads_owner_user_id_idx ON public.leads USING btree (owner_user_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_leads_source_system_external_id_uq",
|
|
"table": "leads",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_leads_source_system_external_id_uq ON public.leads USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_leads_updated_at_idx",
|
|
"table": "leads",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_leads_updated_at_idx ON public.leads USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_leads_status_idx",
|
|
"table": "leads",
|
|
"columns": [
|
|
"status"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_leads_status_idx ON public.leads USING btree (status);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_crm_opportunities_lead_id_idx",
|
|
"table": "crm_opportunities",
|
|
"columns": [
|
|
"lead_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_crm_opportunities_lead_id_idx ON public.crm_opportunities USING btree (lead_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_crm_opportunities_project_id_idx",
|
|
"table": "crm_opportunities",
|
|
"columns": [
|
|
"project_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_crm_opportunities_project_id_idx ON public.crm_opportunities USING btree (project_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_crm_opportunities_owner_user_id_idx",
|
|
"table": "crm_opportunities",
|
|
"columns": [
|
|
"owner_user_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_crm_opportunities_owner_user_id_idx ON public.crm_opportunities USING btree (owner_user_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_crm_opportunities_source_system_external_id_uq",
|
|
"table": "crm_opportunities",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_crm_opportunities_source_system_external_id_uq ON public.crm_opportunities USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_crm_opportunities_updated_at_idx",
|
|
"table": "crm_opportunities",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_crm_opportunities_updated_at_idx ON public.crm_opportunities USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_activities_investor_id_idx",
|
|
"table": "activities",
|
|
"columns": [
|
|
"investor_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_activities_investor_id_idx ON public.activities USING btree (investor_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_activities_opportunity_id_idx",
|
|
"table": "activities",
|
|
"columns": [
|
|
"opportunity_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_activities_opportunity_id_idx ON public.activities USING btree (opportunity_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_activities_actor_user_id_idx",
|
|
"table": "activities",
|
|
"columns": [
|
|
"actor_user_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_activities_actor_user_id_idx ON public.activities USING btree (actor_user_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_activities_source_system_external_id_uq",
|
|
"table": "activities",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_activities_source_system_external_id_uq ON public.activities USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_activities_updated_at_idx",
|
|
"table": "activities",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_activities_updated_at_idx ON public.activities USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_tasks_assignee_user_id_idx",
|
|
"table": "tasks",
|
|
"columns": [
|
|
"assignee_user_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_tasks_assignee_user_id_idx ON public.tasks USING btree (assignee_user_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_tasks_opportunity_id_idx",
|
|
"table": "tasks",
|
|
"columns": [
|
|
"opportunity_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_tasks_opportunity_id_idx ON public.tasks USING btree (opportunity_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_tasks_source_system_external_id_uq",
|
|
"table": "tasks",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_tasks_source_system_external_id_uq ON public.tasks USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_tasks_updated_at_idx",
|
|
"table": "tasks",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_tasks_updated_at_idx ON public.tasks USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_tasks_status_idx",
|
|
"table": "tasks",
|
|
"columns": [
|
|
"status"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_tasks_status_idx ON public.tasks USING btree (status);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_investor_journeys_investor_id_idx",
|
|
"table": "investor_journeys",
|
|
"columns": [
|
|
"investor_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_investor_journeys_investor_id_idx ON public.investor_journeys USING btree (investor_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_investor_journeys_opportunity_id_idx",
|
|
"table": "investor_journeys",
|
|
"columns": [
|
|
"opportunity_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_investor_journeys_opportunity_id_idx ON public.investor_journeys USING btree (opportunity_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_investor_journeys_source_system_external_id_uq",
|
|
"table": "investor_journeys",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_investor_journeys_source_system_external_id_uq ON public.investor_journeys USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_investor_journeys_updated_at_idx",
|
|
"table": "investor_journeys",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_investor_journeys_updated_at_idx ON public.investor_journeys USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_investor_journeys_status_idx",
|
|
"table": "investor_journeys",
|
|
"columns": [
|
|
"status"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_investor_journeys_status_idx ON public.investor_journeys USING btree (status);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_journey_steps_journey_id_idx",
|
|
"table": "journey_steps",
|
|
"columns": [
|
|
"journey_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_journey_steps_journey_id_idx ON public.journey_steps USING btree (journey_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_journey_steps_journey_id_sequence_no_uq",
|
|
"table": "journey_steps",
|
|
"columns": [
|
|
"journey_id",
|
|
"sequence_no"
|
|
],
|
|
"unique": true,
|
|
"predicate": "deleted_at IS NULL",
|
|
"method": "btree",
|
|
"reason": "Unicidade activa",
|
|
"sql": "CREATE UNIQUE INDEX imz_journey_steps_journey_id_sequence_no_uq ON public.journey_steps USING btree (journey_id, sequence_no) WHERE deleted_at IS NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_journey_steps_journey_id_step_code_uq",
|
|
"table": "journey_steps",
|
|
"columns": [
|
|
"journey_id",
|
|
"step_code"
|
|
],
|
|
"unique": true,
|
|
"predicate": "deleted_at IS NULL",
|
|
"method": "btree",
|
|
"reason": "Unicidade activa",
|
|
"sql": "CREATE UNIQUE INDEX imz_journey_steps_journey_id_step_code_uq ON public.journey_steps USING btree (journey_id, step_code) WHERE deleted_at IS NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_journey_steps_source_system_external_id_uq",
|
|
"table": "journey_steps",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_journey_steps_source_system_external_id_uq ON public.journey_steps USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_journey_steps_updated_at_idx",
|
|
"table": "journey_steps",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_journey_steps_updated_at_idx ON public.journey_steps USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_journey_steps_status_idx",
|
|
"table": "journey_steps",
|
|
"columns": [
|
|
"status"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_journey_steps_status_idx ON public.journey_steps USING btree (status);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_submissions_journey_step_id_idx",
|
|
"table": "submissions",
|
|
"columns": [
|
|
"journey_step_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_submissions_journey_step_id_idx ON public.submissions USING btree (journey_step_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_submissions_submitted_by_idx",
|
|
"table": "submissions",
|
|
"columns": [
|
|
"submitted_by"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_submissions_submitted_by_idx ON public.submissions USING btree (submitted_by);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_submissions_source_system_external_id_uq",
|
|
"table": "submissions",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_submissions_source_system_external_id_uq ON public.submissions USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_submissions_updated_at_idx",
|
|
"table": "submissions",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_submissions_updated_at_idx ON public.submissions USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_submissions_status_idx",
|
|
"table": "submissions",
|
|
"columns": [
|
|
"status"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_submissions_status_idx ON public.submissions USING btree (status);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_aftercare_plans_investor_id_idx",
|
|
"table": "aftercare_plans",
|
|
"columns": [
|
|
"investor_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_aftercare_plans_investor_id_idx ON public.aftercare_plans USING btree (investor_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_aftercare_plans_project_id_idx",
|
|
"table": "aftercare_plans",
|
|
"columns": [
|
|
"project_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_aftercare_plans_project_id_idx ON public.aftercare_plans USING btree (project_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_aftercare_plans_owner_user_id_idx",
|
|
"table": "aftercare_plans",
|
|
"columns": [
|
|
"owner_user_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_aftercare_plans_owner_user_id_idx ON public.aftercare_plans USING btree (owner_user_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_aftercare_plans_source_system_external_id_uq",
|
|
"table": "aftercare_plans",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_aftercare_plans_source_system_external_id_uq ON public.aftercare_plans USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_aftercare_plans_updated_at_idx",
|
|
"table": "aftercare_plans",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_aftercare_plans_updated_at_idx ON public.aftercare_plans USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_aftercare_plans_status_idx",
|
|
"table": "aftercare_plans",
|
|
"columns": [
|
|
"status"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_aftercare_plans_status_idx ON public.aftercare_plans USING btree (status);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_constraints_aftercare_plan_id_idx",
|
|
"table": "constraints",
|
|
"columns": [
|
|
"aftercare_plan_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_constraints_aftercare_plan_id_idx ON public.constraints USING btree (aftercare_plan_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_constraints_source_system_external_id_uq",
|
|
"table": "constraints",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_constraints_source_system_external_id_uq ON public.constraints USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_constraints_updated_at_idx",
|
|
"table": "constraints",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_constraints_updated_at_idx ON public.constraints USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_constraints_status_idx",
|
|
"table": "constraints",
|
|
"columns": [
|
|
"status"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_constraints_status_idx ON public.constraints USING btree (status);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_escalations_constraint_id_idx",
|
|
"table": "escalations",
|
|
"columns": [
|
|
"constraint_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_escalations_constraint_id_idx ON public.escalations USING btree (constraint_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_escalations_escalated_by_idx",
|
|
"table": "escalations",
|
|
"columns": [
|
|
"escalated_by"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_escalations_escalated_by_idx ON public.escalations USING btree (escalated_by);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_escalations_source_system_external_id_uq",
|
|
"table": "escalations",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_escalations_source_system_external_id_uq ON public.escalations USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_escalations_updated_at_idx",
|
|
"table": "escalations",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_escalations_updated_at_idx ON public.escalations USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_escalations_status_idx",
|
|
"table": "escalations",
|
|
"columns": [
|
|
"status"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_escalations_status_idx ON public.escalations USING btree (status);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_skills_code_uq",
|
|
"table": "skills",
|
|
"columns": [
|
|
"code"
|
|
],
|
|
"unique": true,
|
|
"predicate": "deleted_at IS NULL",
|
|
"method": "btree",
|
|
"reason": "Unicidade de negócio",
|
|
"sql": "CREATE UNIQUE INDEX imz_skills_code_uq ON public.skills USING btree (code) WHERE deleted_at IS NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_skills_source_system_external_id_uq",
|
|
"table": "skills",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_skills_source_system_external_id_uq ON public.skills USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_skills_updated_at_idx",
|
|
"table": "skills",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_skills_updated_at_idx ON public.skills USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_occupations_code_uq",
|
|
"table": "occupations",
|
|
"columns": [
|
|
"code"
|
|
],
|
|
"unique": true,
|
|
"predicate": "deleted_at IS NULL",
|
|
"method": "btree",
|
|
"reason": "Unicidade de negócio",
|
|
"sql": "CREATE UNIQUE INDEX imz_occupations_code_uq ON public.occupations USING btree (code) WHERE deleted_at IS NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_occupations_source_system_external_id_uq",
|
|
"table": "occupations",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_occupations_source_system_external_id_uq ON public.occupations USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_occupations_updated_at_idx",
|
|
"table": "occupations",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_occupations_updated_at_idx ON public.occupations USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_training_needs_project_id_idx",
|
|
"table": "training_needs",
|
|
"columns": [
|
|
"project_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_training_needs_project_id_idx ON public.training_needs USING btree (project_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_training_needs_occupation_id_idx",
|
|
"table": "training_needs",
|
|
"columns": [
|
|
"occupation_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_training_needs_occupation_id_idx ON public.training_needs USING btree (occupation_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_training_needs_skill_id_idx",
|
|
"table": "training_needs",
|
|
"columns": [
|
|
"skill_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_training_needs_skill_id_idx ON public.training_needs USING btree (skill_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_training_needs_source_system_external_id_uq",
|
|
"table": "training_needs",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_training_needs_source_system_external_id_uq ON public.training_needs USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_training_needs_updated_at_idx",
|
|
"table": "training_needs",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_training_needs_updated_at_idx ON public.training_needs USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_training_providers_organization_id_idx",
|
|
"table": "training_providers",
|
|
"columns": [
|
|
"organization_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_training_providers_organization_id_idx ON public.training_providers USING btree (organization_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_training_providers_source_system_external_id_uq",
|
|
"table": "training_providers",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_training_providers_source_system_external_id_uq ON public.training_providers USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_training_providers_updated_at_idx",
|
|
"table": "training_providers",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_training_providers_updated_at_idx ON public.training_providers USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_training_providers_status_idx",
|
|
"table": "training_providers",
|
|
"columns": [
|
|
"status"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_training_providers_status_idx ON public.training_providers USING btree (status);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_courses_provider_id_idx",
|
|
"table": "courses",
|
|
"columns": [
|
|
"provider_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_courses_provider_id_idx ON public.courses USING btree (provider_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_courses_provider_id_code_uq",
|
|
"table": "courses",
|
|
"columns": [
|
|
"provider_id",
|
|
"code"
|
|
],
|
|
"unique": true,
|
|
"predicate": "deleted_at IS NULL",
|
|
"method": "btree",
|
|
"reason": "Unicidade activa",
|
|
"sql": "CREATE UNIQUE INDEX imz_courses_provider_id_code_uq ON public.courses USING btree (provider_id, code) WHERE deleted_at IS NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_courses_source_system_external_id_uq",
|
|
"table": "courses",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_courses_source_system_external_id_uq ON public.courses USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_courses_updated_at_idx",
|
|
"table": "courses",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_courses_updated_at_idx ON public.courses USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_courses_status_idx",
|
|
"table": "courses",
|
|
"columns": [
|
|
"status"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_courses_status_idx ON public.courses USING btree (status);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_education_opportunities_course_id_idx",
|
|
"table": "education_opportunities",
|
|
"columns": [
|
|
"course_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_education_opportunities_course_id_idx ON public.education_opportunities USING btree (course_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_education_opportunities_geo_location_id_idx",
|
|
"table": "education_opportunities",
|
|
"columns": [
|
|
"geo_location_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_education_opportunities_geo_location_id_idx ON public.education_opportunities USING btree (geo_location_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_education_opportunities_source_system_external_id_uq",
|
|
"table": "education_opportunities",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_education_opportunities_source_system_external_id_uq ON public.education_opportunities USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_education_opportunities_updated_at_idx",
|
|
"table": "education_opportunities",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_education_opportunities_updated_at_idx ON public.education_opportunities USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_education_opportunities_status_idx",
|
|
"table": "education_opportunities",
|
|
"columns": [
|
|
"status"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_education_opportunities_status_idx ON public.education_opportunities USING btree (status);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_project_documents_project_id_idx",
|
|
"table": "project_documents",
|
|
"columns": [
|
|
"project_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_project_documents_project_id_idx ON public.project_documents USING btree (project_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_project_documents_document_id_idx",
|
|
"table": "project_documents",
|
|
"columns": [
|
|
"document_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_project_documents_document_id_idx ON public.project_documents USING btree (document_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_investor_documents_investor_id_idx",
|
|
"table": "investor_documents",
|
|
"columns": [
|
|
"investor_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_investor_documents_investor_id_idx ON public.investor_documents USING btree (investor_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_investor_documents_document_id_idx",
|
|
"table": "investor_documents",
|
|
"columns": [
|
|
"document_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_investor_documents_document_id_idx ON public.investor_documents USING btree (document_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_journey_documents_journey_id_idx",
|
|
"table": "journey_documents",
|
|
"columns": [
|
|
"journey_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_journey_documents_journey_id_idx ON public.journey_documents USING btree (journey_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_journey_documents_document_id_idx",
|
|
"table": "journey_documents",
|
|
"columns": [
|
|
"document_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_journey_documents_document_id_idx ON public.journey_documents USING btree (document_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_aftercare_documents_aftercare_plan_id_idx",
|
|
"table": "aftercare_documents",
|
|
"columns": [
|
|
"aftercare_plan_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_aftercare_documents_aftercare_plan_id_idx ON public.aftercare_documents USING btree (aftercare_plan_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_aftercare_documents_document_id_idx",
|
|
"table": "aftercare_documents",
|
|
"columns": [
|
|
"document_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_aftercare_documents_document_id_idx ON public.aftercare_documents USING btree (document_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_education_documents_education_opportunity_id_idx",
|
|
"table": "education_documents",
|
|
"columns": [
|
|
"education_opportunity_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_education_documents_education_opportunity_id_idx ON public.education_documents USING btree (education_opportunity_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_education_documents_document_id_idx",
|
|
"table": "education_documents",
|
|
"columns": [
|
|
"document_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_education_documents_document_id_idx ON public.education_documents USING btree (document_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_audit_events_actor_user_id_idx",
|
|
"table": "audit_events",
|
|
"columns": [
|
|
"actor_user_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_audit_events_actor_user_id_idx ON public.audit_events USING btree (actor_user_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_audit_events_source_system_external_id_uq",
|
|
"table": "audit_events",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_audit_events_source_system_external_id_uq ON public.audit_events USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_outbox_events_source_system_external_id_uq",
|
|
"table": "outbox_events",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_outbox_events_source_system_external_id_uq ON public.outbox_events USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_outbox_events_updated_at_idx",
|
|
"table": "outbox_events",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_outbox_events_updated_at_idx ON public.outbox_events USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_outbox_events_status_idx",
|
|
"table": "outbox_events",
|
|
"columns": [
|
|
"status"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_outbox_events_status_idx ON public.outbox_events USING btree (status);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_inbox_events_message_id_uq",
|
|
"table": "inbox_events",
|
|
"columns": [
|
|
"message_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Unicidade de negócio",
|
|
"sql": "CREATE UNIQUE INDEX imz_inbox_events_message_id_uq ON public.inbox_events USING btree (message_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_inbox_events_source_system_external_id_uq",
|
|
"table": "inbox_events",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_inbox_events_source_system_external_id_uq ON public.inbox_events USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_inbox_events_updated_at_idx",
|
|
"table": "inbox_events",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_inbox_events_updated_at_idx ON public.inbox_events USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_inbox_events_status_idx",
|
|
"table": "inbox_events",
|
|
"columns": [
|
|
"status"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_inbox_events_status_idx ON public.inbox_events USING btree (status);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_sync_runs_source_system_external_id_uq",
|
|
"table": "sync_runs",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_sync_runs_source_system_external_id_uq ON public.sync_runs USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_sync_runs_updated_at_idx",
|
|
"table": "sync_runs",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_sync_runs_updated_at_idx ON public.sync_runs USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_sync_runs_status_idx",
|
|
"table": "sync_runs",
|
|
"columns": [
|
|
"status"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_sync_runs_status_idx ON public.sync_runs USING btree (status);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_reconciliation_issues_sync_run_id_idx",
|
|
"table": "reconciliation_issues",
|
|
"columns": [
|
|
"sync_run_id"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Consulta por chave estrangeira",
|
|
"sql": "CREATE INDEX imz_reconciliation_issues_sync_run_id_idx ON public.reconciliation_issues USING btree (sync_run_id);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_reconciliation_issues_source_system_external_id_uq",
|
|
"table": "reconciliation_issues",
|
|
"columns": [
|
|
"source_system",
|
|
"external_id"
|
|
],
|
|
"unique": true,
|
|
"predicate": "external_id IS NOT NULL",
|
|
"method": "btree",
|
|
"reason": "Deduplicação de importação",
|
|
"sql": "CREATE UNIQUE INDEX imz_reconciliation_issues_source_system_external_id_uq ON public.reconciliation_issues USING btree (source_system, external_id) WHERE external_id IS NOT NULL;",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_reconciliation_issues_updated_at_idx",
|
|
"table": "reconciliation_issues",
|
|
"columns": [
|
|
"updated_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_reconciliation_issues_updated_at_idx ON public.reconciliation_issues USING btree (updated_at);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_reconciliation_issues_status_idx",
|
|
"table": "reconciliation_issues",
|
|
"columns": [
|
|
"status"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Filtragem operacional e sincronização incremental",
|
|
"sql": "CREATE INDEX imz_reconciliation_issues_status_idx ON public.reconciliation_issues USING btree (status);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_geo_geometries_properties_idx",
|
|
"table": "geo_geometries",
|
|
"columns": [
|
|
"properties"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "gin",
|
|
"reason": "Consultas de contenção JSONB documentadas em A.25/A.26",
|
|
"sql": "CREATE INDEX imz_geo_geometries_properties_idx ON public.geo_geometries USING gin (properties);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_projects_metadata_idx",
|
|
"table": "projects",
|
|
"columns": [
|
|
"metadata"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "gin",
|
|
"reason": "Consultas de contenção JSONB documentadas em A.25/A.26",
|
|
"sql": "CREATE INDEX imz_projects_metadata_idx ON public.projects USING gin (metadata);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_submissions_payload_idx",
|
|
"table": "submissions",
|
|
"columns": [
|
|
"payload"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "gin",
|
|
"reason": "Consultas de contenção JSONB documentadas em A.25/A.26",
|
|
"sql": "CREATE INDEX imz_submissions_payload_idx ON public.submissions USING gin (payload);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_audit_events_after_data_idx",
|
|
"table": "audit_events",
|
|
"columns": [
|
|
"after_data"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "gin",
|
|
"reason": "Consultas de contenção JSONB documentadas em A.25/A.26",
|
|
"sql": "CREATE INDEX imz_audit_events_after_data_idx ON public.audit_events USING gin (after_data);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_outbox_events_status_available_at_idx",
|
|
"table": "outbox_events",
|
|
"columns": [
|
|
"status",
|
|
"available_at"
|
|
],
|
|
"unique": false,
|
|
"predicate": "status = 'pending'",
|
|
"method": "btree",
|
|
"reason": "Selecção dos eventos pendentes para entrega",
|
|
"sql": "CREATE INDEX imz_outbox_events_status_available_at_idx ON public.outbox_events USING btree (status, available_at) WHERE status = 'pending';",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
},
|
|
{
|
|
"name": "imz_reconciliation_issues_sync_run_id_status_idx",
|
|
"table": "reconciliation_issues",
|
|
"columns": [
|
|
"sync_run_id",
|
|
"status"
|
|
],
|
|
"unique": false,
|
|
"predicate": null,
|
|
"method": "btree",
|
|
"reason": "Reconciliação por execução e estado",
|
|
"sql": "CREATE INDEX imz_reconciliation_issues_sync_run_id_status_idx ON public.reconciliation_issues USING btree (sync_run_id, status);",
|
|
"migration": "database/migrations/2026_09_24_012000_investmoz_indexes.php"
|
|
}
|
|
],
|
|
"triggers": [
|
|
{
|
|
"name": "imz_organizations_updated",
|
|
"table": "organizations",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_memberships_updated",
|
|
"table": "memberships",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_consents_updated",
|
|
"table": "consents",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_documents_updated",
|
|
"table": "documents",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_geo_locations_updated",
|
|
"table": "geo_locations",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_geo_geometries_updated",
|
|
"table": "geo_geometries",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_projects_updated",
|
|
"table": "projects",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_project_locations_updated",
|
|
"table": "project_locations",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_economic_clusters_updated",
|
|
"table": "economic_clusters",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_value_chains_updated",
|
|
"table": "value_chains",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_value_chain_links_updated",
|
|
"table": "value_chain_links",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_cluster_projects_updated",
|
|
"table": "cluster_projects",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_anchor_project_links_updated",
|
|
"table": "anchor_project_links",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_complementary_project_links_updated",
|
|
"table": "complementary_project_links",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_development_corridors_updated",
|
|
"table": "development_corridors",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_corridor_locations_updated",
|
|
"table": "corridor_locations",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_corridor_projects_updated",
|
|
"table": "corridor_projects",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_corridor_clusters_updated",
|
|
"table": "corridor_clusters",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_investors_updated",
|
|
"table": "investors",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_contacts_updated",
|
|
"table": "contacts",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_investor_contacts_updated",
|
|
"table": "investor_contacts",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_leads_updated",
|
|
"table": "leads",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_crm_opportunities_updated",
|
|
"table": "crm_opportunities",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_activities_updated",
|
|
"table": "activities",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_tasks_updated",
|
|
"table": "tasks",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_investor_journeys_updated",
|
|
"table": "investor_journeys",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_journey_steps_updated",
|
|
"table": "journey_steps",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_submissions_updated",
|
|
"table": "submissions",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_aftercare_plans_updated",
|
|
"table": "aftercare_plans",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_constraints_updated",
|
|
"table": "constraints",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_escalations_updated",
|
|
"table": "escalations",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_skills_updated",
|
|
"table": "skills",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_occupations_updated",
|
|
"table": "occupations",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_training_needs_updated",
|
|
"table": "training_needs",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_training_providers_updated",
|
|
"table": "training_providers",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_courses_updated",
|
|
"table": "courses",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_education_opportunities_updated",
|
|
"table": "education_opportunities",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_outbox_events_updated",
|
|
"table": "outbox_events",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_inbox_events_updated",
|
|
"table": "inbox_events",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_sync_runs_updated",
|
|
"table": "sync_runs",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_reconciliation_issues_updated",
|
|
"table": "reconciliation_issues",
|
|
"event": "BEFORE UPDATE",
|
|
"function": "investmoz_set_updated_at",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_audit_events_immutable",
|
|
"table": "audit_events",
|
|
"event": "BEFORE UPDATE OR DELETE OR TRUNCATE",
|
|
"function": "investmoz_reject_audit_change",
|
|
"level": "STATEMENT"
|
|
},
|
|
{
|
|
"name": "imz_outbox_events_envelope",
|
|
"table": "outbox_events",
|
|
"event": "BEFORE UPDATE OR DELETE",
|
|
"function": "investmoz_protect_event_envelope",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_outbox_events_no_truncate",
|
|
"table": "outbox_events",
|
|
"event": "BEFORE TRUNCATE",
|
|
"function": "investmoz_reject_audit_change",
|
|
"level": "STATEMENT"
|
|
},
|
|
{
|
|
"name": "imz_inbox_events_envelope",
|
|
"table": "inbox_events",
|
|
"event": "BEFORE UPDATE OR DELETE",
|
|
"function": "investmoz_protect_event_envelope",
|
|
"level": "ROW"
|
|
},
|
|
{
|
|
"name": "imz_inbox_events_no_truncate",
|
|
"table": "inbox_events",
|
|
"event": "BEFORE TRUNCATE",
|
|
"function": "investmoz_reject_audit_change",
|
|
"level": "STATEMENT"
|
|
}
|
|
],
|
|
"functions": [
|
|
"investmoz_set_updated_at",
|
|
"investmoz_reject_audit_change",
|
|
"investmoz_protect_event_envelope"
|
|
],
|
|
"views": [],
|
|
"materialized_views": [],
|
|
"custom_types": [],
|
|
"sequences": [],
|
|
"rls_policies": [],
|
|
"note": "New reconciled schema only. Existing application schema is catalogued separately."
|
|
}
|