-- Name: emp_installment_details emp_installment_details_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.emp_installment_details
    ADD CONSTRAINT emp_installment_details_pkey PRIMARY KEY (id);


--
-- Name: emp_installments emp_installments_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.emp_installments
    ADD CONSTRAINT emp_installments_pkey PRIMARY KEY (id);


--
-- Name: emp_mails emp_mails_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.emp_mails
    ADD CONSTRAINT emp_mails_pkey PRIMARY KEY (id);


--
-- Name: emp_movements emp_movements_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.emp_movements
    ADD CONSTRAINT emp_movements_pkey PRIMARY KEY (id);


--
-- Name: emp_p_o_s_stores emp_p_o_s_stores_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.emp_p_o_s_stores
    ADD CONSTRAINT emp_p_o_s_stores_pkey PRIMARY KEY (id);


--
-- Name: emp_payment_accounts emp_payment_accounts_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.emp_payment_accounts
    ADD CONSTRAINT emp_payment_accounts_pkey PRIMARY KEY (id);


--
-- Name: emp_ratios emp_ratios_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.emp_ratios
    ADD CONSTRAINT emp_ratios_pkey PRIMARY KEY (id);


--
-- Name: emp_recipt_accounts emp_recipt_accounts_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.emp_recipt_accounts
    ADD CONSTRAINT emp_recipt_accounts_pkey PRIMARY KEY (id);


--
-- Name: emp_safes emp_safes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.emp_safes
    ADD CONSTRAINT emp_safes_pkey PRIMARY KEY (id);


--
-- Name: empassies empassies_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.empassies
    ADD CONSTRAINT empassies_pkey PRIMARY KEY (id);


--
-- Name: empassy_reserve_dates empassy_reserve_dates_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.empassy_reserve_dates
    ADD CONSTRAINT empassy_reserve_dates_pkey PRIMARY KEY (id);


--
-- Name: employesses employesses_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.employesses
    ADD CONSTRAINT employesses_pkey PRIMARY KEY (id);


--
-- Name: employment_levels employment_levels_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.employment_levels
    ADD CONSTRAINT employment_levels_pkey PRIMARY KEY (id);


--
-- Name: emps_producation_points emps_producation_points_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.emps_producation_points
    ADD CONSTRAINT emps_producation_points_pkey PRIMARY KEY (id);


--
-- Name: emps_producation_quantities emps_producation_quantities_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.emps_producation_quantities
    ADD CONSTRAINT emps_producation_quantities_pkey PRIMARY KEY (id);


--
-- Name: entitlements entitlements_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.entitlements
    ADD CONSTRAINT entitlements_pkey PRIMARY KEY (id);


--
-- Name: events events_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.events
    ADD CONSTRAINT events_pkey PRIMARY KEY (id);


--
-- Name: examinations_types examinations_types_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.examinations_types
    ADD CONSTRAINT examinations_types_pkey PRIMARY KEY (id);


--
-- Name: exchange_commissions exchange_commissions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.exchange_commissions
    ADD CONSTRAINT exchange_commissions_pkey PRIMARY KEY (id);


--
-- Name: execute_job_order_models execute_job_order_models_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.execute_job_order_models
    ADD CONSTRAINT execute_job_order_models_pkey PRIMARY KEY (id);


--
-- Name: execute_job_order_workmanships execute_job_order_workmanships_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.execute_job_order_workmanships
    ADD CONSTRAINT execute_job_order_workmanships_pkey PRIMARY KEY (id);


--
-- Name: execute_job_orders execute_job_orders_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.execute_job_orders
    ADD CONSTRAINT execute_job_orders_pkey PRIMARY KEY (id);


--
-- Name: execute_sewing_orders execute_sewing_orders_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.execute_sewing_orders
    ADD CONSTRAINT execute_sewing_orders_pkey PRIMARY KEY (id);


--
-- Name: executing_receiving_secretariats executing_receiving_secretariats_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.executing_receiving_secretariats
    ADD CONSTRAINT executing_receiving_secretariats_pkey PRIMARY KEY (id);


--
-- Name: executing_receivings executing_receivings_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.executing_receivings
    ADD CONSTRAINT executing_receivings_pkey PRIMARY KEY (id);


--
-- Name: executor_filters executor_filters_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.executor_filters
    ADD CONSTRAINT executor_filters_pkey PRIMARY KEY (id);


--
-- Name: expenses_list_column_sechdules expenses_list_column_sechdules_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.expenses_list_column_sechdules
    ADD CONSTRAINT expenses_list_column_sechdules_pkey PRIMARY KEY (id);


--
-- Name: expenses_list_columns expenses_list_columns_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.expenses_list_columns
    ADD CONSTRAINT expenses_list_columns_pkey PRIMARY KEY (id);


--
-- Name: expenses_type_projects expenses_type_projects_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.expenses_type_projects
    ADD CONSTRAINT expenses_type_projects_pkey PRIMARY KEY (id);


--
-- Name: expenses_type_templates expenses_type_templates_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.expenses_type_templates
    ADD CONSTRAINT expenses_type_templates_pkey PRIMARY KEY (id);


--
-- Name: expire_date_qties expire_date_qties_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.expire_date_qties
    ADD CONSTRAINT expire_date_qties_pkey PRIMARY KEY (id);


--
-- Name: export_checks export_checks_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.export_checks
    ADD CONSTRAINT export_checks_pkey PRIMARY KEY (id);


--
-- Name: f_a_q_s f_a_q_s_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.f_a_q_s
    ADD CONSTRAINT f_a_q_s_pkey PRIMARY KEY (id);


--
-- Name: failed_jobs failed_jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.failed_jobs
    ADD CONSTRAINT failed_jobs_pkey PRIMARY KEY (id);


--
-- Name: failed_jobs failed_jobs_uuid_unique; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.failed_jobs
    ADD CONSTRAINT failed_jobs_uuid_unique UNIQUE (uuid);


--
-- Name: faults_types faults_types_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.faults_types
    ADD CONSTRAINT faults_types_pkey PRIMARY KEY (id);


--
-- Name: fifo_qties fifo_qties_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.fifo_qties
    ADD CONSTRAINT fifo_qties_pkey PRIMARY KEY (id);


--
-- Name: firewall_ips firewall_ips_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.firewall_ips
    ADD CONSTRAINT firewall_ips_pkey PRIMARY KEY (id);


--
-- Name: firewall_logs firewall_logs_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.firewall_logs
    ADD CONSTRAINT firewall_logs_pkey PRIMARY KEY (id);


--
-- Name: follow_lists follow_lists_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.follow_lists
    ADD CONSTRAINT follow_lists_pkey PRIMARY KEY (id);


--
-- Name: general_dailies general_dailies_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.general_dailies
    ADD CONSTRAINT general_dailies_pkey PRIMARY KEY (id);


--
-- Name: goods_product_projects goods_product_projects_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.goods_product_projects
    ADD CONSTRAINT goods_product_projects_pkey PRIMARY KEY (id);


--
-- Name: goods_projects goods_projects_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.goods_projects
    ADD CONSTRAINT goods_projects_pkey PRIMARY KEY (id);


--
-- Name: governrates governrates_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.governrates
    ADD CONSTRAINT governrates_pkey PRIMARY KEY (id);


--
-- Name: group_filters group_filters_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.group_filters
    ADD CONSTRAINT group_filters_pkey PRIMARY KEY (id);


--
-- Name: holidays holidays_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.holidays
    ADD CONSTRAINT holidays_pkey PRIMARY KEY (id);


--
-- Name: holidays_types holidays_types_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.holidays_types
    ADD CONSTRAINT holidays_types_pkey PRIMARY KEY (id);


--
-- Name: home_e_com_designs home_e_com_designs_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.home_e_com_designs
    ADD CONSTRAINT home_e_com_designs_pkey PRIMARY KEY (id);


--
-- Name: home_product_e_com_designs home_product_e_com_designs_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.home_product_e_com_designs
    ADD CONSTRAINT home_product_e_com_designs_pkey PRIMARY KEY (id);


--
-- Name: import_expenses_types import_expenses_types_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.import_expenses_types
    ADD CONSTRAINT import_expenses_types_pkey PRIMARY KEY (id);


--
-- Name: import_new_prods import_new_prods_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.import_new_prods
    ADD CONSTRAINT import_new_prods_pkey PRIMARY KEY (id);


--
-- Name: import_new_prods_starts import_new_prods_starts_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.import_new_prods_starts
    ADD CONSTRAINT import_new_prods_starts_pkey PRIMARY KEY (id);


--
-- Name: in_out_logs in_out_logs_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.in_out_logs
    ADD CONSTRAINT in_out_logs_pkey PRIMARY KEY (id);


--
-- Name: incom_checks incom_checks_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.incom_checks
    ADD CONSTRAINT incom_checks_pkey PRIMARY KEY (id);


--
-- Name: incom_manufacturing_models incom_manufacturing_models_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.incom_manufacturing_models
    ADD CONSTRAINT incom_manufacturing_models_pkey PRIMARY KEY (id);


--
-- Name: incom_manufacturing_secretariat_models incom_manufacturing_secretariat_models_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.incom_manufacturing_secretariat_models
    ADD CONSTRAINT incom_manufacturing_secretariat_models_pkey PRIMARY KEY (id);


--
-- Name: install_companies_sales_bills_columns install_companies_sales_bills_columns_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.install_companies_sales_bills_columns
    ADD CONSTRAINT install_companies_sales_bills_columns_pkey PRIMARY KEY (id);


--
-- Name: install_companies_sales_bills_columns_sechdules install_companies_sales_bills_columns_sechdules_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.install_companies_sales_bills_columns_sechdules
    ADD CONSTRAINT install_companies_sales_bills_columns_sechdules_pkey PRIMARY KEY (id);


--
-- Name: installment_companies installment_companies_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.installment_companies
    ADD CONSTRAINT installment_companies_pkey PRIMARY KEY (id);


--
-- Name: installment_companies_ratios installment_companies_ratios_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.installment_companies_ratios
    ADD CONSTRAINT installment_companies_ratios_pkey PRIMARY KEY (id);


--
-- Name: installment_dates installment_dates_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.installment_dates
    ADD CONSTRAINT installment_dates_pkey PRIMARY KEY (id);


--
-- Name: installments installments_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.installments
    ADD CONSTRAINT installments_pkey PRIMARY KEY (id);


--
-- Name: insurance_companies insurance_companies_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.insurance_companies
    ADD CONSTRAINT insurance_companies_pkey PRIMARY KEY (id);


--
-- Name: insurance_papers insurance_papers_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.insurance_papers
    ADD CONSTRAINT insurance_papers_pkey PRIMARY KEY (id);


--
-- Name: interviews interviews_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.interviews
    ADD CONSTRAINT interviews_pkey PRIMARY KEY (id);


--
-- Name: interviews_types interviews_types_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.interviews_types
    ADD CONSTRAINT interviews_types_pkey PRIMARY KEY (id);


--
-- Name: intros intros_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.intros
    ADD CONSTRAINT intros_pkey PRIMARY KEY (id);


--
-- Name: inventories inventories_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.inventories
    ADD CONSTRAINT inventories_pkey PRIMARY KEY (id);


--
-- Name: investors investors_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.investors
    ADD CONSTRAINT investors_pkey PRIMARY KEY (id);


--
-- Name: issues issues_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.issues
    ADD CONSTRAINT issues_pkey PRIMARY KEY (id);


--
-- Name: items_groups items_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.items_groups
    ADD CONSTRAINT items_groups_pkey PRIMARY KEY (id);


--
-- Name: itineraries itineraries_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.itineraries
    ADD CONSTRAINT itineraries_pkey PRIMARY KEY (id);


--
-- Name: itinerary_visits itinerary_visits_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.itinerary_visits
    ADD CONSTRAINT itinerary_visits_pkey PRIMARY KEY (id);


--
-- Name: job_orders_executors job_orders_executors_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.job_orders_executors
    ADD CONSTRAINT job_orders_executors_pkey PRIMARY KEY (id);


--
-- Name: job_orders job_orders_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.job_orders
    ADD CONSTRAINT job_orders_pkey PRIMARY KEY (id);


--
-- Name: jobs jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.jobs
    ADD CONSTRAINT jobs_pkey PRIMARY KEY (id);


--
-- Name: jobs_types jobs_types_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.jobs_types
    ADD CONSTRAINT jobs_types_pkey PRIMARY KEY (id);


--
-- Name: jouns jouns_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.jouns
    ADD CONSTRAINT jouns_pkey PRIMARY KEY (id);


--
-- Name: journalizing_details journalizing_details_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.journalizing_details
    ADD CONSTRAINT journalizing_details_pkey PRIMARY KEY (id);


--
-- Name: journalizings journalizings_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.journalizings
    ADD CONSTRAINT journalizings_pkey PRIMARY KEY (id);


--
-- Name: languages languages_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.languages
    ADD CONSTRAINT languages_pkey PRIMARY KEY (id);


--
-- Name: loan_types loan_types_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.loan_types
    ADD CONSTRAINT loan_types_pkey PRIMARY KEY (id);


--
-- Name: loans loans_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.loans
    ADD CONSTRAINT loans_pkey PRIMARY KEY (id);


--
-- Name: login_sliders login_sliders_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.login_sliders
    ADD CONSTRAINT login_sliders_pkey PRIMARY KEY (id);


--
-- Name: main_e_com_designs main_e_com_designs_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.main_e_com_designs
    ADD CONSTRAINT main_e_com_designs_pkey PRIMARY KEY (id);


--
-- Name: maintainc_bills maintainc_bills_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.maintainc_bills
    ADD CONSTRAINT maintainc_bills_pkey PRIMARY KEY (id);


--
-- Name: maintaince_colors maintaince_colors_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.maintaince_colors
    ADD CONSTRAINT maintaince_colors_pkey PRIMARY KEY (id);


--
-- Name: maintaince_default_data maintaince_default_data_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.maintaince_default_data
    ADD CONSTRAINT maintaince_default_data_pkey PRIMARY KEY (id);


--
-- Name: manu_store_counts manu_store_counts_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.manu_store_counts
    ADD CONSTRAINT manu_store_counts_pkey PRIMARY KEY (id);


--
-- Name: manufacture_companies manufacture_companies_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.manufacture_companies
    ADD CONSTRAINT manufacture_companies_pkey PRIMARY KEY (id);


--
-- Name: manufacturing_default_data manufacturing_default_data_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.manufacturing_default_data
    ADD CONSTRAINT manufacturing_default_data_pkey PRIMARY KEY (id);


--
-- Name: manufacturing_executions manufacturing_executions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.manufacturing_executions
    ADD CONSTRAINT manufacturing_executions_pkey PRIMARY KEY (id);


--
-- Name: manufacturing_halls manufacturing_halls_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.manufacturing_halls
    ADD CONSTRAINT manufacturing_halls_pkey PRIMARY KEY (id);


--
-- Name: manufacturing_model_assets manufacturing_model_assets_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.manufacturing_model_assets
    ADD CONSTRAINT manufacturing_model_assets_pkey PRIMARY KEY (id);


--
-- Name: manufacturing_model_emps manufacturing_model_emps_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.manufacturing_model_emps
    ADD CONSTRAINT manufacturing_model_emps_pkey PRIMARY KEY (id);


--
-- Name: manufacturing_model_expenses manufacturing_model_expenses_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.manufacturing_model_expenses
    ADD CONSTRAINT manufacturing_model_expenses_pkey PRIMARY KEY (id);


--
-- Name: manufacturing_model_services manufacturing_model_services_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.manufacturing_model_services
    ADD CONSTRAINT manufacturing_model_services_pkey PRIMARY KEY (id);


--
-- Name: manufacturing_model_workers manufacturing_model_workers_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.manufacturing_model_workers
    ADD CONSTRAINT manufacturing_model_workers_pkey PRIMARY KEY (id);


--
-- Name: manufacturing_models manufacturing_models_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.manufacturing_models
    ADD CONSTRAINT manufacturing_models_pkey PRIMARY KEY (id);


--
-- Name: manufacturing_orders manufacturing_orders_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.manufacturing_orders
    ADD CONSTRAINT manufacturing_orders_pkey PRIMARY KEY (id);


--
-- Name: manufacturing_requests manufacturing_requests_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.manufacturing_requests
    ADD CONSTRAINT manufacturing_requests_pkey PRIMARY KEY (id);


--
-- Name: manufacturing_secretariat_models manufacturing_secretariat_models_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.manufacturing_secretariat_models
    ADD CONSTRAINT manufacturing_secretariat_models_pkey PRIMARY KEY (id);


--
-- Name: measuerments measuerments_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.measuerments
    ADD CONSTRAINT measuerments_pkey PRIMARY KEY (id);


--
-- Name: migrations migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.migrations
    ADD CONSTRAINT migrations_pkey PRIMARY KEY (id);


--
-- Name: missions missions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.missions
    ADD CONSTRAINT missions_pkey PRIMARY KEY (id);


--
-- Name: model_has_permissions model_has_permissions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.model_has_permissions
    ADD CONSTRAINT model_has_permissions_pkey PRIMARY KEY (permission_id, model_id, model_type);


--
-- Name: model_has_roles model_has_roles_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.model_has_roles
    ADD CONSTRAINT model_has_roles_pkey PRIMARY KEY (role_id, model_id, model_type);


--
-- Name: module_settings_nums module_settings_nums_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.module_settings_nums
    ADD CONSTRAINT module_settings_nums_pkey PRIMARY KEY (id);


--
-- Name: modules modules_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.modules
    ADD CONSTRAINT modules_pkey PRIMARY KEY (id);


--
-- Name: more_products_halls more_products_halls_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.more_products_halls
    ADD CONSTRAINT more_products_halls_pkey PRIMARY KEY (id);


--
-- Name: most_sales_products_column_sechdules most_sales_products_column_sechdules_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.most_sales_products_column_sechdules
    ADD CONSTRAINT most_sales_products_column_sechdules_pkey PRIMARY KEY (id);


--
-- Name: most_sales_products_columns most_sales_products_columns_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.most_sales_products_columns
    ADD CONSTRAINT most_sales_products_columns_pkey PRIMARY KEY (id);


--
-- Name: msg_rqsts msg_rqsts_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.msg_rqsts
    ADD CONSTRAINT msg_rqsts_pkey PRIMARY KEY (id);


--
-- Name: my_follow_lists my_follow_lists_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.my_follow_lists
    ADD CONSTRAINT my_follow_lists_pkey PRIMARY KEY (id);


--
-- Name: new_shipping_categories new_shipping_categories_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.new_shipping_categories
    ADD CONSTRAINT new_shipping_categories_pkey PRIMARY KEY (id);


--
-- Name: new_shipping_rqst_types new_shipping_rqst_types_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.new_shipping_rqst_types
    ADD CONSTRAINT new_shipping_rqst_types_pkey PRIMARY KEY (id);


--
-- Name: new_shipping_types new_shipping_types_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.new_shipping_types
    ADD CONSTRAINT new_shipping_types_pkey PRIMARY KEY (id);


--
-- Name: notifications notifications_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.notifications
    ADD CONSTRAINT notifications_pkey PRIMARY KEY (id);


--
-- Name: opening_entries_details opening_entries_details_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.opening_entries_details
    ADD CONSTRAINT opening_entries_details_pkey PRIMARY KEY (id);


--
-- Name: opening_entries opening_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.opening_entries
    ADD CONSTRAINT opening_entries_pkey PRIMARY KEY (id);


--
-- Name: order_pays order_pays_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.order_pays
    ADD CONSTRAINT order_pays_pkey PRIMARY KEY (id);


--
-- Name: outcom_manufacturing_models outcom_manufacturing_models_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.outcom_manufacturing_models
    ADD CONSTRAINT outcom_manufacturing_models_pkey PRIMARY KEY (id);


--
-- Name: outcome_manufacturing_secretariat_models outcome_manufacturing_secretariat_models_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.outcome_manufacturing_secretariat_models
    ADD CONSTRAINT outcome_manufacturing_secretariat_models_pkey PRIMARY KEY (id);


--
-- Name: over_times over_times_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.over_times
    ADD CONSTRAINT over_times_pkey PRIMARY KEY (id);


--
-- Name: owners_reals owners_reals_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.owners_reals
    ADD CONSTRAINT owners_reals_pkey PRIMARY KEY (id);


--
-- Name: pack_prems pack_prems_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.pack_prems
    ADD CONSTRAINT pack_prems_pkey PRIMARY KEY (id);


--
-- Name: packages packages_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.packages
    ADD CONSTRAINT packages_pkey PRIMARY KEY (id);


--
-- Name: partners partners_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.partners
    ADD CONSTRAINT partners_pkey PRIMARY KEY (id);


--
-- Name: pay_profit_investors pay_profit_investors_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.pay_profit_investors
    ADD CONSTRAINT pay_profit_investors_pkey PRIMARY KEY (id);


--
-- Name: pay_salaries pay_salaries_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.pay_salaries
    ADD CONSTRAINT pay_salaries_pkey PRIMARY KEY (id);


--
-- Name: payment_voucher_details payment_voucher_details_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.payment_voucher_details
    ADD CONSTRAINT payment_voucher_details_pkey PRIMARY KEY (id);


--
-- Name: payment_vouchers payment_vouchers_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.payment_vouchers
    ADD CONSTRAINT payment_vouchers_pkey PRIMARY KEY (id);


--
-- Name: paymentss_products_real_projects paymentss_products_real_projects_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.paymentss_products_real_projects
    ADD CONSTRAINT paymentss_products_real_projects_pkey PRIMARY KEY (id);


--
-- Name: paymentss_real_projects paymentss_real_projects_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.paymentss_real_projects
    ADD CONSTRAINT paymentss_real_projects_pkey PRIMARY KEY (id);


--
-- Name: permission_to_exchange_goods permission_to_exchange_goods_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.permission_to_exchange_goods
    ADD CONSTRAINT permission_to_exchange_goods_pkey PRIMARY KEY (id);


--
-- Name: permission_to_recived_goods permission_to_recived_goods_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.permission_to_recived_goods
    ADD CONSTRAINT permission_to_recived_goods_pkey PRIMARY KEY (id);


--
-- Name: permissions permissions_name_guard_name_unique; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.permissions
    ADD CONSTRAINT permissions_name_guard_name_unique UNIQUE (name, guard_name);


--
-- Name: permissions permissions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.permissions
    ADD CONSTRAINT permissions_pkey PRIMARY KEY (id);


--
-- Name: places places_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.places
    ADD CONSTRAINT places_pkey PRIMARY KEY (id);


--
-- Name: places_reals places_reals_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.places_reals
    ADD CONSTRAINT places_reals_pkey PRIMARY KEY (id);


--
-- Name: platforms platforms_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.platforms
    ADD CONSTRAINT platforms_pkey PRIMARY KEY (id);


--
-- Name: polices polices_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.polices
    ADD CONSTRAINT polices_pkey PRIMARY KEY (id);


--
-- Name: pro_details_imgs pro_details_imgs_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.pro_details_imgs
    ADD CONSTRAINT pro_details_imgs_pkey PRIMARY KEY (id);


--
-- Name: pro_notes pro_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.pro_notes
    ADD CONSTRAINT pro_notes_pkey PRIMARY KEY (id);


--
-- Name: product_colors product_colors_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_colors
    ADD CONSTRAINT product_colors_pkey PRIMARY KEY (id);


--
-- Name: product_details_e_com_designs product_details_e_com_designs_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_details_e_com_designs
    ADD CONSTRAINT product_details_e_com_designs_pkey PRIMARY KEY (id);


--
-- Name: product_executing_receiving_secretariats product_executing_receiving_secretariats_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_executing_receiving_secretariats
    ADD CONSTRAINT product_executing_receiving_secretariats_pkey PRIMARY KEY (id);


--
-- Name: product_inventories product_inventories_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_inventories
    ADD CONSTRAINT product_inventories_pkey PRIMARY KEY (id);


--
-- Name: product_job_orders product_job_orders_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_job_orders
    ADD CONSTRAINT product_job_orders_pkey PRIMARY KEY (id);


--
-- Name: product_maintainc_bills product_maintainc_bills_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_maintainc_bills
    ADD CONSTRAINT product_maintainc_bills_pkey PRIMARY KEY (id);


--
-- Name: product_manufacturing_executions product_manufacturing_executions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_manufacturing_executions
    ADD CONSTRAINT product_manufacturing_executions_pkey PRIMARY KEY (id);


--
-- Name: product_moves_columns product_moves_columns_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_moves_columns
    ADD CONSTRAINT product_moves_columns_pkey PRIMARY KEY (id);


--
-- Name: product_moves_columns_sechdules product_moves_columns_sechdules_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_moves_columns_sechdules
    ADD CONSTRAINT product_moves_columns_sechdules_pkey PRIMARY KEY (id);


--
-- Name: product_moves_filter_twos product_moves_filter_twos_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_moves_filter_twos
    ADD CONSTRAINT product_moves_filter_twos_pkey PRIMARY KEY (id);


--
-- Name: product_moves_filters product_moves_filters_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_moves_filters
    ADD CONSTRAINT product_moves_filters_pkey PRIMARY KEY (id);


--
-- Name: product_moves product_moves_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_moves
    ADD CONSTRAINT product_moves_pkey PRIMARY KEY (id);


--
-- Name: product_quote_images product_quote_images_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_quote_images
    ADD CONSTRAINT product_quote_images_pkey PRIMARY KEY (id);


--
-- Name: product_return_without_bills product_return_without_bills_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_return_without_bills
    ADD CONSTRAINT product_return_without_bills_pkey PRIMARY KEY (id);


--
-- Name: product_sales_gifts product_sales_gifts_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_sales_gifts
    ADD CONSTRAINT product_sales_gifts_pkey PRIMARY KEY (id);


--
-- Name: product_sales_orders product_sales_orders_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_sales_orders
    ADD CONSTRAINT product_sales_orders_pkey PRIMARY KEY (id);


--
-- Name: product_sales product_sales_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_sales
    ADD CONSTRAINT product_sales_pkey PRIMARY KEY (id);


--
-- Name: product_sales_subscribes product_sales_subscribes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_sales_subscribes
    ADD CONSTRAINT product_sales_subscribes_pkey PRIMARY KEY (id);


--
-- Name: product_settlements product_settlements_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_settlements
    ADD CONSTRAINT product_settlements_pkey PRIMARY KEY (id);


--
-- Name: product_sizes product_sizes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_sizes
    ADD CONSTRAINT product_sizes_pkey PRIMARY KEY (id);


--
-- Name: product_thicknesses product_thicknesses_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_thicknesses
    ADD CONSTRAINT product_thicknesses_pkey PRIMARY KEY (id);


--
-- Name: product_type_defaults product_type_defaults_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_type_defaults
    ADD CONSTRAINT product_type_defaults_pkey PRIMARY KEY (id);


--
-- Name: product_units product_units_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_units
    ADD CONSTRAINT product_units_pkey PRIMARY KEY (id);


--
-- Name: products_client_requests products_client_requests_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_client_requests
    ADD CONSTRAINT products_client_requests_pkey PRIMARY KEY (id);


--
-- Name: products_consists products_consists_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_consists
    ADD CONSTRAINT products_consists_pkey PRIMARY KEY (id);


--
-- Name: products_executing_receivings products_executing_receivings_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_executing_receivings
    ADD CONSTRAINT products_executing_receivings_pkey PRIMARY KEY (id);


--
-- Name: products_manufacturing_orders products_manufacturing_orders_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_manufacturing_orders
    ADD CONSTRAINT products_manufacturing_orders_pkey PRIMARY KEY (id);


--
-- Name: products_manufacturing_requests products_manufacturing_requests_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_manufacturing_requests
    ADD CONSTRAINT products_manufacturing_requests_pkey PRIMARY KEY (id);


--
-- Name: products_permission_to_exchange_goods products_permission_to_exchange_goods_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_permission_to_exchange_goods
    ADD CONSTRAINT products_permission_to_exchange_goods_pkey PRIMARY KEY (id);


--
-- Name: products_permission_to_recived_goods products_permission_to_recived_goods_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_permission_to_recived_goods
    ADD CONSTRAINT products_permission_to_recived_goods_pkey PRIMARY KEY (id);


--
-- Name: products products_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products
    ADD CONSTRAINT products_pkey PRIMARY KEY (id);


--
-- Name: products_purchase_petrols products_purchase_petrols_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_purchase_petrols
    ADD CONSTRAINT products_purchase_petrols_pkey PRIMARY KEY (id);


--
-- Name: products_purchases_orders products_purchases_orders_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_purchases_orders
    ADD CONSTRAINT products_purchases_orders_pkey PRIMARY KEY (id);


--
-- Name: products_purchases products_purchases_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_purchases
    ADD CONSTRAINT products_purchases_pkey PRIMARY KEY (id);


--
-- Name: products_qties products_qties_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_qties
    ADD CONSTRAINT products_qties_pkey PRIMARY KEY (id);


--
-- Name: products_quotes products_quotes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_quotes
    ADD CONSTRAINT products_quotes_pkey PRIMARY KEY (id);


--
-- Name: products_return_maintaince_bills products_return_maintaince_bills_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_return_maintaince_bills
    ADD CONSTRAINT products_return_maintaince_bills_pkey PRIMARY KEY (id);


--
-- Name: products_secretariat_export_goods products_secretariat_export_goods_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_secretariat_export_goods
    ADD CONSTRAINT products_secretariat_export_goods_pkey PRIMARY KEY (id);


--
-- Name: products_secretariat_import_goods products_secretariat_import_goods_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_secretariat_import_goods
    ADD CONSTRAINT products_secretariat_import_goods_pkey PRIMARY KEY (id);


--
-- Name: products_shortcomings products_shortcomings_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_shortcomings
    ADD CONSTRAINT products_shortcomings_pkey PRIMARY KEY (id);


--
-- Name: products_start_periods products_start_periods_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_start_periods
    ADD CONSTRAINT products_start_periods_pkey PRIMARY KEY (id);


--
-- Name: products_stores products_stores_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_stores
    ADD CONSTRAINT products_stores_pkey PRIMARY KEY (id);


--
-- Name: products_stores_transfers products_stores_transfers_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_stores_transfers
    ADD CONSTRAINT products_stores_transfers_pkey PRIMARY KEY (id);


--
-- Name: products_viras products_viras_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_viras
    ADD CONSTRAINT products_viras_pkey PRIMARY KEY (id);


--
-- Name: profit_sales_product_column_sechdulrs profit_sales_product_column_sechdulrs_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.profit_sales_product_column_sechdulrs
    ADD CONSTRAINT profit_sales_product_column_sechdulrs_pkey PRIMARY KEY (id);


--
-- Name: profit_sales_product_columns profit_sales_product_columns_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.profit_sales_product_columns
    ADD CONSTRAINT profit_sales_product_columns_pkey PRIMARY KEY (id);


--
-- Name: project_statuses project_statuses_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.project_statuses
    ADD CONSTRAINT project_statuses_pkey PRIMARY KEY (id);


--
-- Name: project_teams project_teams_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.project_teams
    ADD CONSTRAINT project_teams_pkey PRIMARY KEY (id);


--
-- Name: projects projects_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.projects
    ADD CONSTRAINT projects_pkey PRIMARY KEY (id);


--
-- Name: purch_bills_columns purch_bills_columns_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.purch_bills_columns
    ADD CONSTRAINT purch_bills_columns_pkey PRIMARY KEY (id);


--
-- Name: purch_bills_columns_sechdules purch_bills_columns_sechdules_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.purch_bills_columns_sechdules
    ADD CONSTRAINT purch_bills_columns_sechdules_pkey PRIMARY KEY (id);


--
-- Name: purch_bills_filter_twos purch_bills_filter_twos_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.purch_bills_filter_twos
    ADD CONSTRAINT purch_bills_filter_twos_pkey PRIMARY KEY (id);


--
-- Name: purch_bills_filters purch_bills_filters_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.purch_bills_filters
    ADD CONSTRAINT purch_bills_filters_pkey PRIMARY KEY (id);


--
-- Name: purchase_petrols purchase_petrols_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.purchase_petrols
    ADD CONSTRAINT purchase_petrols_pkey PRIMARY KEY (id);


--
-- Name: purchases_default_data purchases_default_data_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.purchases_default_data
    ADD CONSTRAINT purchases_default_data_pkey PRIMARY KEY (id);


--
-- Name: purchases_expenses_types purchases_expenses_types_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.purchases_expenses_types
    ADD CONSTRAINT purchases_expenses_types_pkey PRIMARY KEY (id);


--
-- Name: purchases_order_expenses_types purchases_order_expenses_types_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.purchases_order_expenses_types
    ADD CONSTRAINT purchases_order_expenses_types_pkey PRIMARY KEY (id);


--
-- Name: purchases_orders purchases_orders_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.purchases_orders
    ADD CONSTRAINT purchases_orders_pkey PRIMARY KEY (id);


--
-- Name: purchases purchases_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.purchases
    ADD CONSTRAINT purchases_pkey PRIMARY KEY (id);


--
-- Name: purpose_travel purpose_travel_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.purpose_travel
    ADD CONSTRAINT purpose_travel_pkey PRIMARY KEY (id);


--
-- Name: q_r_s q_r_s_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.q_r_s
    ADD CONSTRAINT q_r_s_pkey PRIMARY KEY (id);


--
-- Name: qualities qualities_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.qualities
    ADD CONSTRAINT qualities_pkey PRIMARY KEY (id);


--
-- Name: quality_details quality_details_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.quality_details
    ADD CONSTRAINT quality_details_pkey PRIMARY KEY (id);


--
-- Name: quote_images quote_images_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.quote_images
    ADD CONSTRAINT quote_images_pkey PRIMARY KEY (id);


--
-- Name: quotes quotes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.quotes
    ADD CONSTRAINT quotes_pkey PRIMARY KEY (id);


--
-- Name: rabih_education rabih_education_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.rabih_education
    ADD CONSTRAINT rabih_education_pkey PRIMARY KEY (id);


--
-- Name: rates rates_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.rates
    ADD CONSTRAINT rates_pkey PRIMARY KEY (id);


--
-- Name: real_sate_projects_payments real_sate_projects_payments_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.real_sate_projects_payments
    ADD CONSTRAINT real_sate_projects_payments_pkey PRIMARY KEY (id);


--
-- Name: real_sate_projects real_sate_projects_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.real_sate_projects
    ADD CONSTRAINT real_sate_projects_pkey PRIMARY KEY (id);


--
-- Name: real_state_default_data real_state_default_data_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.real_state_default_data
    ADD CONSTRAINT real_state_default_data_pkey PRIMARY KEY (id);


--
-- Name: real_units real_units_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.real_units
    ADD CONSTRAINT real_units_pkey PRIMARY KEY (id);


--
-- Name: real_units_services real_units_services_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.real_units_services
    ADD CONSTRAINT real_units_services_pkey PRIMARY KEY (id);


--
-- Name: reasons reasons_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.reasons
    ADD CONSTRAINT reasons_pkey PRIMARY KEY (id);


--
-- Name: recipt_maintaince_errors recipt_maintaince_errors_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recipt_maintaince_errors
    ADD CONSTRAINT recipt_maintaince_errors_pkey PRIMARY KEY (id);


--
-- Name: recipt_maintainces recipt_maintainces_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recipt_maintainces
    ADD CONSTRAINT recipt_maintainces_pkey PRIMARY KEY (id);


--
-- Name: recipt_voucher_details recipt_voucher_details_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recipt_voucher_details
    ADD CONSTRAINT recipt_voucher_details_pkey PRIMARY KEY (id);


--
-- Name: recipt_vouchers recipt_vouchers_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recipt_vouchers
    ADD CONSTRAINT recipt_vouchers_pkey PRIMARY KEY (id);


--
-- Name: recipts_sales_petrols recipts_sales_petrols_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recipts_sales_petrols
    ADD CONSTRAINT recipts_sales_petrols_pkey PRIMARY KEY (id);


--
-- Name: recipts_types recipts_types_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recipts_types
    ADD CONSTRAINT recipts_types_pkey PRIMARY KEY (id);


--
-- Name: recived_purch_products recived_purch_products_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recived_purch_products
    ADD CONSTRAINT recived_purch_products_pkey PRIMARY KEY (id);


--
-- Name: recived_purchts recived_purchts_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recived_purchts
    ADD CONSTRAINT recived_purchts_pkey PRIMARY KEY (id);


--
-- Name: recived_sales recived_sales_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recived_sales
    ADD CONSTRAINT recived_sales_pkey PRIMARY KEY (id);


--
-- Name: recived_sales_products recived_sales_products_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recived_sales_products
    ADD CONSTRAINT recived_sales_products_pkey PRIMARY KEY (id);


--
-- Name: recived_shipment_goods recived_shipment_goods_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recived_shipment_goods
    ADD CONSTRAINT recived_shipment_goods_pkey PRIMARY KEY (id);


--
-- Name: recived_shipments recived_shipments_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recived_shipments
    ADD CONSTRAINT recived_shipments_pkey PRIMARY KEY (id);


--
-- Name: reg_courses reg_courses_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.reg_courses
    ADD CONSTRAINT reg_courses_pkey PRIMARY KEY (id);


--
-- Name: reg_courses_students reg_courses_students_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.reg_courses_students
    ADD CONSTRAINT reg_courses_students_pkey PRIMARY KEY (id);


--
-- Name: reg_over_times reg_over_times_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.reg_over_times
    ADD CONSTRAINT reg_over_times_pkey PRIMARY KEY (id);


--
-- Name: remove_products_halls remove_products_halls_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.remove_products_halls
    ADD CONSTRAINT remove_products_halls_pkey PRIMARY KEY (id);


--
-- Name: rent_contracts rent_contracts_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.rent_contracts
    ADD CONSTRAINT rent_contracts_pkey PRIMARY KEY (id);


--
-- Name: rent_period_reals rent_period_reals_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.rent_period_reals
    ADD CONSTRAINT rent_period_reals_pkey PRIMARY KEY (id);


--
-- Name: reports_settings reports_settings_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.reports_settings
    ADD CONSTRAINT reports_settings_pkey PRIMARY KEY (id);


--
-- Name: reservations reservations_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.reservations
    ADD CONSTRAINT reservations_pkey PRIMARY KEY (id);


--
-- Name: reserve_course_days reserve_course_days_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.reserve_course_days
    ADD CONSTRAINT reserve_course_days_pkey PRIMARY KEY (id);


--
-- Name: reserve_course_students reserve_course_students_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.reserve_course_students
    ADD CONSTRAINT reserve_course_students_pkey PRIMARY KEY (id);


--
-- Name: reserve_courses reserve_courses_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.reserve_courses
    ADD CONSTRAINT reserve_courses_pkey PRIMARY KEY (id);


--
-- Name: resignation_requests resignation_requests_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.resignation_requests
    ADD CONSTRAINT resignation_requests_pkey PRIMARY KEY (id);


--
-- Name: resturant_abouts resturant_abouts_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.resturant_abouts
    ADD CONSTRAINT resturant_abouts_pkey PRIMARY KEY (id);


--
-- Name: resturant_blogs resturant_blogs_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.resturant_blogs
    ADD CONSTRAINT resturant_blogs_pkey PRIMARY KEY (id);


--
-- Name: resturant_cart_check_styles resturant_cart_check_styles_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.resturant_cart_check_styles
    ADD CONSTRAINT resturant_cart_check_styles_pkey PRIMARY KEY (id);


--
-- Name: resturant_carts resturant_carts_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.resturant_carts
    ADD CONSTRAINT resturant_carts_pkey PRIMARY KEY (id);


--
-- Name: resturant_cupon_codes resturant_cupon_codes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.resturant_cupon_codes
    ADD CONSTRAINT resturant_cupon_codes_pkey PRIMARY KEY (id);


--
-- Name: resturant_galleries resturant_galleries_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.resturant_galleries
    ADD CONSTRAINT resturant_galleries_pkey PRIMARY KEY (id);


--
-- Name: resturant_homes resturant_homes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.resturant_homes
    ADD CONSTRAINT resturant_homes_pkey PRIMARY KEY (id);


--
-- Name: resturant_index_style_i_i_s resturant_index_style_i_i_s_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.resturant_index_style_i_i_s
    ADD CONSTRAINT resturant_index_style_i_i_s_pkey PRIMARY KEY (id);


--
-- Name: resturant_index_style_i_s resturant_index_style_i_s_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.resturant_index_style_i_s
    ADD CONSTRAINT resturant_index_style_i_s_pkey PRIMARY KEY (id);


--
-- Name: resturant_menu_styles resturant_menu_styles_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.resturant_menu_styles
    ADD CONSTRAINT resturant_menu_styles_pkey PRIMARY KEY (id);


--
-- Name: resturant_nav_foot_styles resturant_nav_foot_styles_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.resturant_nav_foot_styles
    ADD CONSTRAINT resturant_nav_foot_styles_pkey PRIMARY KEY (id);


--
-- Name: resturant_privacies resturant_privacies_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.resturant_privacies
    ADD CONSTRAINT resturant_privacies_pkey PRIMARY KEY (id);


--
-- Name: resturant_reservations resturant_reservations_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.resturant_reservations
    ADD CONSTRAINT resturant_reservations_pkey PRIMARY KEY (id);


--
-- Name: resturant_reviews resturant_reviews_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.resturant_reviews
    ADD CONSTRAINT resturant_reviews_pkey PRIMARY KEY (id);


--
-- Name: resturant_sliders resturant_sliders_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.resturant_sliders
    ADD CONSTRAINT resturant_sliders_pkey PRIMARY KEY (id);


--
-- Name: resturant_socials resturant_socials_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.resturant_socials
    ADD CONSTRAINT resturant_socials_pkey PRIMARY KEY (id);


--
-- Name: resturant_styles resturant_styles_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.resturant_styles
    ADD CONSTRAINT resturant_styles_pkey PRIMARY KEY (id);


--
-- Name: resturant_sup_page_styles resturant_sup_page_styles_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.resturant_sup_page_styles
    ADD CONSTRAINT resturant_sup_page_styles_pkey PRIMARY KEY (id);


--
-- Name: resturant_tables resturant_tables_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.resturant_tables
    ADD CONSTRAINT resturant_tables_pkey PRIMARY KEY (id);


--
-- Name: resturant_terms resturant_terms_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.resturant_terms
    ADD CONSTRAINT resturant_terms_pkey PRIMARY KEY (id);


--
-- Name: resturant_video_sections resturant_video_sections_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.resturant_video_sections
    ADD CONSTRAINT resturant_video_sections_pkey PRIMARY KEY (id);


--
-- Name: return_maintaince_bills return_maintaince_bills_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_maintaince_bills
    ADD CONSTRAINT return_maintaince_bills_pkey PRIMARY KEY (id);


--
-- Name: return_products_stores_transfers return_products_stores_transfers_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_products_stores_transfers
    ADD CONSTRAINT return_products_stores_transfers_pkey PRIMARY KEY (id);


--
-- Name: return_purch_bills_filter_twos return_purch_bills_filter_twos_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_purch_bills_filter_twos
    ADD CONSTRAINT return_purch_bills_filter_twos_pkey PRIMARY KEY (id);


--
-- Name: return_purch_bills_filters return_purch_bills_filters_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_purch_bills_filters
    ADD CONSTRAINT return_purch_bills_filters_pkey PRIMARY KEY (id);


--
-- Name: return_purch_products return_purch_products_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_purch_products
    ADD CONSTRAINT return_purch_products_pkey PRIMARY KEY (id);


--
-- Name: return_purches return_purches_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_purches
    ADD CONSTRAINT return_purches_pkey PRIMARY KEY (id);


--
-- Name: return_resons return_resons_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_resons
    ADD CONSTRAINT return_resons_pkey PRIMARY KEY (id);


--
-- Name: return_sales_bills_filter_twos return_sales_bills_filter_twos_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_sales_bills_filter_twos
    ADD CONSTRAINT return_sales_bills_filter_twos_pkey PRIMARY KEY (id);


--
-- Name: return_sales_bills_filters return_sales_bills_filters_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_sales_bills_filters
    ADD CONSTRAINT return_sales_bills_filters_pkey PRIMARY KEY (id);


--
-- Name: return_sales return_sales_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_sales
    ADD CONSTRAINT return_sales_pkey PRIMARY KEY (id);


--
-- Name: return_sales_products return_sales_products_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_sales_products
    ADD CONSTRAINT return_sales_products_pkey PRIMARY KEY (id);


--
-- Name: return_stors_transfers return_stors_transfers_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_stors_transfers
    ADD CONSTRAINT return_stors_transfers_pkey PRIMARY KEY (id);


--
-- Name: return_without_bills return_without_bills_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_without_bills
    ADD CONSTRAINT return_without_bills_pkey PRIMARY KEY (id);


--
-- Name: role_has_permissions role_has_permissions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.role_has_permissions
    ADD CONSTRAINT role_has_permissions_pkey PRIMARY KEY (permission_id, role_id);


--
-- Name: roles roles_name_guard_name_unique; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.roles
    ADD CONSTRAINT roles_name_guard_name_unique UNIQUE (name, guard_name);


--
-- Name: roles roles_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.roles
    ADD CONSTRAINT roles_pkey PRIMARY KEY (id);


--
-- Name: room_reservations room_reservations_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.room_reservations
    ADD CONSTRAINT room_reservations_pkey PRIMARY KEY (id);


--
-- Name: rooms rooms_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.rooms
    ADD CONSTRAINT rooms_pkey PRIMARY KEY (id);


--
-- Name: rooms_types rooms_types_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.rooms_types
    ADD CONSTRAINT rooms_types_pkey PRIMARY KEY (id);


--
-- Name: rqst_transports rqst_transports_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.rqst_transports
    ADD CONSTRAINT rqst_transports_pkey PRIMARY KEY (id);


--
-- Name: safe_transfer_columns safe_transfer_columns_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.safe_transfer_columns
    ADD CONSTRAINT safe_transfer_columns_pkey PRIMARY KEY (id);


--
-- Name: safe_transfer_columns_sechdules safe_transfer_columns_sechdules_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.safe_transfer_columns_sechdules
    ADD CONSTRAINT safe_transfer_columns_sechdules_pkey PRIMARY KEY (id);


--
-- Name: safe_transfer_filter_twos safe_transfer_filter_twos_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.safe_transfer_filter_twos
    ADD CONSTRAINT safe_transfer_filter_twos_pkey PRIMARY KEY (id);


--
-- Name: safe_transfer_filters safe_transfer_filters_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.safe_transfer_filters
    ADD CONSTRAINT safe_transfer_filters_pkey PRIMARY KEY (id);


--
-- Name: safe_transfers safe_transfers_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.safe_transfers
    ADD CONSTRAINT safe_transfers_pkey PRIMARY KEY (id);


--
-- Name: safes_banks safes_banks_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.safes_banks
    ADD CONSTRAINT safes_banks_pkey PRIMARY KEY (id);


--
-- Name: sales_bills_columns sales_bills_columns_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales_bills_columns
    ADD CONSTRAINT sales_bills_columns_pkey PRIMARY KEY (id);


--
-- Name: sales_bills_columns_sechdules sales_bills_columns_sechdules_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales_bills_columns_sechdules
    ADD CONSTRAINT sales_bills_columns_sechdules_pkey PRIMARY KEY (id);


--
-- Name: sales_bills_filter_twos sales_bills_filter_twos_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales_bills_filter_twos
    ADD CONSTRAINT sales_bills_filter_twos_pkey PRIMARY KEY (id);


--
-- Name: sales_bills_filters sales_bills_filters_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales_bills_filters
    ADD CONSTRAINT sales_bills_filters_pkey PRIMARY KEY (id);


--
-- Name: sales_contracts sales_contracts_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales_contracts
    ADD CONSTRAINT sales_contracts_pkey PRIMARY KEY (id);


--
-- Name: sales_default_data sales_default_data_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales_default_data
    ADD CONSTRAINT sales_default_data_pkey PRIMARY KEY (id);


--
-- Name: sales_fifo_qties sales_fifo_qties_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales_fifo_qties
    ADD CONSTRAINT sales_fifo_qties_pkey PRIMARY KEY (id);


--
-- Name: sales_gifts sales_gifts_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales_gifts
    ADD CONSTRAINT sales_gifts_pkey PRIMARY KEY (id);


--
-- Name: sales_maint_fifo_qties sales_maint_fifo_qties_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales_maint_fifo_qties
    ADD CONSTRAINT sales_maint_fifo_qties_pkey PRIMARY KEY (id);


--
-- Name: sales_orders sales_orders_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales_orders
    ADD CONSTRAINT sales_orders_pkey PRIMARY KEY (id);


--
-- Name: sales_petrols sales_petrols_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales_petrols
    ADD CONSTRAINT sales_petrols_pkey PRIMARY KEY (id);


--
-- Name: sales sales_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales
    ADD CONSTRAINT sales_pkey PRIMARY KEY (id);


--
-- Name: sales_subscribes sales_subscribes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales_subscribes
    ADD CONSTRAINT sales_subscribes_pkey PRIMARY KEY (id);


--
-- Name: scientific_materials scientific_materials_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.scientific_materials
    ADD CONSTRAINT scientific_materials_pkey PRIMARY KEY (id);


--
-- Name: secretariat_export_goods secretariat_export_goods_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.secretariat_export_goods
    ADD CONSTRAINT secretariat_export_goods_pkey PRIMARY KEY (id);


--
-- Name: secretariat_import_goods secretariat_import_goods_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.secretariat_import_goods
    ADD CONSTRAINT secretariat_import_goods_pkey PRIMARY KEY (id);


--
-- Name: secretariat_qties secretariat_qties_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.secretariat_qties
    ADD CONSTRAINT secretariat_qties_pkey PRIMARY KEY (id);


--
-- Name: secretariat_stores secretariat_stores_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.secretariat_stores
    ADD CONSTRAINT secretariat_stores_pkey PRIMARY KEY (id);


--
-- Name: select_a_p_i_s select_a_p_i_s_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.select_a_p_i_s
    ADD CONSTRAINT select_a_p_i_s_pkey PRIMARY KEY (id);


--
-- Name: server_d_b_s server_d_b_s_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.server_d_b_s
    ADD CONSTRAINT server_d_b_s_pkey PRIMARY KEY (id);


--
-- Name: services_reals services_reals_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.services_reals
    ADD CONSTRAINT services_reals_pkey PRIMARY KEY (id);


--
-- Name: settlements settlements_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.settlements
    ADD CONSTRAINT settlements_pkey PRIMARY KEY (id);


--
-- Name: sewing_accessories sewing_accessories_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_accessories
    ADD CONSTRAINT sewing_accessories_pkey PRIMARY KEY (id);


--
-- Name: sewing_al_kabkat sewing_al_kabkat_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_al_kabkat
    ADD CONSTRAINT sewing_al_kabkat_pkey PRIMARY KEY (id);


--
-- Name: sewing_al_taktak sewing_al_taktak_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_al_taktak
    ADD CONSTRAINT sewing_al_taktak_pkey PRIMARY KEY (id);


--
-- Name: sewing_buttons sewing_buttons_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_buttons
    ADD CONSTRAINT sewing_buttons_pkey PRIMARY KEY (id);


--
-- Name: sewing_chest_pocket_fillings sewing_chest_pocket_fillings_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_chest_pocket_fillings
    ADD CONSTRAINT sewing_chest_pocket_fillings_pkey PRIMARY KEY (id);


--
-- Name: sewing_chest_pockets sewing_chest_pockets_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_chest_pockets
    ADD CONSTRAINT sewing_chest_pockets_pkey PRIMARY KEY (id);


--
-- Name: sewing_collar_paddings sewing_collar_paddings_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_collar_paddings
    ADD CONSTRAINT sewing_collar_paddings_pkey PRIMARY KEY (id);


--
-- Name: sewing_collars sewing_collars_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_collars
    ADD CONSTRAINT sewing_collars_pkey PRIMARY KEY (id);


--
-- Name: sewing_cseed_sleeves sewing_cseed_sleeves_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_cseed_sleeves
    ADD CONSTRAINT sewing_cseed_sleeves_pkey PRIMARY KEY (id);


--
-- Name: sewing_cupcake_fillings sewing_cupcake_fillings_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_cupcake_fillings
    ADD CONSTRAINT sewing_cupcake_fillings_pkey PRIMARY KEY (id);


--
-- Name: sewing_embroideries sewing_embroideries_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_embroideries
    ADD CONSTRAINT sewing_embroideries_pkey PRIMARY KEY (id);


--
-- Name: sewing_order_modules sewing_order_modules_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_order_modules
    ADD CONSTRAINT sewing_order_modules_pkey PRIMARY KEY (id);


--
-- Name: sewing_orders sewing_orders_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_orders
    ADD CONSTRAINT sewing_orders_pkey PRIMARY KEY (id);


--
-- Name: sewing_request_details sewing_request_details_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_request_details
    ADD CONSTRAINT sewing_request_details_pkey PRIMARY KEY (id);


--
-- Name: sewing_requests sewing_requests_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_requests
    ADD CONSTRAINT sewing_requests_pkey PRIMARY KEY (id);


--
-- Name: sewing_seed_fillings sewing_seed_fillings_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_seed_fillings
    ADD CONSTRAINT sewing_seed_fillings_pkey PRIMARY KEY (id);


--
-- Name: sewing_seeds sewing_seeds_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_seeds
    ADD CONSTRAINT sewing_seeds_pkey PRIMARY KEY (id);


--
-- Name: sewing_side_pockets sewing_side_pockets_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_side_pockets
    ADD CONSTRAINT sewing_side_pockets_pkey PRIMARY KEY (id);


--
-- Name: sewing_sleeves sewing_sleeves_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_sleeves
    ADD CONSTRAINT sewing_sleeves_pkey PRIMARY KEY (id);


--
-- Name: sewing_types sewing_types_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_types
    ADD CONSTRAINT sewing_types_pkey PRIMARY KEY (id);


--
-- Name: shifts shifts_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.shifts
    ADD CONSTRAINT shifts_pkey PRIMARY KEY (id);


--
-- Name: shipment_moves shipment_moves_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.shipment_moves
    ADD CONSTRAINT shipment_moves_pkey PRIMARY KEY (id);


--
-- Name: shipment_receipts_clients shipment_receipts_clients_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.shipment_receipts_clients
    ADD CONSTRAINT shipment_receipts_clients_pkey PRIMARY KEY (id);


--
-- Name: shipment_receipts_lists shipment_receipts_lists_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.shipment_receipts_lists
    ADD CONSTRAINT shipment_receipts_lists_pkey PRIMARY KEY (id);


--
-- Name: shipment_receipts shipment_receipts_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.shipment_receipts
    ADD CONSTRAINT shipment_receipts_pkey PRIMARY KEY (id);


--
-- Name: shipment_requests shipment_requests_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.shipment_requests
    ADD CONSTRAINT shipment_requests_pkey PRIMARY KEY (id);


--
-- Name: shipments_distribution_goods shipments_distribution_goods_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.shipments_distribution_goods
    ADD CONSTRAINT shipments_distribution_goods_pkey PRIMARY KEY (id);


--
-- Name: shipments_distribution_workers shipments_distribution_workers_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.shipments_distribution_workers
    ADD CONSTRAINT shipments_distribution_workers_pkey PRIMARY KEY (id);


--
-- Name: shipments_distributions shipments_distributions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.shipments_distributions
    ADD CONSTRAINT shipments_distributions_pkey PRIMARY KEY (id);


--
-- Name: shipments shipments_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.shipments
    ADD CONSTRAINT shipments_pkey PRIMARY KEY (id);


--
-- Name: shipping_companies shipping_companies_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.shipping_companies
    ADD CONSTRAINT shipping_companies_pkey PRIMARY KEY (id);


--
-- Name: shipping_defaults shipping_defaults_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.shipping_defaults
    ADD CONSTRAINT shipping_defaults_pkey PRIMARY KEY (id);


--
-- Name: shipping_list_tickets shipping_list_tickets_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.shipping_list_tickets
    ADD CONSTRAINT shipping_list_tickets_pkey PRIMARY KEY (id);


--
-- Name: shipping_lists shipping_lists_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.shipping_lists
    ADD CONSTRAINT shipping_lists_pkey PRIMARY KEY (id);


--
-- Name: shipping_orders shipping_orders_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.shipping_orders
    ADD CONSTRAINT shipping_orders_pkey PRIMARY KEY (id);


--
-- Name: shipping_prices shipping_prices_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.shipping_prices
    ADD CONSTRAINT shipping_prices_pkey PRIMARY KEY (id);


--
-- Name: shipping_statuses shipping_statuses_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.shipping_statuses
    ADD CONSTRAINT shipping_statuses_pkey PRIMARY KEY (id);


--
-- Name: shipping_types shipping_types_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.shipping_types
    ADD CONSTRAINT shipping_types_pkey PRIMARY KEY (id);


--
-- Name: shippment_products shippment_products_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.shippment_products
    ADD CONSTRAINT shippment_products_pkey PRIMARY KEY (id);


--
-- Name: shortcomings shortcomings_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.shortcomings
    ADD CONSTRAINT shortcomings_pkey PRIMARY KEY (id);


--
-- Name: show_print_defaults show_print_defaults_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.show_print_defaults
    ADD CONSTRAINT show_print_defaults_pkey PRIMARY KEY (id);


--
-- Name: social_media social_media_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.social_media
    ADD CONSTRAINT social_media_pkey PRIMARY KEY (id);


--
-- Name: special_cases special_cases_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.special_cases
    ADD CONSTRAINT special_cases_pkey PRIMARY KEY (id);


--
-- Name: spend_profits spend_profits_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.spend_profits
    ADD CONSTRAINT spend_profits_pkey PRIMARY KEY (id);


--
-- Name: start_periods start_periods_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.start_periods
    ADD CONSTRAINT start_periods_pkey PRIMARY KEY (id);


--
-- Name: store_count_sales store_count_sales_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.store_count_sales
    ADD CONSTRAINT store_count_sales_pkey PRIMARY KEY (id);


--
-- Name: store_counts store_counts_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.store_counts
    ADD CONSTRAINT store_counts_pkey PRIMARY KEY (id);


--
-- Name: store_transfer_filter_twos store_transfer_filter_twos_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.store_transfer_filter_twos
    ADD CONSTRAINT store_transfer_filter_twos_pkey PRIMARY KEY (id);


--
-- Name: store_transfer_filters store_transfer_filters_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.store_transfer_filters
    ADD CONSTRAINT store_transfer_filters_pkey PRIMARY KEY (id);


--
-- Name: stores_default_data stores_default_data_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.stores_default_data
    ADD CONSTRAINT stores_default_data_pkey PRIMARY KEY (id);


--
-- Name: stores_moves_columns stores_moves_columns_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.stores_moves_columns
    ADD CONSTRAINT stores_moves_columns_pkey PRIMARY KEY (id);


--
-- Name: stores_moves_columns_sechdules stores_moves_columns_sechdules_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.stores_moves_columns_sechdules
    ADD CONSTRAINT stores_moves_columns_sechdules_pkey PRIMARY KEY (id);


--
-- Name: stores_moves_filter_twos stores_moves_filter_twos_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.stores_moves_filter_twos
    ADD CONSTRAINT stores_moves_filter_twos_pkey PRIMARY KEY (id);


--
-- Name: stores_moves_filters stores_moves_filters_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.stores_moves_filters
    ADD CONSTRAINT stores_moves_filters_pkey PRIMARY KEY (id);


--
-- Name: stores_moves stores_moves_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.stores_moves
    ADD CONSTRAINT stores_moves_pkey PRIMARY KEY (id);


--
-- Name: stores stores_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.stores
    ADD CONSTRAINT stores_pkey PRIMARY KEY (id);


--
-- Name: stores_transfer_columns stores_transfer_columns_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.stores_transfer_columns
    ADD CONSTRAINT stores_transfer_columns_pkey PRIMARY KEY (id);


--
-- Name: stores_transfer_columns_sechdules stores_transfer_columns_sechdules_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.stores_transfer_columns_sechdules
    ADD CONSTRAINT stores_transfer_columns_sechdules_pkey PRIMARY KEY (id);


--
-- Name: stors_transfers stors_transfers_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.stors_transfers
    ADD CONSTRAINT stors_transfers_pkey PRIMARY KEY (id);


--
-- Name: student_groups student_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.student_groups
    ADD CONSTRAINT student_groups_pkey PRIMARY KEY (id);


--
-- Name: student_importants student_importants_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.student_importants
    ADD CONSTRAINT student_importants_pkey PRIMARY KEY (id);


--
-- Name: students students_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.students
    ADD CONSTRAINT students_pkey PRIMARY KEY (id);


--
-- Name: sub_images sub_images_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sub_images
    ADD CONSTRAINT sub_images_pkey PRIMARY KEY (id);


--
-- Name: sub_virables sub_virables_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sub_virables
    ADD CONSTRAINT sub_virables_pkey PRIMARY KEY (id);


--
-- Name: subscribe_types subscribe_types_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.subscribe_types
    ADD CONSTRAINT subscribe_types_pkey PRIMARY KEY (id);


--
-- Name: sup_pages_e_com_designs sup_pages_e_com_designs_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sup_pages_e_com_designs
    ADD CONSTRAINT sup_pages_e_com_designs_pkey PRIMARY KEY (id);


--
-- Name: sup_pages_part_two_e_com_designs sup_pages_part_two_e_com_designs_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sup_pages_part_two_e_com_designs
    ADD CONSTRAINT sup_pages_part_two_e_com_designs_pkey PRIMARY KEY (id);


--
-- Name: sup_pages_wish_comp_e_com_designs sup_pages_wish_comp_e_com_designs_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sup_pages_wish_comp_e_com_designs
    ADD CONSTRAINT sup_pages_wish_comp_e_com_designs_pkey PRIMARY KEY (id);


--
-- Name: taxes taxes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.taxes
    ADD CONSTRAINT taxes_pkey PRIMARY KEY (id);


--
-- Name: teachers_groups teachers_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.teachers_groups
    ADD CONSTRAINT teachers_groups_pkey PRIMARY KEY (id);


--
-- Name: teachers teachers_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.teachers
    ADD CONSTRAINT teachers_pkey PRIMARY KEY (id);


--
-- Name: teachers_subjects teachers_subjects_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.teachers_subjects
    ADD CONSTRAINT teachers_subjects_pkey PRIMARY KEY (id);


--
-- Name: tenants tenants_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.tenants
    ADD CONSTRAINT tenants_pkey PRIMARY KEY (id);


--
-- Name: terms_maintainces terms_maintainces_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.terms_maintainces
    ADD CONSTRAINT terms_maintainces_pkey PRIMARY KEY (id);


--
-- Name: terms terms_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.terms
    ADD CONSTRAINT terms_pkey PRIMARY KEY (id);


--
-- Name: testclients testclients_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.testclients
    ADD CONSTRAINT testclients_pkey PRIMARY KEY (id);


--
-- Name: ticekt_issues ticekt_issues_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.ticekt_issues
    ADD CONSTRAINT ticekt_issues_pkey PRIMARY KEY (id);


--
-- Name: ticket_products ticket_products_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.ticket_products
    ADD CONSTRAINT ticket_products_pkey PRIMARY KEY (id);


--
-- Name: tickets tickets_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.tickets
    ADD CONSTRAINT tickets_pkey PRIMARY KEY (id);


--
-- Name: translation_tourism_companies translation_tourism_companies_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.translation_tourism_companies
    ADD CONSTRAINT translation_tourism_companies_pkey PRIMARY KEY (id);


--
-- Name: translte_modules_details translte_modules_details_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.translte_modules_details
    ADD CONSTRAINT translte_modules_details_pkey PRIMARY KEY (id);


--
-- Name: translte_modules translte_modules_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.translte_modules
    ADD CONSTRAINT translte_modules_pkey PRIMARY KEY (id);


--
-- Name: transltors transltors_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.transltors
    ADD CONSTRAINT transltors_pkey PRIMARY KEY (id);


--
-- Name: transport_contractors transport_contractors_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.transport_contractors
    ADD CONSTRAINT transport_contractors_pkey PRIMARY KEY (id);


--
-- Name: transport_permit_details transport_permit_details_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.transport_permit_details
    ADD CONSTRAINT transport_permit_details_pkey PRIMARY KEY (id);


--
-- Name: transport_permits transport_permits_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.transport_permits
    ADD CONSTRAINT transport_permits_pkey PRIMARY KEY (id);


--
-- Name: transport_prices transport_prices_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.transport_prices
    ADD CONSTRAINT transport_prices_pkey PRIMARY KEY (id);


--
-- Name: transport_receivers transport_receivers_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.transport_receivers
    ADD CONSTRAINT transport_receivers_pkey PRIMARY KEY (id);


--
-- Name: transports transports_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.transports
    ADD CONSTRAINT transports_pkey PRIMARY KEY (id);


--
-- Name: unloading_shipments_goods unloading_shipments_goods_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.unloading_shipments_goods
    ADD CONSTRAINT unloading_shipments_goods_pkey PRIMARY KEY (id);


--
-- Name: unloading_shipments unloading_shipments_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.unloading_shipments
    ADD CONSTRAINT unloading_shipments_pkey PRIMARY KEY (id);


--
-- Name: unloading_shipments_workers unloading_shipments_workers_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.unloading_shipments_workers
    ADD CONSTRAINT unloading_shipments_workers_pkey PRIMARY KEY (id);


--
-- Name: update_values_investors update_values_investors_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.update_values_investors
    ADD CONSTRAINT update_values_investors_pkey PRIMARY KEY (id);


--
-- Name: upload_accountings upload_accountings_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.upload_accountings
    ADD CONSTRAINT upload_accountings_pkey PRIMARY KEY (id);


--
-- Name: users_moves users_moves_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.users_moves
    ADD CONSTRAINT users_moves_pkey PRIMARY KEY (id);


--
-- Name: v_a_prices v_a_prices_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.v_a_prices
    ADD CONSTRAINT v_a_prices_pkey PRIMARY KEY (id);


--
-- Name: v_a_products v_a_products_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.v_a_products
    ADD CONSTRAINT v_a_products_pkey PRIMARY KEY (id);


--
-- Name: v_a_qties v_a_qties_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.v_a_qties
    ADD CONSTRAINT v_a_qties_pkey PRIMARY KEY (id);


--
-- Name: vendor_account_statement_column_sechdules vendor_account_statement_column_sechdules_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.vendor_account_statement_column_sechdules
    ADD CONSTRAINT vendor_account_statement_column_sechdules_pkey PRIMARY KEY (id);


--
-- Name: vendor_account_statement_columns vendor_account_statement_columns_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.vendor_account_statement_columns
    ADD CONSTRAINT vendor_account_statement_columns_pkey PRIMARY KEY (id);


--
-- Name: vendor_filters vendor_filters_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.vendor_filters
    ADD CONSTRAINT vendor_filters_pkey PRIMARY KEY (id);


--
-- Name: vendor_products vendor_products_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.vendor_products
    ADD CONSTRAINT vendor_products_pkey PRIMARY KEY (id);


--
-- Name: vendors vendors_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.vendors
    ADD CONSTRAINT vendors_pkey PRIMARY KEY (id);


--
-- Name: vendors_statements_column_sechdules vendors_statements_column_sechdules_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.vendors_statements_column_sechdules
    ADD CONSTRAINT vendors_statements_column_sechdules_pkey PRIMARY KEY (id);


--
-- Name: vendors_statements_columns vendors_statements_columns_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.vendors_statements_columns
    ADD CONSTRAINT vendors_statements_columns_pkey PRIMARY KEY (id);


--
-- Name: virables virables_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.virables
    ADD CONSTRAINT virables_pkey PRIMARY KEY (id);


--
-- Name: vouchers vouchers_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.vouchers
    ADD CONSTRAINT vouchers_pkey PRIMARY KEY (id);


--
-- Name: web_sliders web_sliders_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.web_sliders
    ADD CONSTRAINT web_sliders_pkey PRIMARY KEY (id);


--
-- Name: wishlists wishlists_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.wishlists
    ADD CONSTRAINT wishlists_pkey PRIMARY KEY (id);


--
-- Name: work_departments work_departments_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.work_departments
    ADD CONSTRAINT work_departments_pkey PRIMARY KEY (id);


--
-- Name: workers_sales_petrols workers_sales_petrols_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.workers_sales_petrols
    ADD CONSTRAINT workers_sales_petrols_pkey PRIMARY KEY (id);


--
-- Name: zkteco_devices zkteco_devices_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.zkteco_devices
    ADD CONSTRAINT zkteco_devices_pkey PRIMARY KEY (id);


--
-- Name: firewall_ips_ip_index; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX firewall_ips_ip_index ON public.firewall_ips USING btree (ip);


--
-- Name: firewall_logs_ip_index; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX firewall_logs_ip_index ON public.firewall_logs USING btree (ip);


--
-- Name: jobs_queue_index; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX jobs_queue_index ON public.jobs USING btree (queue);


--
-- Name: model_has_permissions_model_id_model_type_index; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX model_has_permissions_model_id_model_type_index ON public.model_has_permissions USING btree (model_id, model_type);


--
-- Name: model_has_roles_model_id_model_type_index; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX model_has_roles_model_id_model_type_index ON public.model_has_roles USING btree (model_id, model_type);


--
-- Name: password_resets_email_index; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX password_resets_email_index ON public.password_resets USING btree (email);


--
-- Name: acccounting_manuals acccounting_manuals_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.acccounting_manuals
    ADD CONSTRAINT acccounting_manuals_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: accounts_default_data accounts_default_data_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.accounts_default_data
    ADD CONSTRAINT accounts_default_data_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: addressses addressses_city_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.addressses
    ADD CONSTRAINT addressses_city_foreign FOREIGN KEY ("City") REFERENCES public.cities(id) ON DELETE CASCADE;


--
-- Name: addressses addressses_governrate_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.addressses
    ADD CONSTRAINT addressses_governrate_foreign FOREIGN KEY ("Governrate") REFERENCES public.governrates(id) ON DELETE CASCADE;


--
-- Name: assembly_products assembly_products_p_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.assembly_products
    ADD CONSTRAINT assembly_products_p_id_foreign FOREIGN KEY (p_id) REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: assembly_products assembly_products_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.assembly_products
    ADD CONSTRAINT assembly_products_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: assembly_products assembly_products_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.assembly_products
    ADD CONSTRAINT assembly_products_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: assets assets_account_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.assets
    ADD CONSTRAINT assets_account_foreign FOREIGN KEY ("Account") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: assets assets_depreciation_complex_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.assets
    ADD CONSTRAINT assets_depreciation_complex_foreign FOREIGN KEY ("Depreciation_Complex") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: assets assets_depreciation_expenses_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.assets
    ADD CONSTRAINT assets_depreciation_expenses_foreign FOREIGN KEY ("Depreciation_Expenses") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: assets_expenses assets_expenses_asset_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.assets_expenses
    ADD CONSTRAINT assets_expenses_asset_foreign FOREIGN KEY ("Asset") REFERENCES public.assets(id) ON DELETE CASCADE;


--
-- Name: assets_expenses assets_expenses_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.assets_expenses
    ADD CONSTRAINT assets_expenses_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: assets_expenses assets_expenses_cost_center_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.assets_expenses
    ADD CONSTRAINT assets_expenses_cost_center_foreign FOREIGN KEY ("Cost_Center") REFERENCES public.cost_centers(id) ON DELETE CASCADE;


--
-- Name: assets_expenses assets_expenses_safe_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.assets_expenses
    ADD CONSTRAINT assets_expenses_safe_foreign FOREIGN KEY ("Safe") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: assets_expenses assets_expenses_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.assets_expenses
    ADD CONSTRAINT assets_expenses_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: assets assets_main_account_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.assets
    ADD CONSTRAINT assets_main_account_foreign FOREIGN KEY ("Main_Account") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: assets assets_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.assets
    ADD CONSTRAINT assets_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: attendance_emps attendance_emps_attend_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.attendance_emps
    ADD CONSTRAINT attendance_emps_attend_foreign FOREIGN KEY ("Attend") REFERENCES public.attendances(id) ON DELETE CASCADE;


--
-- Name: attendance_emps attendance_emps_emp_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.attendance_emps
    ADD CONSTRAINT attendance_emps_emp_foreign FOREIGN KEY ("Emp") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: attendances attendances_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.attendances
    ADD CONSTRAINT attendances_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: barcode_products barcode_products_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.barcode_products
    ADD CONSTRAINT barcode_products_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: barcode_products barcode_products_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.barcode_products
    ADD CONSTRAINT barcode_products_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: barcode_products barcode_products_v1_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.barcode_products
    ADD CONSTRAINT barcode_products_v1_foreign FOREIGN KEY ("V1") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: barcode_products barcode_products_v2_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.barcode_products
    ADD CONSTRAINT barcode_products_v2_foreign FOREIGN KEY ("V2") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: bones_sales_petrols bones_sales_petrols_salespetrol_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.bones_sales_petrols
    ADD CONSTRAINT bones_sales_petrols_salespetrol_foreign FOREIGN KEY ("SalesPetrol") REFERENCES public.sales_petrols(id) ON DELETE CASCADE;


--
-- Name: bones_types bones_types_account_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.bones_types
    ADD CONSTRAINT bones_types_account_foreign FOREIGN KEY ("Account") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: borrowas borrowas_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.borrowas
    ADD CONSTRAINT borrowas_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: borrowas borrowas_cost_center_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.borrowas
    ADD CONSTRAINT borrowas_cost_center_foreign FOREIGN KEY ("Cost_Center") REFERENCES public.cost_centers(id) ON DELETE CASCADE;


--
-- Name: borrowas borrowas_emp_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.borrowas
    ADD CONSTRAINT borrowas_emp_foreign FOREIGN KEY ("Emp") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: borrowas borrowas_safe_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.borrowas
    ADD CONSTRAINT borrowas_safe_foreign FOREIGN KEY ("Safe") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: borrowas borrowas_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.borrowas
    ADD CONSTRAINT borrowas_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: campaigns campaigns_platform_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.campaigns
    ADD CONSTRAINT campaigns_platform_foreign FOREIGN KEY ("Platform") REFERENCES public.platforms(id) ON DELETE CASCADE;


--
-- Name: cars_sales_petrols cars_sales_petrols_salespetrol_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.cars_sales_petrols
    ADD CONSTRAINT cars_sales_petrols_salespetrol_foreign FOREIGN KEY ("SalesPetrol") REFERENCES public.sales_petrols(id) ON DELETE CASCADE;


--
-- Name: cities cities_gov_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.cities
    ADD CONSTRAINT cities_gov_foreign FOREIGN KEY ("Gov") REFERENCES public.governrates(id) ON DELETE CASCADE;


--
-- Name: client_sales_petrols client_sales_petrols_salespetrol_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.client_sales_petrols
    ADD CONSTRAINT client_sales_petrols_salespetrol_foreign FOREIGN KEY ("SalesPetrol") REFERENCES public.sales_petrols(id) ON DELETE CASCADE;


--
-- Name: comments comments_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.comments
    ADD CONSTRAINT comments_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: comments comments_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.comments
    ADD CONSTRAINT comments_user_foreign FOREIGN KEY ("User") REFERENCES public.customers(id) ON DELETE CASCADE;


--
-- Name: company_cars company_cars_account_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.company_cars
    ADD CONSTRAINT company_cars_account_foreign FOREIGN KEY ("Account") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: compares compares_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.compares
    ADD CONSTRAINT compares_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: compares compares_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.compares
    ADD CONSTRAINT compares_user_foreign FOREIGN KEY ("User") REFERENCES public.customers(id) ON DELETE CASCADE;


--
-- Name: consists consists_account_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.consists
    ADD CONSTRAINT consists_account_foreign FOREIGN KEY ("Account") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: consists consists_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.consists
    ADD CONSTRAINT consists_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: consists consists_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.consists
    ADD CONSTRAINT consists_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: consists consists_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.consists
    ADD CONSTRAINT consists_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: counters_types counters_types_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.counters_types
    ADD CONSTRAINT counters_types_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: counters_types counters_types_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.counters_types
    ADD CONSTRAINT counters_types_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: crm_default_data crm_default_data_activity_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.crm_default_data
    ADD CONSTRAINT crm_default_data_activity_foreign FOREIGN KEY ("Activity") REFERENCES public.activites(id) ON DELETE CASCADE;


--
-- Name: crm_default_data crm_default_data_campagin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.crm_default_data
    ADD CONSTRAINT crm_default_data_campagin_foreign FOREIGN KEY ("Campagin") REFERENCES public.campaigns(id) ON DELETE CASCADE;


--
-- Name: crm_default_data crm_default_data_city_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.crm_default_data
    ADD CONSTRAINT crm_default_data_city_foreign FOREIGN KEY ("City") REFERENCES public.cities(id) ON DELETE CASCADE;


--
-- Name: crm_default_data crm_default_data_clientstatus_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.crm_default_data
    ADD CONSTRAINT crm_default_data_clientstatus_foreign FOREIGN KEY ("ClientStatus") REFERENCES public.client_statuses(id) ON DELETE CASCADE;


--
-- Name: crm_default_data crm_default_data_governrate_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.crm_default_data
    ADD CONSTRAINT crm_default_data_governrate_foreign FOREIGN KEY ("Governrate") REFERENCES public.governrates(id) ON DELETE CASCADE;


--
-- Name: crm_default_data crm_default_data_platforms_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.crm_default_data
    ADD CONSTRAINT crm_default_data_platforms_foreign FOREIGN KEY ("Platforms") REFERENCES public.platforms(id) ON DELETE CASCADE;


--
-- Name: crm_default_data crm_default_data_responsible_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.crm_default_data
    ADD CONSTRAINT crm_default_data_responsible_foreign FOREIGN KEY ("Responsible") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: customer_comments_products customer_comments_products_comment_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.customer_comments_products
    ADD CONSTRAINT customer_comments_products_comment_foreign FOREIGN KEY ("Comment") REFERENCES public.comments_clients(id) ON DELETE CASCADE;


--
-- Name: customer_comments_products customer_comments_products_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.customer_comments_products
    ADD CONSTRAINT customer_comments_products_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: customer_sizes customer_sizes_customers_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.customer_sizes
    ADD CONSTRAINT customer_sizes_customers_id_foreign FOREIGN KEY ("Customers_ID") REFERENCES public.customers(id) ON DELETE CASCADE;


--
-- Name: customers customers_account_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.customers
    ADD CONSTRAINT customers_account_foreign FOREIGN KEY ("Account") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: customers customers_activity_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.customers
    ADD CONSTRAINT customers_activity_foreign FOREIGN KEY ("Activity") REFERENCES public.activites(id) ON DELETE CASCADE;


--
-- Name: customers customers_campagin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.customers
    ADD CONSTRAINT customers_campagin_foreign FOREIGN KEY ("Campagin") REFERENCES public.campaigns(id) ON DELETE CASCADE;


--
-- Name: customers customers_city_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.customers
    ADD CONSTRAINT customers_city_foreign FOREIGN KEY ("City") REFERENCES public.cities(id) ON DELETE CASCADE;


--
-- Name: customers customers_clientstatus_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.customers
    ADD CONSTRAINT customers_clientstatus_foreign FOREIGN KEY ("ClientStatus") REFERENCES public.client_statuses(id) ON DELETE CASCADE;


--
-- Name: customers_files customers_files_customer_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.customers_files
    ADD CONSTRAINT customers_files_customer_foreign FOREIGN KEY ("Customer") REFERENCES public.customers(id) ON DELETE CASCADE;


--
-- Name: customers customers_governrate_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.customers
    ADD CONSTRAINT customers_governrate_foreign FOREIGN KEY ("Governrate") REFERENCES public.governrates(id) ON DELETE CASCADE;


--
-- Name: customers customers_responsible_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.customers
    ADD CONSTRAINT customers_responsible_foreign FOREIGN KEY ("Responsible") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: customers_tickets customers_tickets_customer_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.customers_tickets
    ADD CONSTRAINT customers_tickets_customer_foreign FOREIGN KEY ("Customer") REFERENCES public.customers(id) ON DELETE CASCADE;


--
-- Name: customers_tickets customers_tickets_responsible_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.customers_tickets
    ADD CONSTRAINT customers_tickets_responsible_foreign FOREIGN KEY ("Responsible") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: customers_tickets customers_tickets_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.customers_tickets
    ADD CONSTRAINT customers_tickets_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: customers customers_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.customers
    ADD CONSTRAINT customers_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: deductions deductions_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.deductions
    ADD CONSTRAINT deductions_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: deductions deductions_emp_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.deductions
    ADD CONSTRAINT deductions_emp_foreign FOREIGN KEY ("Emp") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: deductions deductions_type_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.deductions
    ADD CONSTRAINT deductions_type_foreign FOREIGN KEY ("Type") REFERENCES public.deducations_types(id) ON DELETE CASCADE;


--
-- Name: deductions deductions_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.deductions
    ADD CONSTRAINT deductions_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: default_sewing_orders default_sewing_orders_account_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.default_sewing_orders
    ADD CONSTRAINT default_sewing_orders_account_foreign FOREIGN KEY ("Account") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: default_sewing_orders default_sewing_orders_branch_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.default_sewing_orders
    ADD CONSTRAINT default_sewing_orders_branch_foreign FOREIGN KEY ("Branch") REFERENCES public.branches(id) ON DELETE CASCADE;


--
-- Name: default_sewing_orders default_sewing_orders_client_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.default_sewing_orders
    ADD CONSTRAINT default_sewing_orders_client_foreign FOREIGN KEY ("Client") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: default_sewing_orders default_sewing_orders_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.default_sewing_orders
    ADD CONSTRAINT default_sewing_orders_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: default_sewing_orders default_sewing_orders_cost_center_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.default_sewing_orders
    ADD CONSTRAINT default_sewing_orders_cost_center_foreign FOREIGN KEY ("Cost_Center") REFERENCES public.cost_centers(id) ON DELETE CASCADE;


--
-- Name: default_sewing_orders default_sewing_orders_delegate_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.default_sewing_orders
    ADD CONSTRAINT default_sewing_orders_delegate_foreign FOREIGN KEY ("Delegate") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: default_sewing_orders default_sewing_orders_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.default_sewing_orders
    ADD CONSTRAINT default_sewing_orders_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: default_sewing_orders default_sewing_orders_recivedbranch_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.default_sewing_orders
    ADD CONSTRAINT default_sewing_orders_recivedbranch_foreign FOREIGN KEY ("RecivedBranch") REFERENCES public.branches(id) ON DELETE CASCADE;


--
-- Name: default_sewing_orders default_sewing_orders_safe_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.default_sewing_orders
    ADD CONSTRAINT default_sewing_orders_safe_foreign FOREIGN KEY ("Safe") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: default_sewing_orders default_sewing_orders_sewingtype_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.default_sewing_orders
    ADD CONSTRAINT default_sewing_orders_sewingtype_foreign FOREIGN KEY ("SewingType") REFERENCES public.sewing_types(id) ON DELETE CASCADE;


--
-- Name: default_sewing_orders default_sewing_orders_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.default_sewing_orders
    ADD CONSTRAINT default_sewing_orders_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: departure_emps departure_emps_departure_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.departure_emps
    ADD CONSTRAINT departure_emps_departure_foreign FOREIGN KEY ("Departure") REFERENCES public.departures(id) ON DELETE CASCADE;


--
-- Name: departure_emps departure_emps_emp_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.departure_emps
    ADD CONSTRAINT departure_emps_emp_foreign FOREIGN KEY ("Emp") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: departures departures_attend_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.departures
    ADD CONSTRAINT departures_attend_foreign FOREIGN KEY ("Attend") REFERENCES public.attendances(id) ON DELETE CASCADE;


--
-- Name: departures departures_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.departures
    ADD CONSTRAINT departures_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: devices_typesies devices_typesies_company_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.devices_typesies
    ADD CONSTRAINT devices_typesies_company_foreign FOREIGN KEY ("Company") REFERENCES public.manufacture_companies(id) ON DELETE CASCADE;


--
-- Name: domains domains_tenant_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.domains
    ADD CONSTRAINT domains_tenant_id_foreign FOREIGN KEY (tenant_id) REFERENCES public.tenants(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: emp_installment_details emp_installment_details_emp_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.emp_installment_details
    ADD CONSTRAINT emp_installment_details_emp_foreign FOREIGN KEY ("Emp") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: emp_installment_details emp_installment_details_install_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.emp_installment_details
    ADD CONSTRAINT emp_installment_details_install_foreign FOREIGN KEY ("Install") REFERENCES public.emp_installments(id) ON DELETE CASCADE;


--
-- Name: emp_installments emp_installments_emp_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.emp_installments
    ADD CONSTRAINT emp_installments_emp_foreign FOREIGN KEY ("Emp") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: emp_installments emp_installments_loan_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.emp_installments
    ADD CONSTRAINT emp_installments_loan_foreign FOREIGN KEY ("Loan") REFERENCES public.loans(id) ON DELETE CASCADE;


--
-- Name: emp_p_o_s_stores emp_p_o_s_stores_emp_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.emp_p_o_s_stores
    ADD CONSTRAINT emp_p_o_s_stores_emp_foreign FOREIGN KEY ("Emp") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: emp_ratios emp_ratios_emp_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.emp_ratios
    ADD CONSTRAINT emp_ratios_emp_foreign FOREIGN KEY ("Emp") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: employesses employesses_account_emp_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.employesses
    ADD CONSTRAINT employesses_account_emp_foreign FOREIGN KEY ("Account_Emp") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: employesses employesses_account_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.employesses
    ADD CONSTRAINT employesses_account_foreign FOREIGN KEY ("Account") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: employesses employesses_department_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.employesses
    ADD CONSTRAINT employesses_department_foreign FOREIGN KEY ("Department") REFERENCES public.work_departments(id) ON DELETE CASCADE;


--
-- Name: employesses employesses_job_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.employesses
    ADD CONSTRAINT employesses_job_foreign FOREIGN KEY ("Job") REFERENCES public.jobs_types(id) ON DELETE CASCADE;


--
-- Name: employesses employesses_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.employesses
    ADD CONSTRAINT employesses_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: entitlements entitlements_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.entitlements
    ADD CONSTRAINT entitlements_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: entitlements entitlements_emp_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.entitlements
    ADD CONSTRAINT entitlements_emp_foreign FOREIGN KEY ("Emp") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: entitlements entitlements_type_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.entitlements
    ADD CONSTRAINT entitlements_type_foreign FOREIGN KEY ("Type") REFERENCES public.beneftis_types(id) ON DELETE CASCADE;


--
-- Name: entitlements entitlements_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.entitlements
    ADD CONSTRAINT entitlements_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: examinations_types examinations_types_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.examinations_types
    ADD CONSTRAINT examinations_types_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: exchange_commissions exchange_commissions_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.exchange_commissions
    ADD CONSTRAINT exchange_commissions_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: exchange_commissions exchange_commissions_cost_center_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.exchange_commissions
    ADD CONSTRAINT exchange_commissions_cost_center_foreign FOREIGN KEY ("Cost_Center") REFERENCES public.cost_centers(id) ON DELETE CASCADE;


--
-- Name: exchange_commissions exchange_commissions_emp_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.exchange_commissions
    ADD CONSTRAINT exchange_commissions_emp_foreign FOREIGN KEY ("Emp") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: exchange_commissions exchange_commissions_safe_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.exchange_commissions
    ADD CONSTRAINT exchange_commissions_safe_foreign FOREIGN KEY ("Safe") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: exchange_commissions exchange_commissions_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.exchange_commissions
    ADD CONSTRAINT exchange_commissions_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: execute_sewing_orders execute_sewing_orders_armport_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.execute_sewing_orders
    ADD CONSTRAINT execute_sewing_orders_armport_foreign FOREIGN KEY ("ArmPort") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: execute_sewing_orders execute_sewing_orders_client_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.execute_sewing_orders
    ADD CONSTRAINT execute_sewing_orders_client_foreign FOREIGN KEY ("Client") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: execute_sewing_orders execute_sewing_orders_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.execute_sewing_orders
    ADD CONSTRAINT execute_sewing_orders_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: execute_sewing_orders execute_sewing_orders_collaroutlet_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.execute_sewing_orders
    ADD CONSTRAINT execute_sewing_orders_collaroutlet_foreign FOREIGN KEY ("CollarOutlet") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: execute_sewing_orders execute_sewing_orders_complaintport_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.execute_sewing_orders
    ADD CONSTRAINT execute_sewing_orders_complaintport_foreign FOREIGN KEY ("ComplaintPort") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: execute_sewing_orders execute_sewing_orders_cutreferences_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.execute_sewing_orders
    ADD CONSTRAINT execute_sewing_orders_cutreferences_foreign FOREIGN KEY ("CutReferences") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: execute_sewing_orders execute_sewing_orders_dataentry_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.execute_sewing_orders
    ADD CONSTRAINT execute_sewing_orders_dataentry_foreign FOREIGN KEY ("DataEntry") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: execute_sewing_orders execute_sewing_orders_delivery_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.execute_sewing_orders
    ADD CONSTRAINT execute_sewing_orders_delivery_foreign FOREIGN KEY ("Delivery") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: execute_sewing_orders execute_sewing_orders_frontpocketport_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.execute_sewing_orders
    ADD CONSTRAINT execute_sewing_orders_frontpocketport_foreign FOREIGN KEY ("FrontPocketPort") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: execute_sewing_orders execute_sewing_orders_ironingport_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.execute_sewing_orders
    ADD CONSTRAINT execute_sewing_orders_ironingport_foreign FOREIGN KEY ("IroningPort") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: execute_sewing_orders execute_sewing_orders_measurementport_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.execute_sewing_orders
    ADD CONSTRAINT execute_sewing_orders_measurementport_foreign FOREIGN KEY ("MeasurementPort") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: execute_sewing_orders execute_sewing_orders_packagingport_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.execute_sewing_orders
    ADD CONSTRAINT execute_sewing_orders_packagingport_foreign FOREIGN KEY ("PackagingPort") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: execute_sewing_orders execute_sewing_orders_pocketport_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.execute_sewing_orders
    ADD CONSTRAINT execute_sewing_orders_pocketport_foreign FOREIGN KEY ("PocketPort") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: execute_sewing_orders execute_sewing_orders_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.execute_sewing_orders
    ADD CONSTRAINT execute_sewing_orders_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: execute_sewing_orders execute_sewing_orders_productionmanager_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.execute_sewing_orders
    ADD CONSTRAINT execute_sewing_orders_productionmanager_foreign FOREIGN KEY ("ProductionManager") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: execute_sewing_orders execute_sewing_orders_qualitycontroller_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.execute_sewing_orders
    ADD CONSTRAINT execute_sewing_orders_qualitycontroller_foreign FOREIGN KEY ("QualityController") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: execute_sewing_orders execute_sewing_orders_quantumport_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.execute_sewing_orders
    ADD CONSTRAINT execute_sewing_orders_quantumport_foreign FOREIGN KEY ("QuantumPort") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: execute_sewing_orders execute_sewing_orders_safe_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.execute_sewing_orders
    ADD CONSTRAINT execute_sewing_orders_safe_foreign FOREIGN KEY ("Safe") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: execute_sewing_orders execute_sewing_orders_seedfillingport_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.execute_sewing_orders
    ADD CONSTRAINT execute_sewing_orders_seedfillingport_foreign FOREIGN KEY ("SeedFillingPort") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: execute_sewing_orders execute_sewing_orders_sewingorder_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.execute_sewing_orders
    ADD CONSTRAINT execute_sewing_orders_sewingorder_foreign FOREIGN KEY ("SewingOrder") REFERENCES public.sewing_orders(id) ON DELETE CASCADE;


--
-- Name: execute_sewing_orders execute_sewing_orders_shearoutletassistant_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.execute_sewing_orders
    ADD CONSTRAINT execute_sewing_orders_shearoutletassistant_foreign FOREIGN KEY ("ShearOutletAssistant") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: execute_sewing_orders execute_sewing_orders_shearport_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.execute_sewing_orders
    ADD CONSTRAINT execute_sewing_orders_shearport_foreign FOREIGN KEY ("ShearPort") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: execute_sewing_orders execute_sewing_orders_shoulderport_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.execute_sewing_orders
    ADD CONSTRAINT execute_sewing_orders_shoulderport_foreign FOREIGN KEY ("ShoulderPort") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: execute_sewing_orders execute_sewing_orders_sideport_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.execute_sewing_orders
    ADD CONSTRAINT execute_sewing_orders_sideport_foreign FOREIGN KEY ("SidePort") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: execute_sewing_orders execute_sewing_orders_snapport_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.execute_sewing_orders
    ADD CONSTRAINT execute_sewing_orders_snapport_foreign FOREIGN KEY ("SnapPort") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: execute_sewing_orders execute_sewing_orders_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.execute_sewing_orders
    ADD CONSTRAINT execute_sewing_orders_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: execute_sewing_orders execute_sewing_orders_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.execute_sewing_orders
    ADD CONSTRAINT execute_sewing_orders_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: executing_receivings executing_receivings_model_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.executing_receivings
    ADD CONSTRAINT executing_receivings_model_foreign FOREIGN KEY ("Model") REFERENCES public.manufacturing_models(id) ON DELETE CASCADE;


--
-- Name: executing_receivings executing_receivings_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.executing_receivings
    ADD CONSTRAINT executing_receivings_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: export_checks export_checks_account_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.export_checks
    ADD CONSTRAINT export_checks_account_foreign FOREIGN KEY ("Account") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: export_checks export_checks_bank_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.export_checks
    ADD CONSTRAINT export_checks_bank_foreign FOREIGN KEY ("Bank") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: export_checks export_checks_bene_account_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.export_checks
    ADD CONSTRAINT export_checks_bene_account_foreign FOREIGN KEY ("Bene_Account") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: export_checks export_checks_check_type_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.export_checks
    ADD CONSTRAINT export_checks_check_type_foreign FOREIGN KEY ("Check_Type") REFERENCES public.checks_types(id) ON DELETE CASCADE;


--
-- Name: export_checks export_checks_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.export_checks
    ADD CONSTRAINT export_checks_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: export_checks export_checks_cost_center_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.export_checks
    ADD CONSTRAINT export_checks_cost_center_foreign FOREIGN KEY ("Cost_Center") REFERENCES public.cost_centers(id) ON DELETE CASCADE;


--
-- Name: export_checks export_checks_pay_account_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.export_checks
    ADD CONSTRAINT export_checks_pay_account_foreign FOREIGN KEY ("Pay_Account") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: export_checks export_checks_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.export_checks
    ADD CONSTRAINT export_checks_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: general_dailies fk_admins_general_dailies; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.general_dailies
    ADD CONSTRAINT fk_admins_general_dailies FOREIGN KEY (userr) REFERENCES public.admins(id);


--
-- Name: assay_bill_details fk_assay_bills_assay_bill_details; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.assay_bill_details
    ADD CONSTRAINT fk_assay_bills_assay_bill_details FOREIGN KEY ("Bill") REFERENCES public.assay_bills(id);


--
-- Name: customers fk_customers_countris; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.customers
    ADD CONSTRAINT fk_customers_countris FOREIGN KEY ("Nationality") REFERENCES public.countris(id);


--
-- Name: customers fk_customers_customers_groups; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.customers
    ADD CONSTRAINT fk_customers_customers_groups FOREIGN KEY ("Group") REFERENCES public.customers_groups(id);


--
-- Name: customers fk_customers_places; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.customers
    ADD CONSTRAINT fk_customers_places FOREIGN KEY ("Place") REFERENCES public.places(id);


--
-- Name: customers fk_customers_products; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.customers
    ADD CONSTRAINT fk_customers_products FOREIGN KEY ("Product") REFERENCES public.products(id);


--
-- Name: product_moves fk_product_moves_acccounting_manuals; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_moves
    ADD CONSTRAINT fk_product_moves_acccounting_manuals FOREIGN KEY ("Safe") REFERENCES public.acccounting_manuals(id);


--
-- Name: product_return_without_bills fk_product_return_without_bills_products; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_return_without_bills
    ADD CONSTRAINT fk_product_return_without_bills_products FOREIGN KEY ("Product") REFERENCES public.products(id);


--
-- Name: product_return_without_bills fk_product_return_without_bills_return_without_bills; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_return_without_bills
    ADD CONSTRAINT fk_product_return_without_bills_return_without_bills FOREIGN KEY ("Bill") REFERENCES public.return_without_bills(id);


--
-- Name: products_return_maintaince_bills fk_products_return_maintaince_bills_admins; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_return_maintaince_bills
    ADD CONSTRAINT fk_products_return_maintaince_bills_admins FOREIGN KEY ("User") REFERENCES public.admins(id);


--
-- Name: products_return_maintaince_bills fk_products_return_maintaince_bills_branches; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_return_maintaince_bills
    ADD CONSTRAINT fk_products_return_maintaince_bills_branches FOREIGN KEY ("Branch") REFERENCES public.branches(id);


--
-- Name: products_return_maintaince_bills fk_products_return_maintaince_bills_brands; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_return_maintaince_bills
    ADD CONSTRAINT fk_products_return_maintaince_bills_brands FOREIGN KEY ("Brand") REFERENCES public.brands(id);


--
-- Name: products_return_maintaince_bills fk_products_return_maintaince_bills_employesses; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_return_maintaince_bills
    ADD CONSTRAINT fk_products_return_maintaince_bills_employesses FOREIGN KEY ("Recipient") REFERENCES public.employesses(id);


--
-- Name: products_return_maintaince_bills fk_products_return_maintaince_bills_items_groups; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_return_maintaince_bills
    ADD CONSTRAINT fk_products_return_maintaince_bills_items_groups FOREIGN KEY ("Group") REFERENCES public.items_groups(id);


--
-- Name: products fk_products_subscribe_types; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products
    ADD CONSTRAINT fk_products_subscribe_types FOREIGN KEY (subscribe_type) REFERENCES public.subscribe_types(id);


--
-- Name: sales fk_resturant_tables_sales; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales
    ADD CONSTRAINT fk_resturant_tables_sales FOREIGN KEY ("Table") REFERENCES public.resturant_tables(id);


--
-- Name: return_purches fk_return_purches_acccounting_manuals; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_purches
    ADD CONSTRAINT fk_return_purches_acccounting_manuals FOREIGN KEY ("Vendor") REFERENCES public.acccounting_manuals(id);


--
-- Name: return_purches fk_return_purches_coins; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_purches
    ADD CONSTRAINT fk_return_purches_coins FOREIGN KEY ("Coin") REFERENCES public.coins(id);


--
-- Name: return_purches fk_return_purches_cost_centers; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_purches
    ADD CONSTRAINT fk_return_purches_cost_centers FOREIGN KEY ("Cost_Center") REFERENCES public.cost_centers(id);


--
-- Name: return_purches fk_return_purches_employesses; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_purches
    ADD CONSTRAINT fk_return_purches_employesses FOREIGN KEY ("Delegate") REFERENCES public.employesses(id);


--
-- Name: return_purches fk_return_purches_shipping_companies; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_purches
    ADD CONSTRAINT fk_return_purches_shipping_companies FOREIGN KEY ("Ship") REFERENCES public.shipping_companies(id);


--
-- Name: return_purches fk_return_purches_stores; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_purches
    ADD CONSTRAINT fk_return_purches_stores FOREIGN KEY ("Store") REFERENCES public.stores(id);


--
-- Name: return_sales fk_return_sales_acccounting_manuals; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_sales
    ADD CONSTRAINT fk_return_sales_acccounting_manuals FOREIGN KEY ("Client") REFERENCES public.acccounting_manuals(id);


--
-- Name: return_sales fk_return_sales_coins; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_sales
    ADD CONSTRAINT fk_return_sales_coins FOREIGN KEY ("Coin") REFERENCES public.coins(id);


--
-- Name: return_sales fk_return_sales_cost_centers; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_sales
    ADD CONSTRAINT fk_return_sales_cost_centers FOREIGN KEY ("Cost_Center") REFERENCES public.cost_centers(id);


--
-- Name: return_sales fk_return_sales_employesses; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_sales
    ADD CONSTRAINT fk_return_sales_employesses FOREIGN KEY ("Delegate") REFERENCES public.employesses(id);


--
-- Name: return_sales fk_return_sales_shipping_companies; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_sales
    ADD CONSTRAINT fk_return_sales_shipping_companies FOREIGN KEY ("Ship") REFERENCES public.shipping_companies(id);


--
-- Name: return_sales fk_return_sales_stores; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_sales
    ADD CONSTRAINT fk_return_sales_stores FOREIGN KEY ("Store") REFERENCES public.stores(id);


--
-- Name: safe_transfers fk_safe_transfers_branches; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.safe_transfers
    ADD CONSTRAINT fk_safe_transfers_branches FOREIGN KEY ("Branch") REFERENCES public.branches(id);


--
-- Name: safe_transfers fk_safe_transfers_employesses; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.safe_transfers
    ADD CONSTRAINT fk_safe_transfers_employesses FOREIGN KEY ("Delegate") REFERENCES public.employesses(id);


--
-- Name: sales fk_sales_installment_companies; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales
    ADD CONSTRAINT fk_sales_installment_companies FOREIGN KEY ("InstallCompany") REFERENCES public.installment_companies(id);


--
-- Name: sales_orders fk_sales_orders_resturant_tables; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales_orders
    ADD CONSTRAINT fk_sales_orders_resturant_tables FOREIGN KEY ("Table") REFERENCES public.resturant_tables(id);


--
-- Name: stores_moves fk_stores_moves_acccounting_manuals; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.stores_moves
    ADD CONSTRAINT fk_stores_moves_acccounting_manuals FOREIGN KEY ("Account") REFERENCES public.acccounting_manuals(id);


--
-- Name: stores_moves fk_stores_moves_admins; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.stores_moves
    ADD CONSTRAINT fk_stores_moves_admins FOREIGN KEY ("User") REFERENCES public.admins(id);


--
-- Name: stores_moves fk_stores_moves_coins; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.stores_moves
    ADD CONSTRAINT fk_stores_moves_coins FOREIGN KEY ("Coin") REFERENCES public.coins(id);


--
-- Name: stores_moves fk_stores_moves_cost_centers; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.stores_moves
    ADD CONSTRAINT fk_stores_moves_cost_centers FOREIGN KEY ("Cost_Center") REFERENCES public.cost_centers(id);


--
-- Name: stores_moves fk_stores_moves_stores; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.stores_moves
    ADD CONSTRAINT fk_stores_moves_stores FOREIGN KEY ("Store") REFERENCES public.stores(id);


--
-- Name: stors_transfers fk_stors_transfers_employesses; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.stors_transfers
    ADD CONSTRAINT fk_stors_transfers_employesses FOREIGN KEY ("Delegate") REFERENCES public.employesses(id);


--
-- Name: stors_transfers fk_stors_transfers_shipping_companies; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.stors_transfers
    ADD CONSTRAINT fk_stors_transfers_shipping_companies FOREIGN KEY ("Ship") REFERENCES public.shipping_companies(id);


--
-- Name: vendors fk_vendors_brands; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.vendors
    ADD CONSTRAINT fk_vendors_brands FOREIGN KEY ("Brand") REFERENCES public.brands(id);


--
-- Name: vendors fk_vendors_cities; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.vendors
    ADD CONSTRAINT fk_vendors_cities FOREIGN KEY ("City") REFERENCES public.cities(id);


--
-- Name: vendors fk_vendors_countris; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.vendors
    ADD CONSTRAINT fk_vendors_countris FOREIGN KEY ("Nationality") REFERENCES public.countris(id);


--
-- Name: vendors fk_vendors_employesses; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.vendors
    ADD CONSTRAINT fk_vendors_employesses FOREIGN KEY ("Responsible") REFERENCES public.employesses(id);


--
-- Name: vendors fk_vendors_governrates; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.vendors
    ADD CONSTRAINT fk_vendors_governrates FOREIGN KEY ("Governrate") REFERENCES public.governrates(id);


--
-- Name: vendors fk_vendors_items_groups; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.vendors
    ADD CONSTRAINT fk_vendors_items_groups FOREIGN KEY ("Pro_Group") REFERENCES public.items_groups(id);


--
-- Name: vendors fk_vendors_places; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.vendors
    ADD CONSTRAINT fk_vendors_places FOREIGN KEY ("Place") REFERENCES public.places(id);


--
-- Name: general_dailies general_dailies_account_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.general_dailies
    ADD CONSTRAINT general_dailies_account_foreign FOREIGN KEY ("Account") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: general_dailies general_dailies_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.general_dailies
    ADD CONSTRAINT general_dailies_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: general_dailies general_dailies_cost_center_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.general_dailies
    ADD CONSTRAINT general_dailies_cost_center_foreign FOREIGN KEY ("Cost_Center") REFERENCES public.cost_centers(id) ON DELETE CASCADE;


--
-- Name: holidays holidays_emp_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.holidays
    ADD CONSTRAINT holidays_emp_foreign FOREIGN KEY ("Emp") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: holidays holidays_type_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.holidays
    ADD CONSTRAINT holidays_type_foreign FOREIGN KEY ("Type") REFERENCES public.holidays_types(id) ON DELETE CASCADE;


--
-- Name: holidays holidays_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.holidays
    ADD CONSTRAINT holidays_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: incom_checks incom_checks_account_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.incom_checks
    ADD CONSTRAINT incom_checks_account_foreign FOREIGN KEY ("Account") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: incom_checks incom_checks_arrest_account_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.incom_checks
    ADD CONSTRAINT incom_checks_arrest_account_foreign FOREIGN KEY ("Arrest_Account") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: incom_checks incom_checks_bank_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.incom_checks
    ADD CONSTRAINT incom_checks_bank_foreign FOREIGN KEY ("Bank") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: incom_checks incom_checks_bene_account_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.incom_checks
    ADD CONSTRAINT incom_checks_bene_account_foreign FOREIGN KEY ("Bene_Account") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: incom_checks incom_checks_check_type_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.incom_checks
    ADD CONSTRAINT incom_checks_check_type_foreign FOREIGN KEY ("Check_Type") REFERENCES public.checks_types(id) ON DELETE CASCADE;


--
-- Name: incom_checks incom_checks_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.incom_checks
    ADD CONSTRAINT incom_checks_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: incom_checks incom_checks_cost_center_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.incom_checks
    ADD CONSTRAINT incom_checks_cost_center_foreign FOREIGN KEY ("Cost_Center") REFERENCES public.cost_centers(id) ON DELETE CASCADE;


--
-- Name: incom_checks incom_checks_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.incom_checks
    ADD CONSTRAINT incom_checks_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: incom_manufacturing_models incom_manufacturing_models_model_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.incom_manufacturing_models
    ADD CONSTRAINT incom_manufacturing_models_model_foreign FOREIGN KEY ("Model") REFERENCES public.manufacturing_models(id) ON DELETE CASCADE;


--
-- Name: incom_manufacturing_models incom_manufacturing_models_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.incom_manufacturing_models
    ADD CONSTRAINT incom_manufacturing_models_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: incom_manufacturing_models incom_manufacturing_models_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.incom_manufacturing_models
    ADD CONSTRAINT incom_manufacturing_models_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: incom_manufacturing_models incom_manufacturing_models_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.incom_manufacturing_models
    ADD CONSTRAINT incom_manufacturing_models_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: installment_dates installment_dates_client_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.installment_dates
    ADD CONSTRAINT installment_dates_client_foreign FOREIGN KEY ("Client") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: installment_dates installment_dates_install_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.installment_dates
    ADD CONSTRAINT installment_dates_install_foreign FOREIGN KEY ("Install") REFERENCES public.installments(id) ON DELETE CASCADE;


--
-- Name: installments installments_client_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.installments
    ADD CONSTRAINT installments_client_foreign FOREIGN KEY ("Client") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: installments installments_sales_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.installments
    ADD CONSTRAINT installments_sales_foreign FOREIGN KEY ("Sales") REFERENCES public.sales(id) ON DELETE CASCADE;


--
-- Name: insurance_papers insurance_papers_account_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.insurance_papers
    ADD CONSTRAINT insurance_papers_account_foreign FOREIGN KEY ("Account") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: insurance_papers insurance_papers_bank_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.insurance_papers
    ADD CONSTRAINT insurance_papers_bank_foreign FOREIGN KEY ("Bank") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: insurance_papers insurance_papers_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.insurance_papers
    ADD CONSTRAINT insurance_papers_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: insurance_papers insurance_papers_cost_center_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.insurance_papers
    ADD CONSTRAINT insurance_papers_cost_center_foreign FOREIGN KEY ("Cost_Center") REFERENCES public.cost_centers(id) ON DELETE CASCADE;


--
-- Name: insurance_papers insurance_papers_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.insurance_papers
    ADD CONSTRAINT insurance_papers_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: interviews interviews_client_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.interviews
    ADD CONSTRAINT interviews_client_foreign FOREIGN KEY ("Client") REFERENCES public.customers(id) ON DELETE CASCADE;


--
-- Name: interviews interviews_emp_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.interviews
    ADD CONSTRAINT interviews_emp_foreign FOREIGN KEY ("Emp") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: interviews interviews_type_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.interviews
    ADD CONSTRAINT interviews_type_foreign FOREIGN KEY ("Type") REFERENCES public.interviews_types(id) ON DELETE CASCADE;


--
-- Name: interviews interviews_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.interviews
    ADD CONSTRAINT interviews_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: inventories inventories_account_dificit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.inventories
    ADD CONSTRAINT inventories_account_dificit_foreign FOREIGN KEY ("Account_Dificit") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: inventories inventories_account_excess_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.inventories
    ADD CONSTRAINT inventories_account_excess_foreign FOREIGN KEY ("Account_Excess") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: inventories inventories_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.inventories
    ADD CONSTRAINT inventories_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: inventories inventories_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.inventories
    ADD CONSTRAINT inventories_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: inventories inventories_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.inventories
    ADD CONSTRAINT inventories_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: journalizing_details journalizing_details_account_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.journalizing_details
    ADD CONSTRAINT journalizing_details_account_foreign FOREIGN KEY ("Account") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: journalizing_details journalizing_details_joun_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.journalizing_details
    ADD CONSTRAINT journalizing_details_joun_id_foreign FOREIGN KEY ("Joun_ID") REFERENCES public.journalizings(id) ON DELETE CASCADE;


--
-- Name: journalizings journalizings_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.journalizings
    ADD CONSTRAINT journalizings_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: journalizings journalizings_cost_center_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.journalizings
    ADD CONSTRAINT journalizings_cost_center_foreign FOREIGN KEY ("Cost_Center") REFERENCES public.cost_centers(id) ON DELETE CASCADE;


--
-- Name: loans loans_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.loans
    ADD CONSTRAINT loans_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: loans loans_cost_center_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.loans
    ADD CONSTRAINT loans_cost_center_foreign FOREIGN KEY ("Cost_Center") REFERENCES public.cost_centers(id) ON DELETE CASCADE;


--
-- Name: loans loans_emp_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.loans
    ADD CONSTRAINT loans_emp_foreign FOREIGN KEY ("Emp") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: loans loans_safe_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.loans
    ADD CONSTRAINT loans_safe_foreign FOREIGN KEY ("Safe") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: loans loans_type_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.loans
    ADD CONSTRAINT loans_type_foreign FOREIGN KEY ("Type") REFERENCES public.loan_types(id) ON DELETE CASCADE;


--
-- Name: loans loans_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.loans
    ADD CONSTRAINT loans_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: maintainc_bills maintainc_bills_account_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.maintainc_bills
    ADD CONSTRAINT maintainc_bills_account_foreign FOREIGN KEY ("Account") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: maintainc_bills maintainc_bills_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.maintainc_bills
    ADD CONSTRAINT maintainc_bills_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: maintainc_bills maintainc_bills_company_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.maintainc_bills
    ADD CONSTRAINT maintainc_bills_company_foreign FOREIGN KEY ("Company") REFERENCES public.manufacture_companies(id) ON DELETE CASCADE;


--
-- Name: maintainc_bills maintainc_bills_cost_center_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.maintainc_bills
    ADD CONSTRAINT maintainc_bills_cost_center_foreign FOREIGN KEY ("Cost_Center") REFERENCES public.cost_centers(id) ON DELETE CASCADE;


--
-- Name: maintainc_bills maintainc_bills_device_case_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.maintainc_bills
    ADD CONSTRAINT maintainc_bills_device_case_foreign FOREIGN KEY ("Device_Case") REFERENCES public.desvice_cases(id) ON DELETE CASCADE;


--
-- Name: maintainc_bills maintainc_bills_device_type_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.maintainc_bills
    ADD CONSTRAINT maintainc_bills_device_type_foreign FOREIGN KEY ("Device_Type") REFERENCES public.devices_typesies(id) ON DELETE CASCADE;


--
-- Name: maintainc_bills maintainc_bills_recipt_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.maintainc_bills
    ADD CONSTRAINT maintainc_bills_recipt_foreign FOREIGN KEY ("Recipt") REFERENCES public.recipt_maintainces(id) ON DELETE CASCADE;


--
-- Name: maintainc_bills maintainc_bills_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.maintainc_bills
    ADD CONSTRAINT maintainc_bills_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: manufacturing_executions manufacturing_executions_manu_order_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.manufacturing_executions
    ADD CONSTRAINT manufacturing_executions_manu_order_id_foreign FOREIGN KEY ("Manu_Order_ID") REFERENCES public.manufacturing_orders(id) ON DELETE CASCADE;


--
-- Name: manufacturing_executions manufacturing_executions_model_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.manufacturing_executions
    ADD CONSTRAINT manufacturing_executions_model_foreign FOREIGN KEY ("Model") REFERENCES public.manufacturing_models(id) ON DELETE CASCADE;


--
-- Name: manufacturing_executions manufacturing_executions_production_manager_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.manufacturing_executions
    ADD CONSTRAINT manufacturing_executions_production_manager_foreign FOREIGN KEY ("Production_Manager") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: manufacturing_executions manufacturing_executions_quality_manager_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.manufacturing_executions
    ADD CONSTRAINT manufacturing_executions_quality_manager_foreign FOREIGN KEY ("Quality_Manager") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: manufacturing_executions manufacturing_executions_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.manufacturing_executions
    ADD CONSTRAINT manufacturing_executions_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: manufacturing_models manufacturing_models_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.manufacturing_models
    ADD CONSTRAINT manufacturing_models_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: manufacturing_models manufacturing_models_cost_center_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.manufacturing_models
    ADD CONSTRAINT manufacturing_models_cost_center_foreign FOREIGN KEY ("Cost_Center") REFERENCES public.cost_centers(id) ON DELETE CASCADE;


--
-- Name: manufacturing_models manufacturing_models_hall_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.manufacturing_models
    ADD CONSTRAINT manufacturing_models_hall_foreign FOREIGN KEY ("Hall") REFERENCES public.manufacturing_halls(id) ON DELETE CASCADE;


--
-- Name: manufacturing_models manufacturing_models_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.manufacturing_models
    ADD CONSTRAINT manufacturing_models_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: manufacturing_requests manufacturing_requests_client_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.manufacturing_requests
    ADD CONSTRAINT manufacturing_requests_client_foreign FOREIGN KEY ("Client") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: manufacturing_requests manufacturing_requests_delegate_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.manufacturing_requests
    ADD CONSTRAINT manufacturing_requests_delegate_foreign FOREIGN KEY ("Delegate") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: manufacturing_requests manufacturing_requests_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.manufacturing_requests
    ADD CONSTRAINT manufacturing_requests_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: missions missions_observer_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.missions
    ADD CONSTRAINT missions_observer_foreign FOREIGN KEY ("Observer") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: missions missions_task_owner_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.missions
    ADD CONSTRAINT missions_task_owner_foreign FOREIGN KEY ("Task_Owner") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: missions missions_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.missions
    ADD CONSTRAINT missions_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: model_has_roles model_has_roles_role_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.model_has_roles
    ADD CONSTRAINT model_has_roles_role_id_foreign FOREIGN KEY (role_id) REFERENCES public.roles(id) ON DELETE CASCADE;


--
-- Name: opening_entries opening_entries_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.opening_entries
    ADD CONSTRAINT opening_entries_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: opening_entries opening_entries_cost_center_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.opening_entries
    ADD CONSTRAINT opening_entries_cost_center_foreign FOREIGN KEY ("Cost_Center") REFERENCES public.cost_centers(id) ON DELETE CASCADE;


--
-- Name: opening_entries_details opening_entries_details_account_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.opening_entries_details
    ADD CONSTRAINT opening_entries_details_account_foreign FOREIGN KEY ("Account") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: opening_entries_details opening_entries_details_op_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.opening_entries_details
    ADD CONSTRAINT opening_entries_details_op_id_foreign FOREIGN KEY ("OP_ID") REFERENCES public.opening_entries(id) ON DELETE CASCADE;


--
-- Name: outcom_manufacturing_models outcom_manufacturing_models_model_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.outcom_manufacturing_models
    ADD CONSTRAINT outcom_manufacturing_models_model_foreign FOREIGN KEY ("Model") REFERENCES public.manufacturing_models(id) ON DELETE CASCADE;


--
-- Name: outcom_manufacturing_models outcom_manufacturing_models_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.outcom_manufacturing_models
    ADD CONSTRAINT outcom_manufacturing_models_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: outcom_manufacturing_models outcom_manufacturing_models_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.outcom_manufacturing_models
    ADD CONSTRAINT outcom_manufacturing_models_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: outcom_manufacturing_models outcom_manufacturing_models_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.outcom_manufacturing_models
    ADD CONSTRAINT outcom_manufacturing_models_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: partners partners_account_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.partners
    ADD CONSTRAINT partners_account_foreign FOREIGN KEY ("Account") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: pay_salaries pay_salaries_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.pay_salaries
    ADD CONSTRAINT pay_salaries_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: pay_salaries pay_salaries_cost_center_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.pay_salaries
    ADD CONSTRAINT pay_salaries_cost_center_foreign FOREIGN KEY ("Cost_Center") REFERENCES public.cost_centers(id) ON DELETE CASCADE;


--
-- Name: pay_salaries pay_salaries_emp_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.pay_salaries
    ADD CONSTRAINT pay_salaries_emp_foreign FOREIGN KEY ("Emp") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: pay_salaries pay_salaries_safe_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.pay_salaries
    ADD CONSTRAINT pay_salaries_safe_foreign FOREIGN KEY ("Safe") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: pay_salaries pay_salaries_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.pay_salaries
    ADD CONSTRAINT pay_salaries_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: payment_voucher_details payment_voucher_details_account_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.payment_voucher_details
    ADD CONSTRAINT payment_voucher_details_account_foreign FOREIGN KEY ("Account") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: payment_voucher_details payment_voucher_details_pv_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.payment_voucher_details
    ADD CONSTRAINT payment_voucher_details_pv_id_foreign FOREIGN KEY ("PV_ID") REFERENCES public.payment_vouchers(id) ON DELETE CASCADE;


--
-- Name: payment_vouchers payment_vouchers_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.payment_vouchers
    ADD CONSTRAINT payment_vouchers_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: payment_vouchers payment_vouchers_cost_center_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.payment_vouchers
    ADD CONSTRAINT payment_vouchers_cost_center_foreign FOREIGN KEY ("Cost_Center") REFERENCES public.cost_centers(id) ON DELETE CASCADE;


--
-- Name: payment_vouchers payment_vouchers_safe_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.payment_vouchers
    ADD CONSTRAINT payment_vouchers_safe_foreign FOREIGN KEY ("Safe") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: permission_to_exchange_goods permission_to_exchange_goods_account_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.permission_to_exchange_goods
    ADD CONSTRAINT permission_to_exchange_goods_account_foreign FOREIGN KEY ("Account") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: permission_to_exchange_goods permission_to_exchange_goods_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.permission_to_exchange_goods
    ADD CONSTRAINT permission_to_exchange_goods_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: permission_to_exchange_goods permission_to_exchange_goods_cost_center_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.permission_to_exchange_goods
    ADD CONSTRAINT permission_to_exchange_goods_cost_center_foreign FOREIGN KEY ("Cost_Center") REFERENCES public.cost_centers(id) ON DELETE CASCADE;


--
-- Name: permission_to_exchange_goods permission_to_exchange_goods_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.permission_to_exchange_goods
    ADD CONSTRAINT permission_to_exchange_goods_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: permission_to_exchange_goods permission_to_exchange_goods_to_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.permission_to_exchange_goods
    ADD CONSTRAINT permission_to_exchange_goods_to_store_foreign FOREIGN KEY ("To_Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: permission_to_exchange_goods permission_to_exchange_goods_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.permission_to_exchange_goods
    ADD CONSTRAINT permission_to_exchange_goods_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: permission_to_recived_goods permission_to_recived_goods_account_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.permission_to_recived_goods
    ADD CONSTRAINT permission_to_recived_goods_account_foreign FOREIGN KEY ("Account") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: permission_to_recived_goods permission_to_recived_goods_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.permission_to_recived_goods
    ADD CONSTRAINT permission_to_recived_goods_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: permission_to_recived_goods permission_to_recived_goods_cost_center_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.permission_to_recived_goods
    ADD CONSTRAINT permission_to_recived_goods_cost_center_foreign FOREIGN KEY ("Cost_Center") REFERENCES public.cost_centers(id) ON DELETE CASCADE;


--
-- Name: permission_to_recived_goods permission_to_recived_goods_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.permission_to_recived_goods
    ADD CONSTRAINT permission_to_recived_goods_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: permission_to_recived_goods permission_to_recived_goods_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.permission_to_recived_goods
    ADD CONSTRAINT permission_to_recived_goods_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: places places_city_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.places
    ADD CONSTRAINT places_city_foreign FOREIGN KEY ("City") REFERENCES public.cities(id) ON DELETE CASCADE;


--
-- Name: places places_delivery_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.places
    ADD CONSTRAINT places_delivery_foreign FOREIGN KEY ("Delivery") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: product_inventories product_inventories_inv_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_inventories
    ADD CONSTRAINT product_inventories_inv_id_foreign FOREIGN KEY ("Inv_ID") REFERENCES public.inventories(id) ON DELETE CASCADE;


--
-- Name: product_inventories product_inventories_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_inventories
    ADD CONSTRAINT product_inventories_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: product_inventories product_inventories_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_inventories
    ADD CONSTRAINT product_inventories_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: product_inventories product_inventories_v1_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_inventories
    ADD CONSTRAINT product_inventories_v1_foreign FOREIGN KEY ("V1") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: product_inventories product_inventories_v2_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_inventories
    ADD CONSTRAINT product_inventories_v2_foreign FOREIGN KEY ("V2") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: product_maintainc_bills product_maintainc_bills_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_maintainc_bills
    ADD CONSTRAINT product_maintainc_bills_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: product_maintainc_bills product_maintainc_bills_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_maintainc_bills
    ADD CONSTRAINT product_maintainc_bills_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: product_maintainc_bills product_maintainc_bills_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_maintainc_bills
    ADD CONSTRAINT product_maintainc_bills_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: product_maintainc_bills product_maintainc_bills_v1_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_maintainc_bills
    ADD CONSTRAINT product_maintainc_bills_v1_foreign FOREIGN KEY ("V1") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: product_maintainc_bills product_maintainc_bills_v2_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_maintainc_bills
    ADD CONSTRAINT product_maintainc_bills_v2_foreign FOREIGN KEY ("V2") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: product_manufacturing_executions product_manufacturing_executions_manuexecution_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_manufacturing_executions
    ADD CONSTRAINT product_manufacturing_executions_manuexecution_foreign FOREIGN KEY ("ManuExecution") REFERENCES public.manufacturing_executions(id) ON DELETE CASCADE;


--
-- Name: product_manufacturing_executions product_manufacturing_executions_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_manufacturing_executions
    ADD CONSTRAINT product_manufacturing_executions_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: product_manufacturing_executions product_manufacturing_executions_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_manufacturing_executions
    ADD CONSTRAINT product_manufacturing_executions_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: product_manufacturing_executions product_manufacturing_executions_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_manufacturing_executions
    ADD CONSTRAINT product_manufacturing_executions_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: product_moves product_moves_group_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_moves
    ADD CONSTRAINT product_moves_group_foreign FOREIGN KEY ("Group") REFERENCES public.items_groups(id) ON DELETE CASCADE;


--
-- Name: product_moves product_moves_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_moves
    ADD CONSTRAINT product_moves_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: product_moves product_moves_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_moves
    ADD CONSTRAINT product_moves_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: product_moves product_moves_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_moves
    ADD CONSTRAINT product_moves_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: product_moves product_moves_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_moves
    ADD CONSTRAINT product_moves_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: product_moves product_moves_v1_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_moves
    ADD CONSTRAINT product_moves_v1_foreign FOREIGN KEY ("V1") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: product_moves product_moves_v2_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_moves
    ADD CONSTRAINT product_moves_v2_foreign FOREIGN KEY ("V2") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: product_quote_images product_quote_images_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_quote_images
    ADD CONSTRAINT product_quote_images_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: product_quote_images product_quote_images_quoteimage_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_quote_images
    ADD CONSTRAINT product_quote_images_quoteimage_foreign FOREIGN KEY ("QuoteImage") REFERENCES public.quote_images(id) ON DELETE CASCADE;


--
-- Name: product_quote_images product_quote_images_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_quote_images
    ADD CONSTRAINT product_quote_images_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: product_quote_images product_quote_images_v1_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_quote_images
    ADD CONSTRAINT product_quote_images_v1_foreign FOREIGN KEY ("V1") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: product_quote_images product_quote_images_v2_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_quote_images
    ADD CONSTRAINT product_quote_images_v2_foreign FOREIGN KEY ("V2") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: product_sales_orders product_sales_orders_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_sales_orders
    ADD CONSTRAINT product_sales_orders_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: product_sales_orders product_sales_orders_salesorder_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_sales_orders
    ADD CONSTRAINT product_sales_orders_salesorder_foreign FOREIGN KEY ("SalesOrder") REFERENCES public.sales_orders(id) ON DELETE CASCADE;


--
-- Name: product_sales_orders product_sales_orders_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_sales_orders
    ADD CONSTRAINT product_sales_orders_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: product_sales_orders product_sales_orders_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_sales_orders
    ADD CONSTRAINT product_sales_orders_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: product_sales_orders product_sales_orders_v1_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_sales_orders
    ADD CONSTRAINT product_sales_orders_v1_foreign FOREIGN KEY ("V1") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: product_sales_orders product_sales_orders_v2_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_sales_orders
    ADD CONSTRAINT product_sales_orders_v2_foreign FOREIGN KEY ("V2") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: product_sales product_sales_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_sales
    ADD CONSTRAINT product_sales_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: product_sales product_sales_sales_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_sales
    ADD CONSTRAINT product_sales_sales_foreign FOREIGN KEY ("Sales") REFERENCES public.sales(id) ON DELETE CASCADE;


--
-- Name: product_sales product_sales_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_sales
    ADD CONSTRAINT product_sales_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: product_sales_subscribes product_sales_subscribes_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_sales_subscribes
    ADD CONSTRAINT product_sales_subscribes_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: product_sales_subscribes product_sales_subscribes_subscribe_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_sales_subscribes
    ADD CONSTRAINT product_sales_subscribes_subscribe_foreign FOREIGN KEY ("Subscribe") REFERENCES public.sales_subscribes(id) ON DELETE CASCADE;


--
-- Name: product_sales_subscribes product_sales_subscribes_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_sales_subscribes
    ADD CONSTRAINT product_sales_subscribes_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: product_sales_subscribes product_sales_subscribes_v1_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_sales_subscribes
    ADD CONSTRAINT product_sales_subscribes_v1_foreign FOREIGN KEY ("V1") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: product_sales_subscribes product_sales_subscribes_v2_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_sales_subscribes
    ADD CONSTRAINT product_sales_subscribes_v2_foreign FOREIGN KEY ("V2") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: product_sales product_sales_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_sales
    ADD CONSTRAINT product_sales_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: product_sales product_sales_v1_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_sales
    ADD CONSTRAINT product_sales_v1_foreign FOREIGN KEY ("V1") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: product_sales product_sales_v2_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_sales
    ADD CONSTRAINT product_sales_v2_foreign FOREIGN KEY ("V2") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: product_settlements product_settlements_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_settlements
    ADD CONSTRAINT product_settlements_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: product_settlements product_settlements_set_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_settlements
    ADD CONSTRAINT product_settlements_set_id_foreign FOREIGN KEY ("Set_ID") REFERENCES public.settlements(id) ON DELETE CASCADE;


--
-- Name: product_settlements product_settlements_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_settlements
    ADD CONSTRAINT product_settlements_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: product_settlements product_settlements_v1_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_settlements
    ADD CONSTRAINT product_settlements_v1_foreign FOREIGN KEY ("V1") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: product_settlements product_settlements_v2_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_settlements
    ADD CONSTRAINT product_settlements_v2_foreign FOREIGN KEY ("V2") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: product_units product_units_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_units
    ADD CONSTRAINT product_units_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: product_units product_units_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.product_units
    ADD CONSTRAINT product_units_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: products products_brand_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products
    ADD CONSTRAINT products_brand_foreign FOREIGN KEY ("Brand") REFERENCES public.brands(id) ON DELETE CASCADE;


--
-- Name: products_consists products_consists_consist_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_consists
    ADD CONSTRAINT products_consists_consist_id_foreign FOREIGN KEY ("Consist_ID") REFERENCES public.consists(id) ON DELETE CASCADE;


--
-- Name: products_consists products_consists_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_consists
    ADD CONSTRAINT products_consists_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: products_consists products_consists_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_consists
    ADD CONSTRAINT products_consists_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: products_consists products_consists_v1_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_consists
    ADD CONSTRAINT products_consists_v1_foreign FOREIGN KEY ("V1") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: products_consists products_consists_v2_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_consists
    ADD CONSTRAINT products_consists_v2_foreign FOREIGN KEY ("V2") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: products_executing_receivings products_executing_receivings_executing_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_executing_receivings
    ADD CONSTRAINT products_executing_receivings_executing_foreign FOREIGN KEY ("Executing") REFERENCES public.executing_receivings(id) ON DELETE CASCADE;


--
-- Name: products_executing_receivings products_executing_receivings_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_executing_receivings
    ADD CONSTRAINT products_executing_receivings_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: products_executing_receivings products_executing_receivings_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_executing_receivings
    ADD CONSTRAINT products_executing_receivings_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: products_executing_receivings products_executing_receivings_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_executing_receivings
    ADD CONSTRAINT products_executing_receivings_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: products products_group_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products
    ADD CONSTRAINT products_group_foreign FOREIGN KEY ("Group") REFERENCES public.items_groups(id) ON DELETE CASCADE;


--
-- Name: products_manufacturing_orders products_manufacturing_orders_manuorder_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_manufacturing_orders
    ADD CONSTRAINT products_manufacturing_orders_manuorder_foreign FOREIGN KEY ("ManuOrder") REFERENCES public.manufacturing_orders(id) ON DELETE CASCADE;


--
-- Name: products_manufacturing_orders products_manufacturing_orders_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_manufacturing_orders
    ADD CONSTRAINT products_manufacturing_orders_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: products_manufacturing_orders products_manufacturing_orders_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_manufacturing_orders
    ADD CONSTRAINT products_manufacturing_orders_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: products_manufacturing_orders products_manufacturing_orders_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_manufacturing_orders
    ADD CONSTRAINT products_manufacturing_orders_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: products_manufacturing_orders products_manufacturing_orders_v1_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_manufacturing_orders
    ADD CONSTRAINT products_manufacturing_orders_v1_foreign FOREIGN KEY ("V1") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: products_manufacturing_orders products_manufacturing_orders_v2_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_manufacturing_orders
    ADD CONSTRAINT products_manufacturing_orders_v2_foreign FOREIGN KEY ("V2") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: products_manufacturing_requests products_manufacturing_requests_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_manufacturing_requests
    ADD CONSTRAINT products_manufacturing_requests_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: products_manufacturing_requests products_manufacturing_requests_request_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_manufacturing_requests
    ADD CONSTRAINT products_manufacturing_requests_request_foreign FOREIGN KEY ("Request") REFERENCES public.manufacturing_requests(id) ON DELETE CASCADE;


--
-- Name: products_manufacturing_requests products_manufacturing_requests_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_manufacturing_requests
    ADD CONSTRAINT products_manufacturing_requests_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: products_manufacturing_requests products_manufacturing_requests_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_manufacturing_requests
    ADD CONSTRAINT products_manufacturing_requests_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: products_manufacturing_requests products_manufacturing_requests_v1_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_manufacturing_requests
    ADD CONSTRAINT products_manufacturing_requests_v1_foreign FOREIGN KEY ("V1") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: products_manufacturing_requests products_manufacturing_requests_v2_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_manufacturing_requests
    ADD CONSTRAINT products_manufacturing_requests_v2_foreign FOREIGN KEY ("V2") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: products_permission_to_exchange_goods products_permission_to_exchange_goods_exchange_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_permission_to_exchange_goods
    ADD CONSTRAINT products_permission_to_exchange_goods_exchange_foreign FOREIGN KEY ("Exchange") REFERENCES public.permission_to_exchange_goods(id) ON DELETE CASCADE;


--
-- Name: products_permission_to_exchange_goods products_permission_to_exchange_goods_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_permission_to_exchange_goods
    ADD CONSTRAINT products_permission_to_exchange_goods_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: products_permission_to_exchange_goods products_permission_to_exchange_goods_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_permission_to_exchange_goods
    ADD CONSTRAINT products_permission_to_exchange_goods_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: products_permission_to_exchange_goods products_permission_to_exchange_goods_to_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_permission_to_exchange_goods
    ADD CONSTRAINT products_permission_to_exchange_goods_to_store_foreign FOREIGN KEY ("To_Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: products_permission_to_exchange_goods products_permission_to_exchange_goods_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_permission_to_exchange_goods
    ADD CONSTRAINT products_permission_to_exchange_goods_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: products_permission_to_exchange_goods products_permission_to_exchange_goods_v1_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_permission_to_exchange_goods
    ADD CONSTRAINT products_permission_to_exchange_goods_v1_foreign FOREIGN KEY ("V1") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: products_permission_to_exchange_goods products_permission_to_exchange_goods_v2_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_permission_to_exchange_goods
    ADD CONSTRAINT products_permission_to_exchange_goods_v2_foreign FOREIGN KEY ("V2") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: products_permission_to_recived_goods products_permission_to_recived_goods_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_permission_to_recived_goods
    ADD CONSTRAINT products_permission_to_recived_goods_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: products_permission_to_recived_goods products_permission_to_recived_goods_recived_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_permission_to_recived_goods
    ADD CONSTRAINT products_permission_to_recived_goods_recived_foreign FOREIGN KEY ("Recived") REFERENCES public.permission_to_recived_goods(id) ON DELETE CASCADE;


--
-- Name: products_permission_to_recived_goods products_permission_to_recived_goods_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_permission_to_recived_goods
    ADD CONSTRAINT products_permission_to_recived_goods_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: products_permission_to_recived_goods products_permission_to_recived_goods_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_permission_to_recived_goods
    ADD CONSTRAINT products_permission_to_recived_goods_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: products_permission_to_recived_goods products_permission_to_recived_goods_v1_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_permission_to_recived_goods
    ADD CONSTRAINT products_permission_to_recived_goods_v1_foreign FOREIGN KEY ("V1") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: products_permission_to_recived_goods products_permission_to_recived_goods_v2_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_permission_to_recived_goods
    ADD CONSTRAINT products_permission_to_recived_goods_v2_foreign FOREIGN KEY ("V2") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: products_purchase_petrols products_purchase_petrols_petrol_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_purchase_petrols
    ADD CONSTRAINT products_purchase_petrols_petrol_foreign FOREIGN KEY ("Petrol") REFERENCES public.purchase_petrols(id) ON DELETE CASCADE;


--
-- Name: products_purchases_orders products_purchases_orders_p_order_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_purchases_orders
    ADD CONSTRAINT products_purchases_orders_p_order_foreign FOREIGN KEY ("P_Order") REFERENCES public.purchases_orders(id) ON DELETE CASCADE;


--
-- Name: products_purchases_orders products_purchases_orders_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_purchases_orders
    ADD CONSTRAINT products_purchases_orders_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: products_purchases_orders products_purchases_orders_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_purchases_orders
    ADD CONSTRAINT products_purchases_orders_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: products_purchases_orders products_purchases_orders_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_purchases_orders
    ADD CONSTRAINT products_purchases_orders_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: products_purchases_orders products_purchases_orders_v1_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_purchases_orders
    ADD CONSTRAINT products_purchases_orders_v1_foreign FOREIGN KEY ("V1") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: products_purchases_orders products_purchases_orders_v2_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_purchases_orders
    ADD CONSTRAINT products_purchases_orders_v2_foreign FOREIGN KEY ("V2") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: products_purchases products_purchases_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_purchases
    ADD CONSTRAINT products_purchases_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: products_purchases products_purchases_purchase_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_purchases
    ADD CONSTRAINT products_purchases_purchase_foreign FOREIGN KEY ("Purchase") REFERENCES public.purchases(id) ON DELETE CASCADE;


--
-- Name: products_purchases products_purchases_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_purchases
    ADD CONSTRAINT products_purchases_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: products_purchases products_purchases_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_purchases
    ADD CONSTRAINT products_purchases_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: products_purchases products_purchases_v1_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_purchases
    ADD CONSTRAINT products_purchases_v1_foreign FOREIGN KEY ("V1") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: products_purchases products_purchases_v2_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_purchases
    ADD CONSTRAINT products_purchases_v2_foreign FOREIGN KEY ("V2") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: products_qties products_qties_pro_stores_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_qties
    ADD CONSTRAINT products_qties_pro_stores_foreign FOREIGN KEY ("Pro_Stores") REFERENCES public.products_stores(id) ON DELETE CASCADE;


--
-- Name: products_qties products_qties_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_qties
    ADD CONSTRAINT products_qties_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: products_qties products_qties_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_qties
    ADD CONSTRAINT products_qties_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: products_qties products_qties_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_qties
    ADD CONSTRAINT products_qties_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: products_qties products_qties_v1_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_qties
    ADD CONSTRAINT products_qties_v1_foreign FOREIGN KEY ("V1") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: products_qties products_qties_v2_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_qties
    ADD CONSTRAINT products_qties_v2_foreign FOREIGN KEY ("V2") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: products_quotes products_quotes_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_quotes
    ADD CONSTRAINT products_quotes_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: products_quotes products_quotes_s_quote_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_quotes
    ADD CONSTRAINT products_quotes_s_quote_foreign FOREIGN KEY ("S_Quote") REFERENCES public.quotes(id) ON DELETE CASCADE;


--
-- Name: products_quotes products_quotes_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_quotes
    ADD CONSTRAINT products_quotes_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: products_quotes products_quotes_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_quotes
    ADD CONSTRAINT products_quotes_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: products_quotes products_quotes_v1_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_quotes
    ADD CONSTRAINT products_quotes_v1_foreign FOREIGN KEY ("V1") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: products_quotes products_quotes_v2_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_quotes
    ADD CONSTRAINT products_quotes_v2_foreign FOREIGN KEY ("V2") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: products_return_maintaince_bills products_return_maintaince_bills_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_return_maintaince_bills
    ADD CONSTRAINT products_return_maintaince_bills_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: products_return_maintaince_bills products_return_maintaince_bills_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_return_maintaince_bills
    ADD CONSTRAINT products_return_maintaince_bills_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: products_return_maintaince_bills products_return_maintaince_bills_v1_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_return_maintaince_bills
    ADD CONSTRAINT products_return_maintaince_bills_v1_foreign FOREIGN KEY ("V1") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: products_return_maintaince_bills products_return_maintaince_bills_v2_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_return_maintaince_bills
    ADD CONSTRAINT products_return_maintaince_bills_v2_foreign FOREIGN KEY ("V2") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: products_secretariat_export_goods products_secretariat_export_goods_export_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_secretariat_export_goods
    ADD CONSTRAINT products_secretariat_export_goods_export_foreign FOREIGN KEY ("Export") REFERENCES public.secretariat_export_goods(id) ON DELETE CASCADE;


--
-- Name: products_secretariat_export_goods products_secretariat_export_goods_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_secretariat_export_goods
    ADD CONSTRAINT products_secretariat_export_goods_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: products_secretariat_export_goods products_secretariat_export_goods_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_secretariat_export_goods
    ADD CONSTRAINT products_secretariat_export_goods_store_foreign FOREIGN KEY ("Store") REFERENCES public.secretariat_stores(id) ON DELETE CASCADE;


--
-- Name: products_secretariat_export_goods products_secretariat_export_goods_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_secretariat_export_goods
    ADD CONSTRAINT products_secretariat_export_goods_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: products_secretariat_export_goods products_secretariat_export_goods_v1_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_secretariat_export_goods
    ADD CONSTRAINT products_secretariat_export_goods_v1_foreign FOREIGN KEY ("V1") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: products_secretariat_export_goods products_secretariat_export_goods_v2_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_secretariat_export_goods
    ADD CONSTRAINT products_secretariat_export_goods_v2_foreign FOREIGN KEY ("V2") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: products_secretariat_import_goods products_secretariat_import_goods_import_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_secretariat_import_goods
    ADD CONSTRAINT products_secretariat_import_goods_import_foreign FOREIGN KEY ("Import") REFERENCES public.secretariat_import_goods(id) ON DELETE CASCADE;


--
-- Name: products_secretariat_import_goods products_secretariat_import_goods_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_secretariat_import_goods
    ADD CONSTRAINT products_secretariat_import_goods_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: products_secretariat_import_goods products_secretariat_import_goods_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_secretariat_import_goods
    ADD CONSTRAINT products_secretariat_import_goods_store_foreign FOREIGN KEY ("Store") REFERENCES public.secretariat_stores(id) ON DELETE CASCADE;


--
-- Name: products_secretariat_import_goods products_secretariat_import_goods_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_secretariat_import_goods
    ADD CONSTRAINT products_secretariat_import_goods_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: products_secretariat_import_goods products_secretariat_import_goods_v1_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_secretariat_import_goods
    ADD CONSTRAINT products_secretariat_import_goods_v1_foreign FOREIGN KEY ("V1") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: products_secretariat_import_goods products_secretariat_import_goods_v2_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_secretariat_import_goods
    ADD CONSTRAINT products_secretariat_import_goods_v2_foreign FOREIGN KEY ("V2") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: products_shortcomings products_shortcomings_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_shortcomings
    ADD CONSTRAINT products_shortcomings_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: products_shortcomings products_shortcomings_shortmings_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_shortcomings
    ADD CONSTRAINT products_shortcomings_shortmings_foreign FOREIGN KEY ("Shortmings") REFERENCES public.shortcomings(id) ON DELETE CASCADE;


--
-- Name: products_shortcomings products_shortcomings_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_shortcomings
    ADD CONSTRAINT products_shortcomings_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: products_shortcomings products_shortcomings_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_shortcomings
    ADD CONSTRAINT products_shortcomings_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: products_shortcomings products_shortcomings_v1_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_shortcomings
    ADD CONSTRAINT products_shortcomings_v1_foreign FOREIGN KEY ("V1") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: products_shortcomings products_shortcomings_v2_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_shortcomings
    ADD CONSTRAINT products_shortcomings_v2_foreign FOREIGN KEY ("V2") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: products_start_periods products_start_periods_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_start_periods
    ADD CONSTRAINT products_start_periods_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: products_start_periods products_start_periods_sp_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_start_periods
    ADD CONSTRAINT products_start_periods_sp_id_foreign FOREIGN KEY ("SP_ID") REFERENCES public.start_periods(id) ON DELETE CASCADE;


--
-- Name: products_start_periods products_start_periods_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_start_periods
    ADD CONSTRAINT products_start_periods_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: products_start_periods products_start_periods_v1_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_start_periods
    ADD CONSTRAINT products_start_periods_v1_foreign FOREIGN KEY ("V1") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: products_start_periods products_start_periods_v2_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_start_periods
    ADD CONSTRAINT products_start_periods_v2_foreign FOREIGN KEY ("V2") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: products_stores products_stores_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_stores
    ADD CONSTRAINT products_stores_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: products_stores products_stores_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_stores
    ADD CONSTRAINT products_stores_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: products_stores_transfers products_stores_transfers_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_stores_transfers
    ADD CONSTRAINT products_stores_transfers_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: products_stores_transfers products_stores_transfers_st_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_stores_transfers
    ADD CONSTRAINT products_stores_transfers_st_id_foreign FOREIGN KEY ("ST_ID") REFERENCES public.stors_transfers(id) ON DELETE CASCADE;


--
-- Name: products_stores_transfers products_stores_transfers_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_stores_transfers
    ADD CONSTRAINT products_stores_transfers_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: products_stores_transfers products_stores_transfers_v1_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_stores_transfers
    ADD CONSTRAINT products_stores_transfers_v1_foreign FOREIGN KEY ("V1") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: products_stores_transfers products_stores_transfers_v2_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_stores_transfers
    ADD CONSTRAINT products_stores_transfers_v2_foreign FOREIGN KEY ("V2") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: products_stores products_stores_v1_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_stores
    ADD CONSTRAINT products_stores_v1_foreign FOREIGN KEY ("V1") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: products_stores products_stores_v2_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_stores
    ADD CONSTRAINT products_stores_v2_foreign FOREIGN KEY ("V2") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: products products_tax_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products
    ADD CONSTRAINT products_tax_foreign FOREIGN KEY ("Tax") REFERENCES public.taxes(id) ON DELETE CASCADE;


--
-- Name: products_viras products_viras_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_viras
    ADD CONSTRAINT products_viras_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: products_viras products_viras_v1_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_viras
    ADD CONSTRAINT products_viras_v1_foreign FOREIGN KEY ("V1") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: products_viras products_viras_v2_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.products_viras
    ADD CONSTRAINT products_viras_v2_foreign FOREIGN KEY ("V2") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: project_teams project_teams_member_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.project_teams
    ADD CONSTRAINT project_teams_member_foreign FOREIGN KEY ("Member") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: project_teams project_teams_project_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.project_teams
    ADD CONSTRAINT project_teams_project_foreign FOREIGN KEY ("Project") REFERENCES public.projects(id) ON DELETE CASCADE;


--
-- Name: projects projects_client_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.projects
    ADD CONSTRAINT projects_client_foreign FOREIGN KEY ("Client") REFERENCES public.customers(id) ON DELETE CASCADE;


--
-- Name: projects projects_manager_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.projects
    ADD CONSTRAINT projects_manager_foreign FOREIGN KEY ("Manager") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: projects projects_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.projects
    ADD CONSTRAINT projects_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: purchase_petrols purchase_petrols_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.purchase_petrols
    ADD CONSTRAINT purchase_petrols_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: purchase_petrols purchase_petrols_safe_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.purchase_petrols
    ADD CONSTRAINT purchase_petrols_safe_foreign FOREIGN KEY ("Safe") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: purchase_petrols purchase_petrols_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.purchase_petrols
    ADD CONSTRAINT purchase_petrols_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: purchase_petrols purchase_petrols_vendor_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.purchase_petrols
    ADD CONSTRAINT purchase_petrols_vendor_foreign FOREIGN KEY ("Vendor") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: purchases purchases_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.purchases
    ADD CONSTRAINT purchases_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: purchases purchases_cost_center_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.purchases
    ADD CONSTRAINT purchases_cost_center_foreign FOREIGN KEY ("Cost_Center") REFERENCES public.cost_centers(id) ON DELETE CASCADE;


--
-- Name: purchases_default_data purchases_default_data_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.purchases_default_data
    ADD CONSTRAINT purchases_default_data_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: purchases_default_data purchases_default_data_delegate_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.purchases_default_data
    ADD CONSTRAINT purchases_default_data_delegate_foreign FOREIGN KEY ("Delegate") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: purchases_default_data purchases_default_data_safe_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.purchases_default_data
    ADD CONSTRAINT purchases_default_data_safe_foreign FOREIGN KEY ("Safe") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: purchases_default_data purchases_default_data_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.purchases_default_data
    ADD CONSTRAINT purchases_default_data_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: purchases_default_data purchases_default_data_vendor_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.purchases_default_data
    ADD CONSTRAINT purchases_default_data_vendor_foreign FOREIGN KEY ("Vendor") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: purchases purchases_delegate_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.purchases
    ADD CONSTRAINT purchases_delegate_foreign FOREIGN KEY ("Delegate") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: purchases_orders purchases_orders_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.purchases_orders
    ADD CONSTRAINT purchases_orders_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: purchases_orders purchases_orders_cost_center_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.purchases_orders
    ADD CONSTRAINT purchases_orders_cost_center_foreign FOREIGN KEY ("Cost_Center") REFERENCES public.cost_centers(id) ON DELETE CASCADE;


--
-- Name: purchases_orders purchases_orders_delegate_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.purchases_orders
    ADD CONSTRAINT purchases_orders_delegate_foreign FOREIGN KEY ("Delegate") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: purchases_orders purchases_orders_safe_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.purchases_orders
    ADD CONSTRAINT purchases_orders_safe_foreign FOREIGN KEY ("Safe") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: purchases_orders purchases_orders_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.purchases_orders
    ADD CONSTRAINT purchases_orders_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: purchases_orders purchases_orders_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.purchases_orders
    ADD CONSTRAINT purchases_orders_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: purchases_orders purchases_orders_vendor_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.purchases_orders
    ADD CONSTRAINT purchases_orders_vendor_foreign FOREIGN KEY ("Vendor") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: purchases purchases_safe_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.purchases
    ADD CONSTRAINT purchases_safe_foreign FOREIGN KEY ("Safe") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: purchases purchases_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.purchases
    ADD CONSTRAINT purchases_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: purchases purchases_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.purchases
    ADD CONSTRAINT purchases_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: purchases purchases_vendor_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.purchases
    ADD CONSTRAINT purchases_vendor_foreign FOREIGN KEY ("Vendor") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: qualities qualities_manuexecution_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.qualities
    ADD CONSTRAINT qualities_manuexecution_foreign FOREIGN KEY ("ManuExecution") REFERENCES public.manufacturing_executions(id) ON DELETE CASCADE;


--
-- Name: qualities qualities_production_manager_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.qualities
    ADD CONSTRAINT qualities_production_manager_foreign FOREIGN KEY ("Production_Manager") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: qualities qualities_quality_manager_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.qualities
    ADD CONSTRAINT qualities_quality_manager_foreign FOREIGN KEY ("Quality_Manager") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: qualities qualities_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.qualities
    ADD CONSTRAINT qualities_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: quality_details quality_details_exmine_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.quality_details
    ADD CONSTRAINT quality_details_exmine_foreign FOREIGN KEY ("Exmine") REFERENCES public.examinations_types(id) ON DELETE CASCADE;


--
-- Name: quality_details quality_details_quality_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.quality_details
    ADD CONSTRAINT quality_details_quality_foreign FOREIGN KEY ("Quality") REFERENCES public.qualities(id) ON DELETE CASCADE;


--
-- Name: quotes quotes_client_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.quotes
    ADD CONSTRAINT quotes_client_foreign FOREIGN KEY ("Client") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: quotes quotes_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.quotes
    ADD CONSTRAINT quotes_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: quotes quotes_cost_center_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.quotes
    ADD CONSTRAINT quotes_cost_center_foreign FOREIGN KEY ("Cost_Center") REFERENCES public.cost_centers(id) ON DELETE CASCADE;


--
-- Name: quotes quotes_delegate_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.quotes
    ADD CONSTRAINT quotes_delegate_foreign FOREIGN KEY ("Delegate") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: quotes quotes_executor_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.quotes
    ADD CONSTRAINT quotes_executor_foreign FOREIGN KEY ("Executor") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: quotes quotes_safe_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.quotes
    ADD CONSTRAINT quotes_safe_foreign FOREIGN KEY ("Safe") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: quotes quotes_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.quotes
    ADD CONSTRAINT quotes_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: quotes quotes_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.quotes
    ADD CONSTRAINT quotes_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: rates rates_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.rates
    ADD CONSTRAINT rates_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: rates rates_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.rates
    ADD CONSTRAINT rates_user_foreign FOREIGN KEY ("User") REFERENCES public.customers(id) ON DELETE CASCADE;


--
-- Name: recipt_maintaince_errors recipt_maintaince_errors_recipt_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recipt_maintaince_errors
    ADD CONSTRAINT recipt_maintaince_errors_recipt_foreign FOREIGN KEY ("Recipt") REFERENCES public.recipt_maintainces(id) ON DELETE CASCADE;


--
-- Name: recipt_maintainces recipt_maintainces_account_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recipt_maintainces
    ADD CONSTRAINT recipt_maintainces_account_foreign FOREIGN KEY ("Account") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: recipt_maintainces recipt_maintainces_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recipt_maintainces
    ADD CONSTRAINT recipt_maintainces_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: recipt_maintainces recipt_maintainces_company_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recipt_maintainces
    ADD CONSTRAINT recipt_maintainces_company_foreign FOREIGN KEY ("Company") REFERENCES public.manufacture_companies(id) ON DELETE CASCADE;


--
-- Name: recipt_maintainces recipt_maintainces_cost_center_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recipt_maintainces
    ADD CONSTRAINT recipt_maintainces_cost_center_foreign FOREIGN KEY ("Cost_Center") REFERENCES public.cost_centers(id) ON DELETE CASCADE;


--
-- Name: recipt_maintainces recipt_maintainces_device_case_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recipt_maintainces
    ADD CONSTRAINT recipt_maintainces_device_case_foreign FOREIGN KEY ("Device_Case") REFERENCES public.desvice_cases(id) ON DELETE CASCADE;


--
-- Name: recipt_maintainces recipt_maintainces_device_type_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recipt_maintainces
    ADD CONSTRAINT recipt_maintainces_device_type_foreign FOREIGN KEY ("Device_Type") REFERENCES public.devices_typesies(id) ON DELETE CASCADE;


--
-- Name: recipt_maintainces recipt_maintainces_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recipt_maintainces
    ADD CONSTRAINT recipt_maintainces_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: recipt_voucher_details recipt_voucher_details_account_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recipt_voucher_details
    ADD CONSTRAINT recipt_voucher_details_account_foreign FOREIGN KEY ("Account") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: recipt_voucher_details recipt_voucher_details_rv_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recipt_voucher_details
    ADD CONSTRAINT recipt_voucher_details_rv_id_foreign FOREIGN KEY ("RV_ID") REFERENCES public.recipt_vouchers(id) ON DELETE CASCADE;


--
-- Name: recipt_vouchers recipt_vouchers_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recipt_vouchers
    ADD CONSTRAINT recipt_vouchers_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: recipt_vouchers recipt_vouchers_cost_center_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recipt_vouchers
    ADD CONSTRAINT recipt_vouchers_cost_center_foreign FOREIGN KEY ("Cost_Center") REFERENCES public.cost_centers(id) ON DELETE CASCADE;


--
-- Name: recipt_vouchers recipt_vouchers_safe_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recipt_vouchers
    ADD CONSTRAINT recipt_vouchers_safe_foreign FOREIGN KEY ("Safe") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: recipts_sales_petrols recipts_sales_petrols_salespetrol_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recipts_sales_petrols
    ADD CONSTRAINT recipts_sales_petrols_salespetrol_foreign FOREIGN KEY ("SalesPetrol") REFERENCES public.sales_petrols(id) ON DELETE CASCADE;


--
-- Name: recipts_types recipts_types_account_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recipts_types
    ADD CONSTRAINT recipts_types_account_foreign FOREIGN KEY ("Account") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: recived_purch_products recived_purch_products_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recived_purch_products
    ADD CONSTRAINT recived_purch_products_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: recived_purch_products recived_purch_products_recived_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recived_purch_products
    ADD CONSTRAINT recived_purch_products_recived_foreign FOREIGN KEY ("Recived") REFERENCES public.recived_purchts(id) ON DELETE CASCADE;


--
-- Name: recived_purch_products recived_purch_products_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recived_purch_products
    ADD CONSTRAINT recived_purch_products_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: recived_purch_products recived_purch_products_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recived_purch_products
    ADD CONSTRAINT recived_purch_products_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: recived_purch_products recived_purch_products_v1_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recived_purch_products
    ADD CONSTRAINT recived_purch_products_v1_foreign FOREIGN KEY ("V1") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: recived_purch_products recived_purch_products_v2_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recived_purch_products
    ADD CONSTRAINT recived_purch_products_v2_foreign FOREIGN KEY ("V2") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: recived_purchts recived_purchts_purchase_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recived_purchts
    ADD CONSTRAINT recived_purchts_purchase_foreign FOREIGN KEY ("Purchase") REFERENCES public.purchases(id) ON DELETE CASCADE;


--
-- Name: recived_sales_products recived_sales_products_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recived_sales_products
    ADD CONSTRAINT recived_sales_products_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: recived_sales_products recived_sales_products_recived_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recived_sales_products
    ADD CONSTRAINT recived_sales_products_recived_foreign FOREIGN KEY ("Recived") REFERENCES public.recived_sales(id) ON DELETE CASCADE;


--
-- Name: recived_sales_products recived_sales_products_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recived_sales_products
    ADD CONSTRAINT recived_sales_products_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: recived_sales_products recived_sales_products_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recived_sales_products
    ADD CONSTRAINT recived_sales_products_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: recived_sales_products recived_sales_products_v1_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recived_sales_products
    ADD CONSTRAINT recived_sales_products_v1_foreign FOREIGN KEY ("V1") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: recived_sales_products recived_sales_products_v2_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recived_sales_products
    ADD CONSTRAINT recived_sales_products_v2_foreign FOREIGN KEY ("V2") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: recived_sales recived_sales_sales_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recived_sales
    ADD CONSTRAINT recived_sales_sales_foreign FOREIGN KEY ("Sales") REFERENCES public.sales(id) ON DELETE CASCADE;


--
-- Name: reg_over_times reg_over_times_emp_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.reg_over_times
    ADD CONSTRAINT reg_over_times_emp_foreign FOREIGN KEY ("Emp") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: reg_over_times reg_over_times_type_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.reg_over_times
    ADD CONSTRAINT reg_over_times_type_foreign FOREIGN KEY ("Type") REFERENCES public.over_times(id) ON DELETE CASCADE;


--
-- Name: reg_over_times reg_over_times_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.reg_over_times
    ADD CONSTRAINT reg_over_times_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: reservations reservations_client_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.reservations
    ADD CONSTRAINT reservations_client_foreign FOREIGN KEY ("Client") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: reservations reservations_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.reservations
    ADD CONSTRAINT reservations_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: reservations reservations_room_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.reservations
    ADD CONSTRAINT reservations_room_foreign FOREIGN KEY ("Room") REFERENCES public.rooms(id) ON DELETE CASCADE;


--
-- Name: reservations reservations_safe_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.reservations
    ADD CONSTRAINT reservations_safe_foreign FOREIGN KEY ("Safe") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: return_maintaince_bills return_maintaince_bills_account_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_maintaince_bills
    ADD CONSTRAINT return_maintaince_bills_account_foreign FOREIGN KEY ("Account") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: return_maintaince_bills return_maintaince_bills_branch_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_maintaince_bills
    ADD CONSTRAINT return_maintaince_bills_branch_foreign FOREIGN KEY ("Branch") REFERENCES public.branches(id) ON DELETE CASCADE;


--
-- Name: return_maintaince_bills return_maintaince_bills_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_maintaince_bills
    ADD CONSTRAINT return_maintaince_bills_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: return_maintaince_bills return_maintaince_bills_company_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_maintaince_bills
    ADD CONSTRAINT return_maintaince_bills_company_foreign FOREIGN KEY ("Company") REFERENCES public.manufacture_companies(id) ON DELETE CASCADE;


--
-- Name: return_maintaince_bills return_maintaince_bills_cost_center_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_maintaince_bills
    ADD CONSTRAINT return_maintaince_bills_cost_center_foreign FOREIGN KEY ("Cost_Center") REFERENCES public.cost_centers(id) ON DELETE CASCADE;


--
-- Name: return_maintaince_bills return_maintaince_bills_device_case_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_maintaince_bills
    ADD CONSTRAINT return_maintaince_bills_device_case_foreign FOREIGN KEY ("Device_Case") REFERENCES public.desvice_cases(id) ON DELETE CASCADE;


--
-- Name: return_maintaince_bills return_maintaince_bills_device_type_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_maintaince_bills
    ADD CONSTRAINT return_maintaince_bills_device_type_foreign FOREIGN KEY ("Device_Type") REFERENCES public.devices_typesies(id) ON DELETE CASCADE;


--
-- Name: return_maintaince_bills return_maintaince_bills_eng_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_maintaince_bills
    ADD CONSTRAINT return_maintaince_bills_eng_foreign FOREIGN KEY ("Eng") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: return_maintaince_bills return_maintaince_bills_recipient_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_maintaince_bills
    ADD CONSTRAINT return_maintaince_bills_recipient_foreign FOREIGN KEY ("Recipient") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: return_maintaince_bills return_maintaince_bills_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_maintaince_bills
    ADD CONSTRAINT return_maintaince_bills_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: return_maintaince_bills return_maintaince_bills_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_maintaince_bills
    ADD CONSTRAINT return_maintaince_bills_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: return_purch_products return_purch_products_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_purch_products
    ADD CONSTRAINT return_purch_products_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: return_purch_products return_purch_products_return_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_purch_products
    ADD CONSTRAINT return_purch_products_return_foreign FOREIGN KEY ("Return") REFERENCES public.return_purches(id) ON DELETE CASCADE;


--
-- Name: return_purch_products return_purch_products_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_purch_products
    ADD CONSTRAINT return_purch_products_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: return_purch_products return_purch_products_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_purch_products
    ADD CONSTRAINT return_purch_products_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: return_purch_products return_purch_products_v1_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_purch_products
    ADD CONSTRAINT return_purch_products_v1_foreign FOREIGN KEY ("V1") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: return_purch_products return_purch_products_v2_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_purch_products
    ADD CONSTRAINT return_purch_products_v2_foreign FOREIGN KEY ("V2") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: return_purches return_purches_purchase_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_purches
    ADD CONSTRAINT return_purches_purchase_foreign FOREIGN KEY ("Purchase") REFERENCES public.purchases(id) ON DELETE CASCADE;


--
-- Name: return_purches return_purches_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_purches
    ADD CONSTRAINT return_purches_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: return_sales_products return_sales_products_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_sales_products
    ADD CONSTRAINT return_sales_products_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: return_sales_products return_sales_products_return_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_sales_products
    ADD CONSTRAINT return_sales_products_return_foreign FOREIGN KEY ("Return") REFERENCES public.return_sales(id) ON DELETE CASCADE;


--
-- Name: return_sales_products return_sales_products_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_sales_products
    ADD CONSTRAINT return_sales_products_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: return_sales_products return_sales_products_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_sales_products
    ADD CONSTRAINT return_sales_products_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: return_sales_products return_sales_products_v1_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_sales_products
    ADD CONSTRAINT return_sales_products_v1_foreign FOREIGN KEY ("V1") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: return_sales_products return_sales_products_v2_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_sales_products
    ADD CONSTRAINT return_sales_products_v2_foreign FOREIGN KEY ("V2") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: return_sales return_sales_sales_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_sales
    ADD CONSTRAINT return_sales_sales_foreign FOREIGN KEY ("Sales") REFERENCES public.sales(id) ON DELETE CASCADE;


--
-- Name: return_sales return_sales_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.return_sales
    ADD CONSTRAINT return_sales_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: role_has_permissions role_has_permissions_role_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.role_has_permissions
    ADD CONSTRAINT role_has_permissions_role_id_foreign FOREIGN KEY (role_id) REFERENCES public.roles(id) ON DELETE CASCADE;


--
-- Name: room_reservations room_reservations_room_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.room_reservations
    ADD CONSTRAINT room_reservations_room_foreign FOREIGN KEY ("Room") REFERENCES public.rooms(id) ON DELETE CASCADE;


--
-- Name: safe_transfers safe_transfers_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.safe_transfers
    ADD CONSTRAINT safe_transfers_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: safe_transfers safe_transfers_cost_center_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.safe_transfers
    ADD CONSTRAINT safe_transfers_cost_center_foreign FOREIGN KEY ("Cost_Center") REFERENCES public.cost_centers(id) ON DELETE CASCADE;


--
-- Name: safe_transfers safe_transfers_from_safe_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.safe_transfers
    ADD CONSTRAINT safe_transfers_from_safe_foreign FOREIGN KEY ("From_Safe") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: safe_transfers safe_transfers_to_safe_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.safe_transfers
    ADD CONSTRAINT safe_transfers_to_safe_foreign FOREIGN KEY ("To_Safe") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: safe_transfers safe_transfers_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.safe_transfers
    ADD CONSTRAINT safe_transfers_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: safes_banks safes_banks_account_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.safes_banks
    ADD CONSTRAINT safes_banks_account_foreign FOREIGN KEY ("Account") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: safes_banks safes_banks_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.safes_banks
    ADD CONSTRAINT safes_banks_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: sales sales_client_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales
    ADD CONSTRAINT sales_client_foreign FOREIGN KEY ("Client") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: sales sales_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales
    ADD CONSTRAINT sales_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: sales sales_cost_center_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales
    ADD CONSTRAINT sales_cost_center_foreign FOREIGN KEY ("Cost_Center") REFERENCES public.cost_centers(id) ON DELETE CASCADE;


--
-- Name: sales_default_data sales_default_data_client_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales_default_data
    ADD CONSTRAINT sales_default_data_client_foreign FOREIGN KEY ("Client") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: sales_default_data sales_default_data_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales_default_data
    ADD CONSTRAINT sales_default_data_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: sales_default_data sales_default_data_delegate_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales_default_data
    ADD CONSTRAINT sales_default_data_delegate_foreign FOREIGN KEY ("Delegate") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: sales_default_data sales_default_data_safe_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales_default_data
    ADD CONSTRAINT sales_default_data_safe_foreign FOREIGN KEY ("Safe") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: sales_default_data sales_default_data_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales_default_data
    ADD CONSTRAINT sales_default_data_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: sales sales_delegate_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales
    ADD CONSTRAINT sales_delegate_foreign FOREIGN KEY ("Delegate") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: sales sales_executor_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales
    ADD CONSTRAINT sales_executor_foreign FOREIGN KEY ("Executor") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: sales_orders sales_orders_client_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales_orders
    ADD CONSTRAINT sales_orders_client_foreign FOREIGN KEY ("Client") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: sales_orders sales_orders_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales_orders
    ADD CONSTRAINT sales_orders_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: sales_orders sales_orders_cost_center_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales_orders
    ADD CONSTRAINT sales_orders_cost_center_foreign FOREIGN KEY ("Cost_Center") REFERENCES public.cost_centers(id) ON DELETE CASCADE;


--
-- Name: sales_orders sales_orders_delegate_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales_orders
    ADD CONSTRAINT sales_orders_delegate_foreign FOREIGN KEY ("Delegate") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: sales_orders sales_orders_executor_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales_orders
    ADD CONSTRAINT sales_orders_executor_foreign FOREIGN KEY ("Executor") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: sales_orders sales_orders_safe_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales_orders
    ADD CONSTRAINT sales_orders_safe_foreign FOREIGN KEY ("Safe") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: sales_orders sales_orders_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales_orders
    ADD CONSTRAINT sales_orders_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: sales_orders sales_orders_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales_orders
    ADD CONSTRAINT sales_orders_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: sales_petrols sales_petrols_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales_petrols
    ADD CONSTRAINT sales_petrols_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: sales_petrols sales_petrols_safe_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales_petrols
    ADD CONSTRAINT sales_petrols_safe_foreign FOREIGN KEY ("Safe") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: sales_petrols sales_petrols_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales_petrols
    ADD CONSTRAINT sales_petrols_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: sales sales_safe_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales
    ADD CONSTRAINT sales_safe_foreign FOREIGN KEY ("Safe") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: sales sales_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales
    ADD CONSTRAINT sales_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: sales_subscribes sales_subscribes_account_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales_subscribes
    ADD CONSTRAINT sales_subscribes_account_foreign FOREIGN KEY ("Account") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: sales_subscribes sales_subscribes_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales_subscribes
    ADD CONSTRAINT sales_subscribes_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: sales_subscribes sales_subscribes_delegate_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales_subscribes
    ADD CONSTRAINT sales_subscribes_delegate_foreign FOREIGN KEY ("Delegate") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: sales_subscribes sales_subscribes_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales_subscribes
    ADD CONSTRAINT sales_subscribes_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: sales sales_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sales
    ADD CONSTRAINT sales_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: secretariat_export_goods secretariat_export_goods_account_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.secretariat_export_goods
    ADD CONSTRAINT secretariat_export_goods_account_foreign FOREIGN KEY ("Account") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: secretariat_export_goods secretariat_export_goods_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.secretariat_export_goods
    ADD CONSTRAINT secretariat_export_goods_store_foreign FOREIGN KEY ("Store") REFERENCES public.secretariat_stores(id) ON DELETE CASCADE;


--
-- Name: secretariat_export_goods secretariat_export_goods_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.secretariat_export_goods
    ADD CONSTRAINT secretariat_export_goods_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: secretariat_import_goods secretariat_import_goods_account_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.secretariat_import_goods
    ADD CONSTRAINT secretariat_import_goods_account_foreign FOREIGN KEY ("Account") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: secretariat_import_goods secretariat_import_goods_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.secretariat_import_goods
    ADD CONSTRAINT secretariat_import_goods_store_foreign FOREIGN KEY ("Store") REFERENCES public.secretariat_stores(id) ON DELETE CASCADE;


--
-- Name: secretariat_import_goods secretariat_import_goods_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.secretariat_import_goods
    ADD CONSTRAINT secretariat_import_goods_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: secretariat_qties secretariat_qties_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.secretariat_qties
    ADD CONSTRAINT secretariat_qties_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: secretariat_qties secretariat_qties_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.secretariat_qties
    ADD CONSTRAINT secretariat_qties_store_foreign FOREIGN KEY ("Store") REFERENCES public.secretariat_stores(id) ON DELETE CASCADE;


--
-- Name: secretariat_qties secretariat_qties_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.secretariat_qties
    ADD CONSTRAINT secretariat_qties_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: secretariat_qties secretariat_qties_v1_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.secretariat_qties
    ADD CONSTRAINT secretariat_qties_v1_foreign FOREIGN KEY ("V1") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: secretariat_qties secretariat_qties_v2_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.secretariat_qties
    ADD CONSTRAINT secretariat_qties_v2_foreign FOREIGN KEY ("V2") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: settlements settlements_account_dificit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.settlements
    ADD CONSTRAINT settlements_account_dificit_foreign FOREIGN KEY ("Account_Dificit") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: settlements settlements_account_excess_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.settlements
    ADD CONSTRAINT settlements_account_excess_foreign FOREIGN KEY ("Account_Excess") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: settlements settlements_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.settlements
    ADD CONSTRAINT settlements_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: settlements settlements_cost_center_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.settlements
    ADD CONSTRAINT settlements_cost_center_foreign FOREIGN KEY ("Cost_Center") REFERENCES public.cost_centers(id) ON DELETE CASCADE;


--
-- Name: settlements settlements_inv_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.settlements
    ADD CONSTRAINT settlements_inv_id_foreign FOREIGN KEY ("Inv_ID") REFERENCES public.inventories(id) ON DELETE CASCADE;


--
-- Name: settlements settlements_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.settlements
    ADD CONSTRAINT settlements_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: settlements settlements_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.settlements
    ADD CONSTRAINT settlements_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: sewing_accessories sewing_accessories_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_accessories
    ADD CONSTRAINT sewing_accessories_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: sewing_accessories sewing_accessories_sewingorder_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_accessories
    ADD CONSTRAINT sewing_accessories_sewingorder_foreign FOREIGN KEY ("SewingOrder") REFERENCES public.sewing_orders(id) ON DELETE CASCADE;


--
-- Name: sewing_al_kabkat sewing_al_kabkat_sewingtype_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_al_kabkat
    ADD CONSTRAINT sewing_al_kabkat_sewingtype_foreign FOREIGN KEY ("SewingType") REFERENCES public.sewing_types(id) ON DELETE CASCADE;


--
-- Name: sewing_al_taktak sewing_al_taktak_sewingtype_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_al_taktak
    ADD CONSTRAINT sewing_al_taktak_sewingtype_foreign FOREIGN KEY ("SewingType") REFERENCES public.sewing_types(id) ON DELETE CASCADE;


--
-- Name: sewing_buttons sewing_buttons_sewingtype_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_buttons
    ADD CONSTRAINT sewing_buttons_sewingtype_foreign FOREIGN KEY ("SewingType") REFERENCES public.sewing_types(id) ON DELETE CASCADE;


--
-- Name: sewing_chest_pocket_fillings sewing_chest_pocket_fillings_sewingtype_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_chest_pocket_fillings
    ADD CONSTRAINT sewing_chest_pocket_fillings_sewingtype_foreign FOREIGN KEY ("SewingType") REFERENCES public.sewing_types(id) ON DELETE CASCADE;


--
-- Name: sewing_chest_pockets sewing_chest_pockets_sewingtype_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_chest_pockets
    ADD CONSTRAINT sewing_chest_pockets_sewingtype_foreign FOREIGN KEY ("SewingType") REFERENCES public.sewing_types(id) ON DELETE CASCADE;


--
-- Name: sewing_collar_paddings sewing_collar_paddings_sewingtype_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_collar_paddings
    ADD CONSTRAINT sewing_collar_paddings_sewingtype_foreign FOREIGN KEY ("SewingType") REFERENCES public.sewing_types(id) ON DELETE CASCADE;


--
-- Name: sewing_collars sewing_collars_sewingtype_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_collars
    ADD CONSTRAINT sewing_collars_sewingtype_foreign FOREIGN KEY ("SewingType") REFERENCES public.sewing_types(id) ON DELETE CASCADE;


--
-- Name: sewing_cseed_sleeves sewing_cseed_sleeves_sewingtype_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_cseed_sleeves
    ADD CONSTRAINT sewing_cseed_sleeves_sewingtype_foreign FOREIGN KEY ("SewingType") REFERENCES public.sewing_types(id) ON DELETE CASCADE;


--
-- Name: sewing_cupcake_fillings sewing_cupcake_fillings_sewingtype_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_cupcake_fillings
    ADD CONSTRAINT sewing_cupcake_fillings_sewingtype_foreign FOREIGN KEY ("SewingType") REFERENCES public.sewing_types(id) ON DELETE CASCADE;


--
-- Name: sewing_embroideries sewing_embroideries_sewingtype_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_embroideries
    ADD CONSTRAINT sewing_embroideries_sewingtype_foreign FOREIGN KEY ("SewingType") REFERENCES public.sewing_types(id) ON DELETE CASCADE;


--
-- Name: sewing_order_modules sewing_order_modules_alkabkat_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_order_modules
    ADD CONSTRAINT sewing_order_modules_alkabkat_foreign FOREIGN KEY ("AlKabkat") REFERENCES public.sewing_al_kabkat(id) ON DELETE CASCADE;


--
-- Name: sewing_order_modules sewing_order_modules_altaktak_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_order_modules
    ADD CONSTRAINT sewing_order_modules_altaktak_foreign FOREIGN KEY ("AlTaktak") REFERENCES public.sewing_al_taktak(id) ON DELETE CASCADE;


--
-- Name: sewing_order_modules sewing_order_modules_buttons_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_order_modules
    ADD CONSTRAINT sewing_order_modules_buttons_foreign FOREIGN KEY ("Buttons") REFERENCES public.sewing_buttons(id) ON DELETE CASCADE;


--
-- Name: sewing_order_modules sewing_order_modules_chestpocket_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_order_modules
    ADD CONSTRAINT sewing_order_modules_chestpocket_foreign FOREIGN KEY ("ChestPocket") REFERENCES public.sewing_chest_pockets(id) ON DELETE CASCADE;


--
-- Name: sewing_order_modules sewing_order_modules_chestpocketfilling_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_order_modules
    ADD CONSTRAINT sewing_order_modules_chestpocketfilling_foreign FOREIGN KEY ("ChestPocketFilling") REFERENCES public.sewing_chest_pocket_fillings(id) ON DELETE CASCADE;


--
-- Name: sewing_order_modules sewing_order_modules_collar_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_order_modules
    ADD CONSTRAINT sewing_order_modules_collar_foreign FOREIGN KEY ("Collar") REFERENCES public.sewing_collars(id) ON DELETE CASCADE;


--
-- Name: sewing_order_modules sewing_order_modules_collarpadding_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_order_modules
    ADD CONSTRAINT sewing_order_modules_collarpadding_foreign FOREIGN KEY ("CollarPadding") REFERENCES public.sewing_collar_paddings(id) ON DELETE CASCADE;


--
-- Name: sewing_order_modules sewing_order_modules_cseedsleeves_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_order_modules
    ADD CONSTRAINT sewing_order_modules_cseedsleeves_foreign FOREIGN KEY ("CseedSleeves") REFERENCES public.sewing_cseed_sleeves(id) ON DELETE CASCADE;


--
-- Name: sewing_order_modules sewing_order_modules_cupcakefilling_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_order_modules
    ADD CONSTRAINT sewing_order_modules_cupcakefilling_foreign FOREIGN KEY ("CupcakeFilling") REFERENCES public.sewing_cupcake_fillings(id) ON DELETE CASCADE;


--
-- Name: sewing_order_modules sewing_order_modules_embroidery_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_order_modules
    ADD CONSTRAINT sewing_order_modules_embroidery_foreign FOREIGN KEY ("Embroidery") REFERENCES public.sewing_embroideries(id) ON DELETE CASCADE;


--
-- Name: sewing_order_modules sewing_order_modules_seedfilling_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_order_modules
    ADD CONSTRAINT sewing_order_modules_seedfilling_foreign FOREIGN KEY ("SeedFilling") REFERENCES public.sewing_seed_fillings(id) ON DELETE CASCADE;


--
-- Name: sewing_order_modules sewing_order_modules_seeds_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_order_modules
    ADD CONSTRAINT sewing_order_modules_seeds_foreign FOREIGN KEY ("Seeds") REFERENCES public.sewing_seeds(id) ON DELETE CASCADE;


--
-- Name: sewing_order_modules sewing_order_modules_sewingorder_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_order_modules
    ADD CONSTRAINT sewing_order_modules_sewingorder_foreign FOREIGN KEY ("SewingOrder") REFERENCES public.sewing_orders(id) ON DELETE CASCADE;


--
-- Name: sewing_order_modules sewing_order_modules_sidepocket_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_order_modules
    ADD CONSTRAINT sewing_order_modules_sidepocket_foreign FOREIGN KEY ("SidePocket") REFERENCES public.sewing_side_pockets(id) ON DELETE CASCADE;


--
-- Name: sewing_order_modules sewing_order_modules_sleeves_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_order_modules
    ADD CONSTRAINT sewing_order_modules_sleeves_foreign FOREIGN KEY ("Sleeves") REFERENCES public.sewing_sleeves(id) ON DELETE CASCADE;


--
-- Name: sewing_orders sewing_orders_branch_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_orders
    ADD CONSTRAINT sewing_orders_branch_foreign FOREIGN KEY ("Branch") REFERENCES public.branches(id) ON DELETE CASCADE;


--
-- Name: sewing_orders sewing_orders_client_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_orders
    ADD CONSTRAINT sewing_orders_client_foreign FOREIGN KEY ("Client") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: sewing_orders sewing_orders_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_orders
    ADD CONSTRAINT sewing_orders_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: sewing_orders sewing_orders_cost_center_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_orders
    ADD CONSTRAINT sewing_orders_cost_center_foreign FOREIGN KEY ("Cost_Center") REFERENCES public.cost_centers(id) ON DELETE CASCADE;


--
-- Name: sewing_orders sewing_orders_delegate_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_orders
    ADD CONSTRAINT sewing_orders_delegate_foreign FOREIGN KEY ("Delegate") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: sewing_orders sewing_orders_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_orders
    ADD CONSTRAINT sewing_orders_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: sewing_orders sewing_orders_recivedbranch_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_orders
    ADD CONSTRAINT sewing_orders_recivedbranch_foreign FOREIGN KEY ("RecivedBranch") REFERENCES public.branches(id) ON DELETE CASCADE;


--
-- Name: sewing_orders sewing_orders_safe_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_orders
    ADD CONSTRAINT sewing_orders_safe_foreign FOREIGN KEY ("Safe") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: sewing_orders sewing_orders_sewingtype_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_orders
    ADD CONSTRAINT sewing_orders_sewingtype_foreign FOREIGN KEY ("SewingType") REFERENCES public.sewing_types(id) ON DELETE CASCADE;


--
-- Name: sewing_orders sewing_orders_taxtype_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_orders
    ADD CONSTRAINT sewing_orders_taxtype_foreign FOREIGN KEY ("TaxType") REFERENCES public.taxes(id) ON DELETE CASCADE;


--
-- Name: sewing_request_details sewing_request_details_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_request_details
    ADD CONSTRAINT sewing_request_details_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: sewing_request_details sewing_request_details_sewingrequest_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_request_details
    ADD CONSTRAINT sewing_request_details_sewingrequest_foreign FOREIGN KEY ("SewingRequest") REFERENCES public.sewing_requests(id) ON DELETE CASCADE;


--
-- Name: sewing_request_details sewing_request_details_type_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_request_details
    ADD CONSTRAINT sewing_request_details_type_foreign FOREIGN KEY ("Type") REFERENCES public.sewing_types(id) ON DELETE CASCADE;


--
-- Name: sewing_requests sewing_requests_branch_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_requests
    ADD CONSTRAINT sewing_requests_branch_foreign FOREIGN KEY ("Branch") REFERENCES public.branches(id) ON DELETE CASCADE;


--
-- Name: sewing_requests sewing_requests_client_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_requests
    ADD CONSTRAINT sewing_requests_client_foreign FOREIGN KEY ("Client") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: sewing_requests sewing_requests_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_requests
    ADD CONSTRAINT sewing_requests_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: sewing_requests sewing_requests_cost_center_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_requests
    ADD CONSTRAINT sewing_requests_cost_center_foreign FOREIGN KEY ("Cost_Center") REFERENCES public.cost_centers(id) ON DELETE CASCADE;


--
-- Name: sewing_requests sewing_requests_delegate_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_requests
    ADD CONSTRAINT sewing_requests_delegate_foreign FOREIGN KEY ("Delegate") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: sewing_requests sewing_requests_outsidesewingtype_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_requests
    ADD CONSTRAINT sewing_requests_outsidesewingtype_foreign FOREIGN KEY ("OutsideSewingType") REFERENCES public.sewing_types(id) ON DELETE SET NULL;


--
-- Name: sewing_requests sewing_requests_recivedbranch_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_requests
    ADD CONSTRAINT sewing_requests_recivedbranch_foreign FOREIGN KEY ("RecivedBranch") REFERENCES public.branches(id) ON DELETE CASCADE;


--
-- Name: sewing_requests sewing_requests_safe_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_requests
    ADD CONSTRAINT sewing_requests_safe_foreign FOREIGN KEY ("Safe") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: sewing_requests sewing_requests_sewingorderid_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_requests
    ADD CONSTRAINT sewing_requests_sewingorderid_foreign FOREIGN KEY ("SewingOrderID") REFERENCES public.sewing_orders(id) ON DELETE SET NULL;


--
-- Name: sewing_requests sewing_requests_taxtype_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_requests
    ADD CONSTRAINT sewing_requests_taxtype_foreign FOREIGN KEY ("TaxType") REFERENCES public.taxes(id) ON DELETE CASCADE;


--
-- Name: sewing_requests sewing_requests_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_requests
    ADD CONSTRAINT sewing_requests_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: sewing_seed_fillings sewing_seed_fillings_sewingtype_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_seed_fillings
    ADD CONSTRAINT sewing_seed_fillings_sewingtype_foreign FOREIGN KEY ("SewingType") REFERENCES public.sewing_types(id) ON DELETE CASCADE;


--
-- Name: sewing_seeds sewing_seeds_sewingtype_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_seeds
    ADD CONSTRAINT sewing_seeds_sewingtype_foreign FOREIGN KEY ("SewingType") REFERENCES public.sewing_types(id) ON DELETE CASCADE;


--
-- Name: sewing_side_pockets sewing_side_pockets_sewingtype_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_side_pockets
    ADD CONSTRAINT sewing_side_pockets_sewingtype_foreign FOREIGN KEY ("SewingType") REFERENCES public.sewing_types(id) ON DELETE CASCADE;


--
-- Name: sewing_sleeves sewing_sleeves_sewingtype_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sewing_sleeves
    ADD CONSTRAINT sewing_sleeves_sewingtype_foreign FOREIGN KEY ("SewingType") REFERENCES public.sewing_types(id) ON DELETE CASCADE;


--
-- Name: shifts shifts_emp_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.shifts
    ADD CONSTRAINT shifts_emp_foreign FOREIGN KEY ("Emp") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: shifts shifts_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.shifts
    ADD CONSTRAINT shifts_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: shipments_distribution_goods shipments_distribution_goods_shipmentsdistribution_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.shipments_distribution_goods
    ADD CONSTRAINT shipments_distribution_goods_shipmentsdistribution_foreign FOREIGN KEY ("ShipmentsDistribution") REFERENCES public.shipments_distributions(id) ON DELETE CASCADE;


--
-- Name: shipping_companies shipping_companies_account_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.shipping_companies
    ADD CONSTRAINT shipping_companies_account_foreign FOREIGN KEY ("Account") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: shipping_orders shipping_orders_client_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.shipping_orders
    ADD CONSTRAINT shipping_orders_client_foreign FOREIGN KEY ("Client") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: shipping_orders shipping_orders_delegate_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.shipping_orders
    ADD CONSTRAINT shipping_orders_delegate_foreign FOREIGN KEY ("Delegate") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: shipping_orders shipping_orders_status_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.shipping_orders
    ADD CONSTRAINT shipping_orders_status_foreign FOREIGN KEY ("Status") REFERENCES public.shipping_statuses(id) ON DELETE CASCADE;


--
-- Name: shipping_orders shipping_orders_type_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.shipping_orders
    ADD CONSTRAINT shipping_orders_type_foreign FOREIGN KEY ("Type") REFERENCES public.shipping_types(id) ON DELETE CASCADE;


--
-- Name: shipping_orders shipping_orders_vendor_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.shipping_orders
    ADD CONSTRAINT shipping_orders_vendor_foreign FOREIGN KEY ("Vendor") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: shortcomings shortcomings_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.shortcomings
    ADD CONSTRAINT shortcomings_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: shortcomings shortcomings_cost_center_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.shortcomings
    ADD CONSTRAINT shortcomings_cost_center_foreign FOREIGN KEY ("Cost_Center") REFERENCES public.cost_centers(id) ON DELETE CASCADE;


--
-- Name: shortcomings shortcomings_delegate_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.shortcomings
    ADD CONSTRAINT shortcomings_delegate_foreign FOREIGN KEY ("Delegate") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
-- Name: shortcomings shortcomings_safe_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.shortcomings
    ADD CONSTRAINT shortcomings_safe_foreign FOREIGN KEY ("Safe") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: shortcomings shortcomings_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.shortcomings
    ADD CONSTRAINT shortcomings_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: shortcomings shortcomings_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.shortcomings
    ADD CONSTRAINT shortcomings_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: shortcomings shortcomings_vendor_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.shortcomings
    ADD CONSTRAINT shortcomings_vendor_foreign FOREIGN KEY ("Vendor") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: spend_profits spend_profits_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.spend_profits
    ADD CONSTRAINT spend_profits_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: spend_profits spend_profits_cost_center_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.spend_profits
    ADD CONSTRAINT spend_profits_cost_center_foreign FOREIGN KEY ("Cost_Center") REFERENCES public.cost_centers(id) ON DELETE CASCADE;


--
-- Name: spend_profits spend_profits_partner_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.spend_profits
    ADD CONSTRAINT spend_profits_partner_foreign FOREIGN KEY ("Partner") REFERENCES public.partners(id) ON DELETE CASCADE;


--
-- Name: spend_profits spend_profits_safe_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.spend_profits
    ADD CONSTRAINT spend_profits_safe_foreign FOREIGN KEY ("Safe") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: spend_profits spend_profits_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.spend_profits
    ADD CONSTRAINT spend_profits_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: start_periods start_periods_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.start_periods
    ADD CONSTRAINT start_periods_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: start_periods start_periods_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.start_periods
    ADD CONSTRAINT start_periods_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: start_periods start_periods_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.start_periods
    ADD CONSTRAINT start_periods_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: stores stores_account_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.stores
    ADD CONSTRAINT stores_account_foreign FOREIGN KEY ("Account") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: stores_default_data stores_default_data_account_dificit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.stores_default_data
    ADD CONSTRAINT stores_default_data_account_dificit_foreign FOREIGN KEY ("Account_Dificit") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: stores_default_data stores_default_data_account_excess_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.stores_default_data
    ADD CONSTRAINT stores_default_data_account_excess_foreign FOREIGN KEY ("Account_Excess") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: stores_default_data stores_default_data_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.stores_default_data
    ADD CONSTRAINT stores_default_data_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: stores_default_data stores_default_data_group_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.stores_default_data
    ADD CONSTRAINT stores_default_data_group_foreign FOREIGN KEY ("Group") REFERENCES public.items_groups(id) ON DELETE CASCADE;


--
-- Name: stores_default_data stores_default_data_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.stores_default_data
    ADD CONSTRAINT stores_default_data_store_foreign FOREIGN KEY ("Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: stores_default_data stores_default_data_tax_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.stores_default_data
    ADD CONSTRAINT stores_default_data_tax_foreign FOREIGN KEY ("Tax") REFERENCES public.taxes(id) ON DELETE CASCADE;


--
-- Name: stores_default_data stores_default_data_unit_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.stores_default_data
    ADD CONSTRAINT stores_default_data_unit_foreign FOREIGN KEY ("Unit") REFERENCES public.measuerments(id) ON DELETE CASCADE;


--
-- Name: stores stores_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.stores
    ADD CONSTRAINT stores_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: stors_transfers stors_transfers_coin_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.stors_transfers
    ADD CONSTRAINT stors_transfers_coin_foreign FOREIGN KEY ("Coin") REFERENCES public.coins(id) ON DELETE CASCADE;


--
-- Name: stors_transfers stors_transfers_cost_center_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.stors_transfers
    ADD CONSTRAINT stors_transfers_cost_center_foreign FOREIGN KEY ("Cost_Center") REFERENCES public.cost_centers(id) ON DELETE CASCADE;


--
-- Name: stors_transfers stors_transfers_from_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.stors_transfers
    ADD CONSTRAINT stors_transfers_from_store_foreign FOREIGN KEY ("From_Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: stors_transfers stors_transfers_to_store_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.stors_transfers
    ADD CONSTRAINT stors_transfers_to_store_foreign FOREIGN KEY ("To_Store") REFERENCES public.stores(id) ON DELETE CASCADE;


--
-- Name: stors_transfers stors_transfers_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.stors_transfers
    ADD CONSTRAINT stors_transfers_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: sub_images sub_images_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sub_images
    ADD CONSTRAINT sub_images_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: sub_virables sub_virables_v_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sub_virables
    ADD CONSTRAINT sub_virables_v_id_foreign FOREIGN KEY ("V_ID") REFERENCES public.virables(id) ON DELETE CASCADE;


--
-- Name: unloading_shipments_goods unloading_shipments_goods_shipmentsunloading_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.unloading_shipments_goods
    ADD CONSTRAINT unloading_shipments_goods_shipmentsunloading_foreign FOREIGN KEY ("ShipmentsUnloading") REFERENCES public.unloading_shipments(id) ON DELETE CASCADE;


--
-- Name: users_moves users_moves_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.users_moves
    ADD CONSTRAINT users_moves_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: v_a_prices v_a_prices_mainv_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.v_a_prices
    ADD CONSTRAINT v_a_prices_mainv_foreign FOREIGN KEY ("MainV") REFERENCES public.virables(id) ON DELETE CASCADE;


--
-- Name: v_a_prices v_a_prices_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.v_a_prices
    ADD CONSTRAINT v_a_prices_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: v_a_prices v_a_prices_subv_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.v_a_prices
    ADD CONSTRAINT v_a_prices_subv_foreign FOREIGN KEY ("SubV") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: v_a_products v_a_products_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.v_a_products
    ADD CONSTRAINT v_a_products_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: v_a_products v_a_products_productid_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.v_a_products
    ADD CONSTRAINT v_a_products_productid_foreign FOREIGN KEY ("ProductID") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: v_a_qties v_a_qties_mainv_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.v_a_qties
    ADD CONSTRAINT v_a_qties_mainv_foreign FOREIGN KEY ("MainV") REFERENCES public.virables(id) ON DELETE CASCADE;


--
-- Name: v_a_qties v_a_qties_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.v_a_qties
    ADD CONSTRAINT v_a_qties_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: v_a_qties v_a_qties_productid_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.v_a_qties
    ADD CONSTRAINT v_a_qties_productid_foreign FOREIGN KEY ("ProductID") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: v_a_qties v_a_qties_subv_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.v_a_qties
    ADD CONSTRAINT v_a_qties_subv_foreign FOREIGN KEY ("SubV") REFERENCES public.sub_virables(id) ON DELETE CASCADE;


--
-- Name: v_a_qties v_a_qties_vaproductid_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.v_a_qties
    ADD CONSTRAINT v_a_qties_vaproductid_foreign FOREIGN KEY ("VAProductID") REFERENCES public.v_a_products(id) ON DELETE CASCADE;


--
-- Name: vendors vendors_account_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.vendors
    ADD CONSTRAINT vendors_account_foreign FOREIGN KEY ("Account") REFERENCES public.acccounting_manuals(id) ON DELETE CASCADE;


--
-- Name: vendors vendors_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.vendors
    ADD CONSTRAINT vendors_user_foreign FOREIGN KEY ("User") REFERENCES public.admins(id) ON DELETE CASCADE;


--
-- Name: wishlists wishlists_product_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.wishlists
    ADD CONSTRAINT wishlists_product_foreign FOREIGN KEY ("Product") REFERENCES public.products(id) ON DELETE CASCADE;


--
-- Name: wishlists wishlists_user_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.wishlists
    ADD CONSTRAINT wishlists_user_foreign FOREIGN KEY ("User") REFERENCES public.customers(id) ON DELETE CASCADE;


--
-- Name: workers_sales_petrols workers_sales_petrols_salespetrol_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.workers_sales_petrols
    ADD CONSTRAINT workers_sales_petrols_salespetrol_foreign FOREIGN KEY ("SalesPetrol") REFERENCES public.sales_petrols(id) ON DELETE CASCADE;


--
-- Name: workers_sales_petrols workers_sales_petrols_worker_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.workers_sales_petrols
    ADD CONSTRAINT workers_sales_petrols_worker_foreign FOREIGN KEY ("Worker") REFERENCES public.employesses(id) ON DELETE CASCADE;


--
--

