text: /*
  	Script de criação de banco de dados MySQL para 
      utilizar em conjunto com o Python com os dados
      da API Guará/Trackmob
      
      author: Guaraci Falcão (guaraci.falcao@outlook.com)
      github:Falcao74
      data: 08/02/2022
  
  */
  
  /* === Tabela de Doadores === */
  
  CREATE TABLE IF NOT EXISTS `constituents` (
    `id` BIGINT NULL DEFAULT NULL,
    `cpf_cnpj` TEXT NULL DEFAULT NULL,
    `type_person` TEXT NULL DEFAULT NULL,
    `name` TEXT NULL DEFAULT NULL,
    `email` TEXT NULL DEFAULT NULL,
    `person_responsible` TEXT NULL DEFAULT NULL,
    `birth_date` TEXT NULL DEFAULT NULL,
    `scholarity` TEXT NULL DEFAULT NULL,
    `active` TINYINT(1) NULL DEFAULT NULL,
    `cellphone` TEXT NULL DEFAULT NULL,
    `residence` TEXT NULL DEFAULT NULL,
    `commercial` TEXT NULL DEFAULT NULL,
    `sms` TEXT NULL DEFAULT NULL,
    `calls` TEXT NULL DEFAULT NULL,
    `correspondence` TEXT NULL DEFAULT NULL,
    `eletronic_mail` TEXT NULL DEFAULT NULL,
    `organization` TEXT NULL DEFAULT NULL,
    `organization_id` BIGINT NULL DEFAULT NULL,
    `campaign` TEXT NULL DEFAULT NULL,
    `campaign_id` BIGINT NULL DEFAULT NULL,
    `gender` TEXT NULL DEFAULT NULL,
    `profession` TEXT NULL DEFAULT NULL,
    `created_at` TEXT NULL DEFAULT NULL,
    `updated_at` TEXT NULL DEFAULT NULL)
  ENGINE = InnoDB
  DEFAULT CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci;
  
  /* ==== Tabela de Doações ==== */
  
  CREATE TABLE IF NOT EXISTS `donations` (
    `id` BIGINT NULL DEFAULT NULL,
    `recurrent` TINYINT(1) NULL DEFAULT NULL,
    `value` TEXT NULL DEFAULT NULL,
    `type_payment` TEXT NULL DEFAULT NULL,
    `status` TEXT NULL DEFAULT NULL,
    `payment_day` BIGINT NULL DEFAULT NULL,
    `paused_date` TEXT NULL DEFAULT NULL,
    `owner_account` BLOB NULL DEFAULT NULL,
    `agency` TEXT NULL DEFAULT NULL,
    `account_number` TEXT NULL DEFAULT NULL,
    `dv` TEXT NULL DEFAULT NULL,
    `card_number` TEXT NULL DEFAULT NULL,
    `validity` TEXT NULL DEFAULT NULL,
    `security_code` TEXT NULL DEFAULT NULL,
    `constituent_id` BIGINT NULL DEFAULT NULL,
    `lead_id` TEXT NULL DEFAULT NULL,
    `card_brand_id` DOUBLE NULL DEFAULT NULL,
    `bank_id` BIGINT NULL DEFAULT NULL,
    `payments_count` BIGINT NULL DEFAULT NULL,
    `account_configuration_id` BIGINT NULL DEFAULT NULL,
    `frequency` TEXT NULL DEFAULT NULL,
    `campaign_id` BIGINT NULL DEFAULT NULL,
    `foreigndonation_id` TEXT NULL DEFAULT NULL,
    `reactivated` TINYINT(1) NULL DEFAULT NULL,
    `pagseguro_hash` TEXT NULL DEFAULT NULL,
    `first_payment_realized` TINYINT(1) NULL DEFAULT NULL,
    `pause_period` DOUBLE NULL DEFAULT NULL,
    `beneficiary_id` TEXT NULL DEFAULT NULL,
    `created_at` TEXT NULL DEFAULT NULL,
    `updated_at` TEXT NULL DEFAULT NULL)
  ENGINE = InnoDB
  DEFAULT CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci;
  
  
  /* === Tabela de Pagamentos ==== */
  CREATE TABLE IF NOT EXISTS `payments` (
    `id` BIGINT NULL DEFAULT NULL,
    `constituent_id` BIGINT NULL DEFAULT NULL,
    `donation_id` BIGINT NULL DEFAULT NULL,
    `processing_date` TEXT NULL DEFAULT NULL,
    `payment_hash` TEXT NULL DEFAULT NULL,
    `created_at` TEXT NULL DEFAULT NULL,
    `updated_at` TEXT NULL DEFAULT NULL,
    `value` TEXT NULL DEFAULT NULL,
    `provider_code` TEXT NULL DEFAULT NULL,
    `bank_file_id` DOUBLE NULL DEFAULT NULL,
    `return_code` TEXT NULL DEFAULT NULL,
    `return_message` TEXT NULL DEFAULT NULL,
    `successful` TINYINT(1) NULL DEFAULT NULL,
    `finance_id` DOUBLE NULL DEFAULT NULL,
    `payment_status` TEXT NULL DEFAULT NULL,
    `deposit_date` TEXT NULL DEFAULT NULL,
    `recurrent` BIGINT NULL DEFAULT NULL,
    `payment_date` TEXT NULL DEFAULT NULL,
    `collector_version` BIGINT NULL DEFAULT NULL,
    `external_payment` TINYINT(1) NULL DEFAULT NULL,
    `reversal` TINYINT(1) NULL DEFAULT NULL,
    `reversed` TINYINT(1) NULL DEFAULT NULL,
    `uuid` BIGINT NULL DEFAULT NULL,
    `competence` TEXT NULL DEFAULT NULL,
    `pagseguro_hash` TEXT NULL DEFAULT NULL,
    `cielo_transaction` TEXT NULL DEFAULT NULL,
    `detached_payment_type` TEXT NULL DEFAULT NULL,
    `collection_type` TEXT NULL DEFAULT NULL,
    `type_payment` TEXT NULL DEFAULT NULL,
    `payment_type` TEXT NULL DEFAULT NULL,
    `santander_return` TEXT NULL DEFAULT NULL,
    `trackmob_charged_tax` TEXT NULL DEFAULT NULL,
    `psp_charged_tax` TEXT NULL DEFAULT NULL,
    `received_date` TEXT NULL DEFAULT NULL,
    `psp_postback` DOUBLE NULL DEFAULT NULL,
    `journey_id` DOUBLE NULL DEFAULT NULL,
    `ambassador_tax` TEXT NULL DEFAULT NULL,
    `pagarme_id` TEXT NULL DEFAULT NULL,
    `fichas_payment_uuid` TEXT NULL DEFAULT NULL,
    `cielo_payment_id` TEXT NULL DEFAULT NULL,
    `supermidas_id` TEXT NULL DEFAULT NULL,
    `colab_information` TEXT NULL DEFAULT NULL,
    `group_payment_id` TEXT NULL DEFAULT NULL,
    `group_payment_at` TEXT NULL DEFAULT NULL,
    `original_value` TEXT NULL DEFAULT NULL,
    `braspag_transaction_link` TEXT NULL DEFAULT NULL,
    `braspag_transaction_status` TEXT NULL DEFAULT NULL,
    `braspag_transaction_reason_code` TEXT NULL DEFAULT NULL,
    `braspag_transaction_proof_of_sale` TEXT NULL DEFAULT NULL,
    `braspag_transaction_reason_message` TEXT NULL DEFAULT NULL,
    `braspag_transaction_authorization_code` TEXT NULL DEFAULT NULL,
    `braspag_transaction_provider_return_code` TEXT NULL DEFAULT NULL,
    `braspag_transaction_acquirer_transaction_id` TEXT NULL DEFAULT NULL,
    `braspag_transaction_provider_return_message` TEXT NULL DEFAULT NULL,
    `pagarme_information_pagarme_barcode` TEXT NULL DEFAULT NULL,
    `pagarme_information_sent_to_pagarme` TEXT NULL DEFAULT NULL,
    `pagarme_information_pagarme_payment_slip_url` TEXT NULL DEFAULT NULL,
    `midas_information_midas_uuid` TEXT NULL DEFAULT NULL,
    `pagarme_information_scheduled_to_pagarme` TEXT NULL DEFAULT NULL,
    `midas_information_midas_payment_barcode` TEXT NULL DEFAULT NULL,
    `midas_information_midas_payment_slip_url` TEXT NULL DEFAULT NULL,
    `midas_information` DOUBLE NULL DEFAULT NULL,
    `pagarme_information` DOUBLE NULL DEFAULT NULL,
    `psp_postback_id` TEXT NULL DEFAULT NULL,
    `psp_postback_fingerprint` TEXT NULL DEFAULT NULL,
    `psp_postback_event` TEXT NULL DEFAULT NULL,
    `psp_postback_old_status` TEXT NULL DEFAULT NULL,
    `psp_postback_desired_status` TEXT NULL DEFAULT NULL,
    `psp_postback_current_status` TEXT NULL DEFAULT NULL,
    `psp_postback_object` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_object` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_status` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_refuse_reason` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_status_reason` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_acquirer_response_code` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_acquirer_name` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_acquirer_id` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_authorization_code` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_soft_descriptor` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_tid` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_nsu` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_date_created` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_date_updated` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_amount` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_authorized_amount` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_paid_amount` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_refunded_amount` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_installments` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_id` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_cost` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_card_holder_name` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_card_last_digits` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_card_first_digits` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_card_brand` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_card_pin_mode` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_card_magstripe_fallback` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_cvm_pin` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_postback_url` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_payment_method` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_capture_method` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_antifraud_score` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_boleto_url` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_boleto_barcode` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_boleto_expiration_date` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_referer` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_ip` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_subscription_id` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_phone` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_address_object` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_address_street` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_address_complementary` BLOB NULL DEFAULT NULL,
    `psp_postback_transaction_address_street_number` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_address_neighborhood` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_address_city` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_address_state` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_address_zipcode` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_address_country` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_address_id` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_customer_object` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_customer_id` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_customer_external_id` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_customer_type` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_customer_country` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_customer_document_number` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_customer_document_type` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_customer_name` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_customer_email` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_customer_phone_numbers` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_customer_born_at` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_customer_birthday` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_customer_gender` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_customer_date_created` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_billing` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_shipping` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_card_object` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_card_id` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_card_date_created` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_card_date_updated` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_card_country` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_card_fingerprint` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_card_valid` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_card_expiration_date` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_split_rules_0_object` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_split_rules_0_id` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_split_rules_0_liable` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_split_rules_0_amount` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_split_rules_0_percentage` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_split_rules_0_recipient_id` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_split_rules_0_charge_remainder` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_split_rules_0_charge_processing_fee` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_split_rules_0_block_id` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_split_rules_0_date_created` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_split_rules_0_date_updated` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_split_rules_1_object` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_split_rules_1_id` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_split_rules_1_liable` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_split_rules_1_amount` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_split_rules_1_percentage` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_split_rules_1_recipient_id` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_split_rules_1_charge_remainder` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_split_rules_1_charge_processing_fee` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_split_rules_1_block_id` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_split_rules_1_date_created` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_split_rules_1_date_updated` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_metadata_id` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_reference_key` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_device` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_local_transaction_id` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_local_time` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_fraud_covered` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_fraud_reimbursed` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_order_id` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_risk_level` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_receipt_url` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_payment` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_addition` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_discount` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_private_label` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_pix_qr_code` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_pix_expiration_date` TEXT NULL DEFAULT NULL,
    `psp_postback_format` TEXT NULL DEFAULT NULL,
    `psp_postback_controller` TEXT NULL DEFAULT NULL,
    `psp_postback_action` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_address` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_customer_phone_numbers_0` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_customer_phone_numbers_1` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_card` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_customer_phone_numbers_2` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_customer_phone_numbers_3` TEXT NULL DEFAULT NULL,
    `psp_postback_transaction_customer` BLOB NULL DEFAULT NULL,
    `pagarme_information_pagarme_id` BLOB NULL DEFAULT NULL,
    `pagarme_information_pagarme_pix_qrcode` VARCHAR(255) NULL DEFAULT '0',
    `pagarme_information_pagarme_pix_expiration_date` VARCHAR(255) NULL DEFAULT NULL,
    `psp_postback_transaction_customer_phone_numbers_4` VARCHAR(255) NULL DEFAULT NULL,
    `psp_postback_transaction_pix_data` VARCHAR(50) NULL DEFAULT NULL)
  ENGINE = InnoDB
  DEFAULT CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci;