@@ 890-949 (lines=60) @@ | ||
887 | * |
|
888 | * @param Schema $schema |
|
889 | */ |
|
890 | protected function addOrocrmMagentoOrderForeignKeys(Schema $schema) |
|
891 | { |
|
892 | $table = $schema->getTable('orocrm_magento_order'); |
|
893 | $table->addForeignKeyConstraint( |
|
894 | $schema->getTable('orocrm_magento_customer'), |
|
895 | ['customer_id'], |
|
896 | ['id'], |
|
897 | ['onDelete' => 'SET NULL'] |
|
898 | ); |
|
899 | $table->addForeignKeyConstraint( |
|
900 | $schema->getTable('orocrm_magento_store'), |
|
901 | ['store_id'], |
|
902 | ['id'], |
|
903 | ['onDelete' => 'SET NULL'] |
|
904 | ); |
|
905 | $table->addForeignKeyConstraint( |
|
906 | $schema->getTable('orocrm_magento_cart'), |
|
907 | ['cart_id'], |
|
908 | ['id'], |
|
909 | [] |
|
910 | ); |
|
911 | $table->addForeignKeyConstraint( |
|
912 | $schema->getTable('oro_workflow_item'), |
|
913 | ['workflow_item_id'], |
|
914 | ['id'], |
|
915 | ['onDelete' => 'SET NULL'] |
|
916 | ); |
|
917 | $table->addForeignKeyConstraint( |
|
918 | $schema->getTable('oro_workflow_step'), |
|
919 | ['workflow_step_id'], |
|
920 | ['id'], |
|
921 | ['onDelete' => 'SET NULL'] |
|
922 | ); |
|
923 | $table->addForeignKeyConstraint( |
|
924 | $schema->getTable('oro_user'), |
|
925 | ['user_owner_id'], |
|
926 | ['id'], |
|
927 | ['onDelete' => 'SET NULL'] |
|
928 | ); |
|
929 | $table->addForeignKeyConstraint( |
|
930 | $schema->getTable('oro_integration_channel'), |
|
931 | ['channel_id'], |
|
932 | ['id'], |
|
933 | ['onDelete' => 'SET NULL'] |
|
934 | ); |
|
935 | $table->addForeignKeyConstraint( |
|
936 | $schema->getTable('orocrm_channel'), |
|
937 | ['data_channel_id'], |
|
938 | ['id'], |
|
939 | ['onDelete' => 'SET NULL', 'onUpdate' => null], |
|
940 | 'FK_4D09F305BDC09B73' |
|
941 | ); |
|
942 | $table->addForeignKeyConstraint( |
|
943 | $schema->getTable('oro_organization'), |
|
944 | ['organization_id'], |
|
945 | ['id'], |
|
946 | ['onDelete' => 'SET NULL', 'onUpdate' => null], |
|
947 | 'FK_4D09F30532C8A3DE' |
|
948 | ); |
|
949 | } |
|
950 | ||
951 | /** |
|
952 | * Add orocrm_magento_order_emails foreign keys. |
|
@@ 994-1053 (lines=60) @@ | ||
991 | * |
|
992 | * @param Schema $schema |
|
993 | */ |
|
994 | protected function addOrocrmMagentoCustomerForeignKeys(Schema $schema) |
|
995 | { |
|
996 | $table = $schema->getTable('orocrm_magento_customer'); |
|
997 | $table->addForeignKeyConstraint( |
|
998 | $schema->getTable('orocrm_magento_website'), |
|
999 | ['website_id'], |
|
1000 | ['id'], |
|
1001 | ['onDelete' => 'SET NULL'] |
|
1002 | ); |
|
1003 | $table->addForeignKeyConstraint( |
|
1004 | $schema->getTable('orocrm_magento_store'), |
|
1005 | ['store_id'], |
|
1006 | ['id'], |
|
1007 | ['onDelete' => 'SET NULL'] |
|
1008 | ); |
|
1009 | $table->addForeignKeyConstraint( |
|
1010 | $schema->getTable('orocrm_magento_customer_group'), |
|
1011 | ['customer_group_id'], |
|
1012 | ['id'], |
|
1013 | ['onDelete' => 'SET NULL'] |
|
1014 | ); |
|
1015 | $table->addForeignKeyConstraint( |
|
1016 | $schema->getTable('orocrm_contact'), |
|
1017 | ['contact_id'], |
|
1018 | ['id'], |
|
1019 | ['onDelete' => 'SET NULL'] |
|
1020 | ); |
|
1021 | $table->addForeignKeyConstraint( |
|
1022 | $schema->getTable('orocrm_account'), |
|
1023 | ['account_id'], |
|
1024 | ['id'], |
|
1025 | ['onDelete' => 'SET NULL'] |
|
1026 | ); |
|
1027 | $table->addForeignKeyConstraint( |
|
1028 | $schema->getTable('oro_user'), |
|
1029 | ['user_owner_id'], |
|
1030 | ['id'], |
|
1031 | ['onDelete' => 'SET NULL'] |
|
1032 | ); |
|
1033 | $table->addForeignKeyConstraint( |
|
1034 | $schema->getTable('oro_integration_channel'), |
|
1035 | ['channel_id'], |
|
1036 | ['id'], |
|
1037 | ['onDelete' => 'SET NULL'] |
|
1038 | ); |
|
1039 | $table->addForeignKeyConstraint( |
|
1040 | $schema->getTable('orocrm_channel'), |
|
1041 | ['data_channel_id'], |
|
1042 | ['id'], |
|
1043 | ['onDelete' => 'SET NULL', 'onUpdate' => null], |
|
1044 | 'FK_2A61EE7DBDC09B73' |
|
1045 | ); |
|
1046 | $table->addForeignKeyConstraint( |
|
1047 | $schema->getTable('oro_organization'), |
|
1048 | ['organization_id'], |
|
1049 | ['id'], |
|
1050 | ['onDelete' => 'SET NULL', 'onUpdate' => null], |
|
1051 | 'FK_2A61EE7D32C8A3DE' |
|
1052 | ); |
|
1053 | } |
|
1054 | ||
1055 | /** |
|
1056 | * Add orocrm_magento_cart_item foreign keys. |