SchemaSpy Analysis of stoq_schema.public - Constraints Generated by
SchemaSpy
389 Foreign Key Constraints:
SourceForge.net

Constraint Name Child Column Parent Column Delete Rule
account_parent_id_fkey account.parent_id account.id Restrict delete 
account_station_id_fkey account.station_id branch_station.id Restrict delete 
account_te_id_fkey account.te_id transaction_entry.id Restrict delete 
account_transaction_account_id_fkey account_transaction.account_id account.id Restrict delete 
account_transaction_payment_id_fkey account_transaction.payment_id payment.id Restrict delete 
account_transaction_source_account_id_fkey account_transaction.source_account_id account.id Restrict delete 
account_transaction_te_id_fkey account_transaction.te_id transaction_entry.id Restrict delete 
address_city_location_id_fkey address.city_location_id city_location.id Restrict delete 
address_person_id_fkey address.person_id person.id Restrict delete 
address_te_id_fkey address.te_id transaction_entry.id Restrict delete 
attachment_te_id_fkey attachment.te_id transaction_entry.id Restrict delete 
bank_account_account_id_fkey bank_account.account_id account.id Restrict delete 
bank_account_te_id_fkey bank_account.te_id transaction_entry.id Restrict delete 
bill_option_bank_account_id_fkey bill_option.bank_account_id bank_account.id Restrict delete 
bill_option_te_id_fkey bill_option.te_id transaction_entry.id Restrict delete 
branch_manager_id_fkey branch.manager_id employee.id Restrict delete 
branch_person_id_fkey branch.person_id person.id Restrict delete 
branch_station_branch_id_fkey branch_station.branch_id branch.id Restrict delete 
branch_station_te_id_fkey branch_station.te_id transaction_entry.id Restrict delete 
branch_synchronization_branch_id_fkey branch_synchronization.branch_id branch.id Restrict delete 
branch_te_id_fkey branch.te_id transaction_entry.id Restrict delete 
calls_attendant_id_fkey calls.attendant_id login_user.id Restrict delete 
calls_person_id_fkey calls.person_id person.id Restrict delete 
calls_te_id_fkey calls.te_id transaction_entry.id Restrict delete 
card_operation_cost_device_id_fkey card_operation_cost.device_id card_payment_device.id Restrict delete 
card_operation_cost_provider_id_fkey card_operation_cost.provider_id credit_provider.id Restrict delete 
card_operation_cost_te_id_fkey card_operation_cost.te_id transaction_entry.id Restrict delete 
card_payment_device_te_id_fkey card_payment_device.te_id transaction_entry.id Restrict delete 
cfop_data_te_id_fkey cfop_data.te_id transaction_entry.id Restrict delete 
check_data_bank_account_id_fkey check_data.bank_account_id bank_account.id Restrict delete 
check_data_payment_id_fkey check_data.payment_id payment.id Restrict delete 
check_data_te_id_fkey check_data.te_id transaction_entry.id Restrict delete 
client_category_id_fkey client.category_id client_category.id Restrict delete 
client_category_price_category_id_fkey client_category_price.category_id client_category.id Restrict delete 
client_category_price_sellable_id_fkey client_category_price.sellable_id sellable.id Restrict delete 
client_category_price_te_id_fkey client_category_price.te_id transaction_entry.id Restrict delete 
client_category_te_id_fkey client_category.te_id transaction_entry.id Restrict delete 
client_person_id_fkey client.person_id person.id Restrict delete 
client_salary_history_client_id_fkey client_salary_history.client_id client.id Restrict delete 
client_salary_history_te_id_fkey client_salary_history.te_id transaction_entry.id Restrict delete 
client_salary_history_user_id_fkey client_salary_history.user_id login_user.id Restrict delete 
client_te_id_fkey client.te_id transaction_entry.id Restrict delete 
commission_payment_id_fkey commission.payment_id payment.id Restrict delete 
commission_sale_id_fkey commission.sale_id sale.id Restrict delete 
commission_source_category_id_fkey commission_source.category_id sellable_category.id Restrict delete 
commission_source_sellable_id_fkey commission_source.sellable_id sellable.id Restrict delete 
commission_source_te_id_fkey commission_source.te_id transaction_entry.id Restrict delete 
commission_te_id_fkey commission.te_id transaction_entry.id Restrict delete 
company_person_id_fkey company.person_id person.id Restrict delete 
company_te_id_fkey company.te_id transaction_entry.id Restrict delete 
contact_info_person_id_fkey contact_info.person_id person.id Restrict delete 
contact_info_te_id_fkey contact_info.te_id transaction_entry.id Restrict delete 
cost_center_entry_cost_center_id_fkey cost_center_entry.cost_center_id cost_center.id Restrict delete 
cost_center_entry_payment_id_fkey cost_center_entry.payment_id payment.id Restrict delete 
cost_center_entry_stock_transaction_id_fkey cost_center_entry.stock_transaction_id stock_transaction_history.id Restrict delete 
cost_center_entry_te_id_fkey cost_center_entry.te_id transaction_entry.id Restrict delete 
cost_center_te_id_fkey cost_center.te_id transaction_entry.id Restrict delete 
credit_card_data_device_id_fkey credit_card_data.device_id card_payment_device.id Restrict delete 
credit_card_data_payment_id_fkey credit_card_data.payment_id payment.id Restrict delete 
credit_card_data_provider_id_fkey credit_card_data.provider_id credit_provider.id Restrict delete 
credit_card_data_te_id_fkey credit_card_data.te_id transaction_entry.id Restrict delete 
credit_check_history_client_id_fkey credit_check_history.client_id client.id Restrict delete 
credit_check_history_te_id_fkey credit_check_history.te_id transaction_entry.id Restrict delete 
credit_check_history_user_id_fkey credit_check_history.user_id login_user.id Restrict delete 
credit_provider_default_device_id_fkey credit_provider.default_device_id card_payment_device.id Restrict delete 
credit_provider_te_id_fkey credit_provider.te_id transaction_entry.id Restrict delete 
delivery_address_id_fkey delivery.address_id address.id Restrict delete 
delivery_service_item_id_fkey delivery.service_item_id sale_item.id Restrict delete 
delivery_te_id_fkey delivery.te_id transaction_entry.id Restrict delete 
delivery_transporter_id_fkey delivery.transporter_id transporter.id Restrict delete 
device_constant_device_settings_id_fkey device_constant.device_settings_id device_settings.id Restrict delete 
device_constant_te_id_fkey device_constant.te_id transaction_entry.id Restrict delete 
device_settings_station_id_fkey device_settings.station_id branch_station.id Restrict delete 
device_settings_te_id_fkey device_settings.te_id transaction_entry.id Restrict delete 
employee_bank_account_id_fkey employee.bank_account_id bank_account.id Restrict delete 
employee_branch_id_fkey employee.branch_id branch.id Restrict delete 
employee_military_data_id_fkey employee.military_data_id military_data.id Restrict delete 
employee_person_id_fkey employee.person_id person.id Restrict delete 
employee_role_history_employee_id_fkey employee_role_history.employee_id employee.id Restrict delete 
employee_role_history_role_id_fkey employee_role_history.role_id employee_role.id Restrict delete 
employee_role_history_te_id_fkey employee_role_history.te_id transaction_entry.id Restrict delete 
employee_role_id_fkey employee.role_id employee_role.id Restrict delete 
employee_role_te_id_fkey employee_role.te_id transaction_entry.id Restrict delete 
employee_te_id_fkey employee.te_id transaction_entry.id Restrict delete 
employee_voter_data_id_fkey employee.voter_data_id voter_data.id Restrict delete 
employee_workpermit_data_id_fkey employee.workpermit_data_id work_permit_data.id Restrict delete 
fiscal_book_entry_branch_id_fkey fiscal_book_entry.branch_id branch.id Restrict delete 
fiscal_book_entry_cfop_id_fkey fiscal_book_entry.cfop_id cfop_data.id Restrict delete 
fiscal_book_entry_drawee_id_fkey fiscal_book_entry.drawee_id person.id Restrict delete 
fiscal_book_entry_payment_group_id_fkey fiscal_book_entry.payment_group_id payment_group.id Restrict delete 
fiscal_book_entry_te_id_fkey fiscal_book_entry.te_id transaction_entry.id Restrict delete 
fiscal_day_history_station_id_fkey fiscal_day_history.station_id branch_station.id Restrict delete 
fiscal_day_history_te_id_fkey fiscal_day_history.te_id transaction_entry.id Restrict delete 
fiscal_day_tax_fiscal_day_history_id_fkey fiscal_day_tax.fiscal_day_history_id fiscal_day_history.id Restrict delete 
fiscal_day_tax_te_id_fkey fiscal_day_tax.te_id transaction_entry.id Restrict delete 
fiscal_sale_history_sale_id_fkey fiscal_sale_history.sale_id sale.id Restrict delete 
fiscal_sale_history_te_id_fkey fiscal_sale_history.te_id transaction_entry.id Restrict delete 
grid_attribute_group_id_fkey grid_attribute.group_id grid_group.id Restrict delete 
grid_attribute_te_id_fkey grid_attribute.te_id transaction_entry.id Restrict delete 
grid_group_te_id_fkey grid_group.te_id transaction_entry.id Restrict delete 
grid_option_attribute_id_fkey grid_option.attribute_id grid_attribute.id Restrict delete 
grid_option_te_id_fkey grid_option.te_id transaction_entry.id Restrict delete 
image_te_id_fkey image.te_id transaction_entry.id Restrict delete 
individual_birth_location_id_fkey individual.birth_location_id city_location.id Restrict delete 
individual_person_id_fkey individual.person_id person.id Restrict delete 
individual_te_id_fkey individual.te_id transaction_entry.id Restrict delete 
installed_plugin_te_id_fkey installed_plugin.te_id transaction_entry.id Restrict delete 
inventory_branch_id_fkey inventory.branch_id branch.id Restrict delete 
inventory_item_batch_id_fkey inventory_item.batch_id storable_batch.id Restrict delete 
inventory_item_cfop_data_id_fkey inventory_item.cfop_data_id cfop_data.id Restrict delete 
inventory_item_inventory_id_fkey inventory_item.inventory_id inventory.id Restrict delete 
inventory_item_product_id_fkey inventory_item.product_id product.id Restrict delete 
inventory_item_te_id_fkey inventory_item.te_id transaction_entry.id Restrict delete 
inventory_responsible_id_fkey inventory.responsible_id login_user.id Restrict delete 
inventory_te_id_fkey inventory.te_id transaction_entry.id Restrict delete 
invoice_branch_id_fkey invoice.branch_id branch.id Restrict delete 
invoice_field_layout_id_fkey invoice_field.layout_id invoice_layout.id Restrict delete 
invoice_field_te_id_fkey invoice_field.te_id transaction_entry.id Restrict delete 
invoice_item_icms_te_id_fkey invoice_item_icms.te_id transaction_entry.id Restrict delete 
invoice_item_ipi_te_id_fkey invoice_item_ipi.te_id transaction_entry.id Restrict delete 
invoice_layout_te_id_fkey invoice_layout.te_id transaction_entry.id Restrict delete 
invoice_printer_layout_id_fkey invoice_printer.layout_id invoice_layout.id Restrict delete 
invoice_printer_station_id_fkey invoice_printer.station_id branch_station.id Restrict delete 
invoice_printer_te_id_fkey invoice_printer.te_id transaction_entry.id Restrict delete 
invoice_te_id_fkey invoice.te_id transaction_entry.id Restrict delete 
loan_branch_id_fkey loan.branch_id branch.id Restrict delete 
loan_client_category_id_fkey loan.client_category_id client_category.id Restrict delete 
loan_client_id_fkey loan.client_id client.id Restrict delete 
loan_invoice_id_fkey loan.invoice_id invoice.id Restrict delete 
loan_item_batch_id_fkey loan_item.batch_id storable_batch.id Restrict delete 
loan_item_icms_info_id_fkey loan_item.icms_info_id invoice_item_icms.id Restrict delete 
loan_item_ipi_info_id_fkey loan_item.ipi_info_id invoice_item_ipi.id Restrict delete 
loan_item_loan_id_fkey loan_item.loan_id loan.id Restrict delete 
loan_item_sellable_id_fkey loan_item.sellable_id sellable.id Restrict delete 
loan_item_te_id_fkey loan_item.te_id transaction_entry.id Restrict delete 
loan_responsible_id_fkey loan.responsible_id login_user.id Restrict delete 
loan_te_id_fkey loan.te_id transaction_entry.id Restrict delete 
login_user_person_id_fkey login_user.person_id person.id Restrict delete 
login_user_profile_id_fkey login_user.profile_id user_profile.id Restrict delete 
login_user_te_id_fkey login_user.te_id transaction_entry.id Restrict delete 
military_data_te_id_fkey military_data.te_id transaction_entry.id Restrict delete 
parameter_data_te_id_fkey parameter_data.te_id transaction_entry.id Restrict delete 
payment_attachment_id_fkey payment.attachment_id attachment.id Restrict delete 
payment_branch_id_fkey payment.branch_id branch.id Restrict delete 
payment_category_id_fkey payment.category_id payment_category.id Restrict delete 
payment_category_te_id_fkey payment_category.te_id transaction_entry.id Restrict delete 
payment_change_history_payment_id_fkey payment_change_history.payment_id payment.id Restrict delete 
payment_change_history_te_id_fkey payment_change_history.te_id transaction_entry.id Restrict delete 
payment_comment_author_id_fkey payment_comment.author_id login_user.id Restrict delete 
payment_comment_payment_id_fkey payment_comment.payment_id payment.id Restrict delete 
payment_comment_te_id_fkey payment_comment.te_id transaction_entry.id Restrict delete 
payment_flow_history_te_id_fkey payment_flow_history.te_id transaction_entry.id Restrict delete 
payment_group_id_fkey payment.group_id payment_group.id Restrict delete 
payment_group_payer_id_fkey payment_group.payer_id person.id Restrict delete 
payment_group_recipient_id_fkey payment_group.recipient_id person.id Restrict delete 
payment_group_renegotiation_id_fkey payment_group.renegotiation_id payment_renegotiation.id Restrict delete 
payment_group_te_id_fkey payment_group.te_id transaction_entry.id Restrict delete 
payment_method_destination_account_id_fkey payment_method.destination_account_id account.id Restrict delete 
payment_method_id_fkey payment.method_id payment_method.id Restrict delete 
payment_method_te_id_fkey payment_method.te_id transaction_entry.id Restrict delete 
payment_renegotiation_branch_id_fkey payment_renegotiation.branch_id branch.id Restrict delete 
payment_renegotiation_client_id_fkey payment_renegotiation.client_id client.id Restrict delete 
payment_renegotiation_group_id_fkey payment_renegotiation.group_id payment_group.id Restrict delete 
payment_renegotiation_responsible_id_fkey payment_renegotiation.responsible_id login_user.id Restrict delete 
payment_renegotiation_te_id_fkey payment_renegotiation.te_id transaction_entry.id Restrict delete 
payment_te_id_fkey payment.te_id transaction_entry.id Restrict delete 
person_merged_with_id_fkey person.merged_with_id person.id Restrict delete 
person_te_id_fkey person.te_id transaction_entry.id Restrict delete 
plugin_egg_te_id_fkey plugin_egg.te_id transaction_entry.id Restrict delete 
product_attribute_attribute_id_fkey product_attribute.attribute_id grid_attribute.id Restrict delete 
product_attribute_product_id_fkey product_attribute.product_id product.id Restrict delete 
product_attribute_te_id_fkey product_attribute.te_id transaction_entry.id Restrict delete 
product_component_component_id_fkey product_component.component_id product.id Restrict delete 
product_component_product_id_fkey product_component.product_id product.id Restrict delete 
product_component_te_id_fkey product_component.te_id transaction_entry.id Restrict delete 
product_history_branch_id_fkey product_history.branch_id branch.id Restrict delete 
product_history_sellable_id_fkey product_history.sellable_id sellable.id Restrict delete 
product_history_te_id_fkey product_history.te_id transaction_entry.id Restrict delete 
product_icms_template_id_fkey product.icms_template_id product_icms_template.id Restrict delete 
product_icms_template_product_tax_template_id_fkey product_icms_template.product_tax_template_id product_tax_template.id Restrict delete 
product_icms_template_te_id_fkey product_icms_template.te_id transaction_entry.id Restrict delete 
product_ipi_template_id_fkey product.ipi_template_id product_ipi_template.id Restrict delete 
product_ipi_template_product_tax_template_id_fkey product_ipi_template.product_tax_template_id product_tax_template.id Restrict delete 
product_ipi_template_te_id_fkey product_ipi_template.te_id transaction_entry.id Restrict delete 
product_manufacturer_id_fkey product.manufacturer_id product_manufacturer.id Restrict delete 
product_manufacturer_te_id_fkey product_manufacturer.te_id transaction_entry.id Restrict delete 
product_option_map_attribute_id_fkey product_option_map.attribute_id grid_attribute.id Restrict delete 
product_option_map_option_id_fkey product_option_map.option_id grid_option.id Restrict delete 
product_option_map_product_id_fkey product_option_map.product_id product.id Restrict delete 
product_option_map_te_id_fkey product_option_map.te_id transaction_entry.id Restrict delete 
product_parent_id_fkey product.parent_id product.id Restrict delete 
product_quality_test_product_id_fkey product_quality_test.product_id product.id Restrict delete 
product_quality_test_te_id_fkey product_quality_test.te_id transaction_entry.id Restrict delete 
product_sellable_id_fkey product.sellable_id sellable.id Restrict delete 
product_stock_item_batch_id_fkey product_stock_item.batch_id storable_batch.id Restrict delete 
product_stock_item_branch_id_fkey product_stock_item.branch_id branch.id Restrict delete 
product_stock_item_storable_id_fkey product_stock_item.storable_id storable.id Restrict delete 
product_stock_item_te_id_fkey product_stock_item.te_id transaction_entry.id Restrict delete 
product_supplier_info_product_id_fkey product_supplier_info.product_id product.id Restrict delete 
product_supplier_info_supplier_id_fkey product_supplier_info.supplier_id supplier.id Restrict delete 
product_supplier_info_te_id_fkey product_supplier_info.te_id transaction_entry.id Restrict delete 
product_tax_template_te_id_fkey product_tax_template.te_id transaction_entry.id Restrict delete 
product_te_id_fkey product.te_id transaction_entry.id Restrict delete 
production_item_order_id_fkey production_item.order_id production_order.id Restrict delete 
production_item_product_id_fkey production_item.product_id product.id Restrict delete 
production_item_quality_result_produced_item_id_fkey production_item_quality_result.produced_item_id production_produced_item.id Restrict delete 
production_item_quality_result_quality_test_id_fkey production_item_quality_result.quality_test_id product_quality_test.id Restrict delete 
production_item_quality_result_te_id_fkey production_item_quality_result.te_id transaction_entry.id Restrict delete 
production_item_quality_result_tested_by_id_fkey production_item_quality_result.tested_by_id login_user.id Restrict delete 
production_item_te_id_fkey production_item.te_id transaction_entry.id Restrict delete 
production_material_order_id_fkey production_material.order_id production_order.id Restrict delete 
production_material_product_id_fkey production_material.product_id product.id Restrict delete 
production_material_te_id_fkey production_material.te_id transaction_entry.id Restrict delete 
production_order_branch_id_fkey production_order.branch_id branch.id Restrict delete 
production_order_responsible_id_fkey production_order.responsible_id employee.id Restrict delete 
production_order_te_id_fkey production_order.te_id transaction_entry.id Restrict delete 
production_produced_item_order_id_fkey production_produced_item.order_id production_order.id Restrict delete 
production_produced_item_produced_by_id_fkey production_produced_item.produced_by_id login_user.id Restrict delete 
production_produced_item_product_id_fkey production_produced_item.product_id product.id Restrict delete 
production_produced_item_te_id_fkey production_produced_item.te_id transaction_entry.id Restrict delete 
production_service_order_id_fkey production_service.order_id production_order.id Restrict delete 
production_service_service_id_fkey production_service.service_id service.id Restrict delete 
production_service_te_id_fkey production_service.te_id transaction_entry.id Restrict delete 
profile_settings_te_id_fkey profile_settings.te_id transaction_entry.id Restrict delete 
profile_settings_user_profile_id_fkey profile_settings.user_profile_id user_profile.id Restrict delete 
purchase_item_order_id_fkey purchase_item.order_id purchase_order.id Restrict delete 
purchase_item_sellable_id_fkey purchase_item.sellable_id sellable.id Restrict delete 
purchase_item_te_id_fkey purchase_item.te_id transaction_entry.id Restrict delete 
purchase_order_branch_id_fkey purchase_order.branch_id branch.id Restrict delete 
purchase_order_group_id_fkey purchase_order.group_id payment_group.id Restrict delete 
purchase_order_responsible_id_fkey purchase_order.responsible_id login_user.id Restrict delete 
purchase_order_supplier_id_fkey purchase_order.supplier_id supplier.id Restrict delete 
purchase_order_te_id_fkey purchase_order.te_id transaction_entry.id Restrict delete 
purchase_order_transporter_id_fkey purchase_order.transporter_id transporter.id Restrict delete 
purchase_receiving_map_purchase_id_fkey purchase_receiving_map.purchase_id purchase_order.id Restrict delete 
purchase_receiving_map_receiving_id_fkey purchase_receiving_map.receiving_id receiving_order.id Restrict delete 
purchase_receiving_map_te_id_fkey purchase_receiving_map.te_id transaction_entry.id Restrict delete 
quotation_branch_id_fkey quotation.branch_id branch.id Restrict delete 
quotation_group_id_fkey quotation.group_id quote_group.id Restrict delete 
quotation_purchase_id_fkey quotation.purchase_id purchase_order.id Restrict delete 
quotation_te_id_fkey quotation.te_id transaction_entry.id Restrict delete 
quote_group_branch_id_fkey quote_group.branch_id branch.id Restrict delete 
quote_group_te_id_fkey quote_group.te_id transaction_entry.id Restrict delete 
receiving_order_branch_id_fkey receiving_order.branch_id branch.id Restrict delete 
receiving_order_cfop_id_fkey receiving_order.cfop_id cfop_data.id Restrict delete 
receiving_order_item_batch_id_fkey receiving_order_item.batch_id storable_batch.id Restrict delete 
receiving_order_item_purchase_item_id_fkey receiving_order_item.purchase_item_id purchase_item.id Restrict delete 
receiving_order_item_receiving_order_id_fkey receiving_order_item.receiving_order_id receiving_order.id Restrict delete 
receiving_order_item_sellable_id_fkey receiving_order_item.sellable_id sellable.id Restrict delete 
receiving_order_item_te_id_fkey receiving_order_item.te_id transaction_entry.id Restrict delete 
receiving_order_responsible_id_fkey receiving_order.responsible_id login_user.id Restrict delete 
receiving_order_supplier_id_fkey receiving_order.supplier_id supplier.id Restrict delete 
receiving_order_te_id_fkey receiving_order.te_id transaction_entry.id Restrict delete 
receiving_order_transporter_id_fkey receiving_order.transporter_id transporter.id Restrict delete 
returned_sale_branch_id_fkey returned_sale.branch_id branch.id Restrict delete 
returned_sale_confirm_responsible_id_fkey returned_sale.confirm_responsible_id login_user.id Restrict delete 
returned_sale_invoice_id_fkey returned_sale.invoice_id invoice.id Restrict delete 
returned_sale_item_batch_id_fkey returned_sale_item.batch_id storable_batch.id Restrict delete 
returned_sale_item_icms_info_id_fkey returned_sale_item.icms_info_id invoice_item_icms.id Restrict delete 
returned_sale_item_ipi_info_id_fkey returned_sale_item.ipi_info_id invoice_item_ipi.id Restrict delete 
returned_sale_item_returned_sale_id_fkey returned_sale_item.returned_sale_id returned_sale.id Restrict delete 
returned_sale_item_sale_item_id_fkey returned_sale_item.sale_item_id sale_item.id Restrict delete 
returned_sale_item_sellable_id_fkey returned_sale_item.sellable_id sellable.id Restrict delete 
returned_sale_item_te_id_fkey returned_sale_item.te_id transaction_entry.id Restrict delete 
returned_sale_new_sale_id_fkey returned_sale.new_sale_id sale.id Restrict delete 
returned_sale_responsible_id_fkey returned_sale.responsible_id login_user.id Restrict delete 
returned_sale_sale_id_fkey returned_sale.sale_id sale.id Restrict delete 
returned_sale_te_id_fkey returned_sale.te_id transaction_entry.id Restrict delete 
returned_sale_undo_responsible_id_fkey returned_sale.undo_responsible_id login_user.id Restrict delete 
sale_branch_id_fkey sale.branch_id branch.id Restrict delete 
sale_cfop_id_fkey sale.cfop_id cfop_data.id Restrict delete 
sale_client_category_id_fkey sale.client_category_id client_category.id Restrict delete 
sale_client_id_fkey sale.client_id client.id Restrict delete 
sale_comment_author_id_fkey sale_comment.author_id login_user.id Restrict delete 
sale_comment_sale_id_fkey sale_comment.sale_id sale.id Restrict delete 
sale_comment_te_id_fkey sale_comment.te_id transaction_entry.id Restrict delete 
sale_cost_center_id_fkey sale.cost_center_id cost_center.id Restrict delete 
sale_group_id_fkey sale.group_id payment_group.id Restrict delete 
sale_invoice_id_fkey sale.invoice_id invoice.id Restrict delete 
sale_item_batch_id_fkey sale_item.batch_id storable_batch.id Restrict delete 
sale_item_cfop_id_fkey sale_item.cfop_id cfop_data.id Restrict delete 
sale_item_delivery_id_fkey sale_item.delivery_id delivery.id Restrict delete 
sale_item_icms_info_id_fkey sale_item.icms_info_id invoice_item_icms.id Restrict delete 
sale_item_ipi_info_id_fkey sale_item.ipi_info_id invoice_item_ipi.id Restrict delete 
sale_item_sale_id_fkey sale_item.sale_id sale.id Restrict delete 
sale_item_sellable_id_fkey sale_item.sellable_id sellable.id Restrict delete 
sale_item_te_id_fkey sale_item.te_id transaction_entry.id Restrict delete 
sale_sale_token_id_fkey sale.sale_token_id sale_token.id Restrict delete 
sale_salesperson_id_fkey sale.salesperson_id sales_person.id Restrict delete 
sale_te_id_fkey sale.te_id transaction_entry.id Restrict delete 
sale_token_te_id_fkey sale_token.te_id transaction_entry.id Restrict delete 
sale_transporter_id_fkey sale.transporter_id transporter.id Restrict delete 
sales_person_person_id_fkey sales_person.person_id person.id Restrict delete 
sales_person_te_id_fkey sales_person.te_id transaction_entry.id Restrict delete 
sellable_category_category_id_fkey sellable_category.category_id sellable_category.id Restrict delete 
sellable_category_id_fkey sellable.category_id sellable_category.id Restrict delete 
sellable_category_tax_constant_id_fkey sellable_category.tax_constant_id sellable_tax_constant.id Restrict delete 
sellable_category_te_id_fkey sellable_category.te_id transaction_entry.id Restrict delete 
sellable_default_sale_cfop_id_fkey sellable.default_sale_cfop_id cfop_data.id Restrict delete 
sellable_image_id_fkey sellable.image_id image.id Restrict delete 
sellable_tax_constant_id_fkey sellable.tax_constant_id sellable_tax_constant.id Restrict delete 
sellable_tax_constant_te_id_fkey sellable_tax_constant.te_id transaction_entry.id Restrict delete 
sellable_te_id_fkey sellable.te_id transaction_entry.id Restrict delete 
sellable_unit_id_fkey sellable.unit_id sellable_unit.id Restrict delete 
sellable_unit_te_id_fkey sellable_unit.te_id transaction_entry.id Restrict delete 
service_sellable_id_fkey service.sellable_id sellable.id Restrict delete 
service_te_id_fkey service.te_id transaction_entry.id Restrict delete 
stock_decrease_branch_id_fkey stock_decrease.branch_id branch.id Restrict delete 
stock_decrease_cfop_id_fkey stock_decrease.cfop_id cfop_data.id Restrict delete 
stock_decrease_cost_center_id_fkey stock_decrease.cost_center_id cost_center.id Restrict delete 
stock_decrease_group_id_fkey stock_decrease.group_id payment_group.id Restrict delete 
stock_decrease_invoice_id_fkey stock_decrease.invoice_id invoice.id Restrict delete 
stock_decrease_item_batch_id_fkey stock_decrease_item.batch_id storable_batch.id Restrict delete 
stock_decrease_item_icms_info_id_fkey stock_decrease_item.icms_info_id invoice_item_icms.id Restrict delete 
stock_decrease_item_ipi_info_id_fkey stock_decrease_item.ipi_info_id invoice_item_ipi.id Restrict delete 
stock_decrease_item_sellable_id_fkey stock_decrease_item.sellable_id sellable.id Restrict delete 
stock_decrease_item_stock_decrease_id_fkey stock_decrease_item.stock_decrease_id stock_decrease.id Restrict delete 
stock_decrease_item_te_id_fkey stock_decrease_item.te_id transaction_entry.id Restrict delete 
stock_decrease_person_id_fkey stock_decrease.person_id person.id Restrict delete 
stock_decrease_removed_by_id_fkey stock_decrease.removed_by_id employee.id Restrict delete 
stock_decrease_responsible_id_fkey stock_decrease.responsible_id login_user.id Restrict delete 
stock_decrease_te_id_fkey stock_decrease.te_id transaction_entry.id Restrict delete 
stock_transaction_history_product_stock_item_id_fkey stock_transaction_history.product_stock_item_id product_stock_item.id Restrict delete 
stock_transaction_history_responsible_id_fkey stock_transaction_history.responsible_id login_user.id Restrict delete 
stock_transaction_history_te_id_fkey stock_transaction_history.te_id transaction_entry.id Restrict delete 
storable_batch_storable_id_fkey storable_batch.storable_id storable.id Restrict delete 
storable_batch_te_id_fkey storable_batch.te_id transaction_entry.id Restrict delete 
storable_product_id_fkey storable.product_id product.id Restrict delete 
storable_te_id_fkey storable.te_id transaction_entry.id Restrict delete 
supplier_person_id_fkey supplier.person_id person.id Restrict delete 
supplier_te_id_fkey supplier.te_id transaction_entry.id Restrict delete 
till_entry_branch_id_fkey till_entry.branch_id branch.id Restrict delete 
till_entry_payment_id_fkey till_entry.payment_id payment.id Restrict delete 
till_entry_te_id_fkey till_entry.te_id transaction_entry.id Restrict delete 
till_entry_till_id_fkey till_entry.till_id till.id Restrict delete 
till_responsible_close_id_fkey till.responsible_close_id login_user.id Restrict delete 
till_responsible_open_id_fkey till.responsible_open_id login_user.id Restrict delete 
till_station_id_fkey till.station_id branch_station.id Restrict delete 
till_te_id_fkey till.te_id transaction_entry.id Restrict delete 
transfer_order_destination_branch_id_fkey transfer_order.destination_branch_id branch.id Restrict delete 
transfer_order_destination_responsible_id_fkey transfer_order.destination_responsible_id employee.id Restrict delete 
transfer_order_invoice_id_fkey transfer_order.invoice_id invoice.id Restrict delete 
transfer_order_item_batch_id_fkey transfer_order_item.batch_id storable_batch.id Restrict delete 
transfer_order_item_icms_info_id_fkey transfer_order_item.icms_info_id invoice_item_icms.id Restrict delete 
transfer_order_item_ipi_info_id_fkey transfer_order_item.ipi_info_id invoice_item_ipi.id Restrict delete 
transfer_order_item_sellable_id_fkey transfer_order_item.sellable_id sellable.id Restrict delete 
transfer_order_item_te_id_fkey transfer_order_item.te_id transaction_entry.id Restrict delete 
transfer_order_item_transfer_order_id_fkey transfer_order_item.transfer_order_id transfer_order.id Restrict delete 
transfer_order_source_branch_id_fkey transfer_order.source_branch_id branch.id Restrict delete 
transfer_order_source_responsible_id_fkey transfer_order.source_responsible_id employee.id Restrict delete 
transfer_order_te_id_fkey transfer_order.te_id transaction_entry.id Restrict delete 
transporter_person_id_fkey transporter.person_id person.id Restrict delete 
transporter_te_id_fkey transporter.te_id transaction_entry.id Restrict delete 
ui_field_te_id_fkey ui_field.te_id transaction_entry.id Restrict delete 
ui_field_ui_form_id_fkey ui_field.ui_form_id ui_form.id Restrict delete 
ui_form_te_id_fkey ui_form.te_id transaction_entry.id Restrict delete 
user_branch_access_branch_id_fkey user_branch_access.branch_id branch.id Restrict delete 
user_branch_access_te_id_fkey user_branch_access.te_id transaction_entry.id Restrict delete 
user_branch_access_user_id_fkey user_branch_access.user_id login_user.id Restrict delete 
user_profile_te_id_fkey user_profile.te_id transaction_entry.id Restrict delete 
voter_data_te_id_fkey voter_data.te_id transaction_entry.id Restrict delete 
work_order_branch_id_fkey work_order.branch_id branch.id Restrict delete 
work_order_category_id_fkey work_order.category_id work_order_category.id Restrict delete 
work_order_category_te_id_fkey work_order_category.te_id transaction_entry.id Restrict delete 
work_order_client_id_fkey work_order.client_id client.id Restrict delete 
work_order_current_branch_id_fkey work_order.current_branch_id branch.id Restrict delete 
work_order_execution_branch_id_fkey work_order.execution_branch_id branch.id Restrict delete 
work_order_execution_responsible_id_fkey work_order.execution_responsible_id employee.id Restrict delete 
work_order_history_te_id_fkey work_order_history.te_id transaction_entry.id Restrict delete 
work_order_history_user_id_fkey work_order_history.user_id login_user.id Restrict delete 
work_order_history_work_order_id_fkey work_order_history.work_order_id work_order.id Restrict delete 
work_order_item_batch_id_fkey work_order_item.batch_id storable_batch.id Restrict delete 
work_order_item_order_id_fkey work_order_item.order_id work_order.id Restrict delete 
work_order_item_sale_item_id_fkey work_order_item.sale_item_id sale_item.id Restrict delete 
work_order_item_sellable_id_fkey work_order_item.sellable_id sellable.id Restrict delete 
work_order_item_te_id_fkey work_order_item.te_id transaction_entry.id Restrict delete 
work_order_package_destination_branch_id_fkey work_order_package.destination_branch_id branch.id Restrict delete 
work_order_package_item_order_id_fkey work_order_package_item.order_id work_order.id Restrict delete 
work_order_package_item_package_id_fkey work_order_package_item.package_id work_order_package.id Restrict delete 
work_order_package_item_te_id_fkey work_order_package_item.te_id transaction_entry.id Restrict delete 
work_order_package_receive_responsible_id_fkey work_order_package.receive_responsible_id login_user.id Restrict delete 
work_order_package_send_responsible_id_fkey work_order_package.send_responsible_id login_user.id Restrict delete 
work_order_package_source_branch_id_fkey work_order_package.source_branch_id branch.id Restrict delete 
work_order_package_te_id_fkey work_order_package.te_id transaction_entry.id Restrict delete 
work_order_quote_responsible_id_fkey work_order.quote_responsible_id employee.id Restrict delete 
work_order_sale_id_fkey work_order.sale_id sale.id Restrict delete 
work_order_sellable_id_fkey work_order.sellable_id sellable.id Restrict delete 
work_order_te_id_fkey work_order.te_id transaction_entry.id Restrict delete 
work_permit_data_te_id_fkey work_permit_data.te_id transaction_entry.id Restrict delete 

Check Constraints:

Table Constraint Name Constraint
None detected