| @@ 920-979 (lines=60) @@ | ||
| 917 | * |
|
| 918 | * @param Schema $schema |
|
| 919 | */ |
|
| 920 | protected function addOrocrmMagentoOrderForeignKeys(Schema $schema) |
|
| 921 | { |
|
| 922 | $table = $schema->getTable('orocrm_magento_order'); |
|
| 923 | $table->addForeignKeyConstraint( |
|
| 924 | $schema->getTable('orocrm_magento_customer'), |
|
| 925 | ['customer_id'], |
|
| 926 | ['id'], |
|
| 927 | ['onDelete' => 'SET NULL'] |
|
| 928 | ); |
|
| 929 | $table->addForeignKeyConstraint( |
|
| 930 | $schema->getTable('orocrm_magento_store'), |
|
| 931 | ['store_id'], |
|
| 932 | ['id'], |
|
| 933 | ['onDelete' => 'SET NULL'] |
|
| 934 | ); |
|
| 935 | $table->addForeignKeyConstraint( |
|
| 936 | $schema->getTable('orocrm_magento_cart'), |
|
| 937 | ['cart_id'], |
|
| 938 | ['id'], |
|
| 939 | [] |
|
| 940 | ); |
|
| 941 | $table->addForeignKeyConstraint( |
|
| 942 | $schema->getTable('oro_workflow_item'), |
|
| 943 | ['workflow_item_id'], |
|
| 944 | ['id'], |
|
| 945 | ['onDelete' => 'SET NULL'] |
|
| 946 | ); |
|
| 947 | $table->addForeignKeyConstraint( |
|
| 948 | $schema->getTable('oro_workflow_step'), |
|
| 949 | ['workflow_step_id'], |
|
| 950 | ['id'], |
|
| 951 | ['onDelete' => 'SET NULL'] |
|
| 952 | ); |
|
| 953 | $table->addForeignKeyConstraint( |
|
| 954 | $schema->getTable('oro_user'), |
|
| 955 | ['user_owner_id'], |
|
| 956 | ['id'], |
|
| 957 | ['onDelete' => 'SET NULL'] |
|
| 958 | ); |
|
| 959 | $table->addForeignKeyConstraint( |
|
| 960 | $schema->getTable('oro_integration_channel'), |
|
| 961 | ['channel_id'], |
|
| 962 | ['id'], |
|
| 963 | ['onDelete' => 'SET NULL'] |
|
| 964 | ); |
|
| 965 | $table->addForeignKeyConstraint( |
|
| 966 | $schema->getTable('orocrm_channel'), |
|
| 967 | ['data_channel_id'], |
|
| 968 | ['id'], |
|
| 969 | ['onDelete' => 'SET NULL', 'onUpdate' => null], |
|
| 970 | 'FK_4D09F305BDC09B73' |
|
| 971 | ); |
|
| 972 | $table->addForeignKeyConstraint( |
|
| 973 | $schema->getTable('oro_organization'), |
|
| 974 | ['organization_id'], |
|
| 975 | ['id'], |
|
| 976 | ['onDelete' => 'SET NULL', 'onUpdate' => null], |
|
| 977 | 'FK_4D09F30532C8A3DE' |
|
| 978 | ); |
|
| 979 | } |
|
| 980 | ||
| 981 | /** |
|
| 982 | * Add orocrm_magento_order_calls foreign keys. |
|
| @@ 1046-1105 (lines=60) @@ | ||
| 1043 | * |
|
| 1044 | * @param Schema $schema |
|
| 1045 | */ |
|
| 1046 | protected function addOrocrmMagentoCustomerForeignKeys(Schema $schema) |
|
| 1047 | { |
|
| 1048 | $table = $schema->getTable('orocrm_magento_customer'); |
|
| 1049 | $table->addForeignKeyConstraint( |
|
| 1050 | $schema->getTable('orocrm_magento_website'), |
|
| 1051 | ['website_id'], |
|
| 1052 | ['id'], |
|
| 1053 | ['onDelete' => 'SET NULL'] |
|
| 1054 | ); |
|
| 1055 | $table->addForeignKeyConstraint( |
|
| 1056 | $schema->getTable('orocrm_magento_store'), |
|
| 1057 | ['store_id'], |
|
| 1058 | ['id'], |
|
| 1059 | ['onDelete' => 'SET NULL'] |
|
| 1060 | ); |
|
| 1061 | $table->addForeignKeyConstraint( |
|
| 1062 | $schema->getTable('orocrm_magento_customer_group'), |
|
| 1063 | ['customer_group_id'], |
|
| 1064 | ['id'], |
|
| 1065 | ['onDelete' => 'SET NULL'] |
|
| 1066 | ); |
|
| 1067 | $table->addForeignKeyConstraint( |
|
| 1068 | $schema->getTable('orocrm_contact'), |
|
| 1069 | ['contact_id'], |
|
| 1070 | ['id'], |
|
| 1071 | ['onDelete' => 'SET NULL'] |
|
| 1072 | ); |
|
| 1073 | $table->addForeignKeyConstraint( |
|
| 1074 | $schema->getTable('orocrm_account'), |
|
| 1075 | ['account_id'], |
|
| 1076 | ['id'], |
|
| 1077 | ['onDelete' => 'SET NULL'] |
|
| 1078 | ); |
|
| 1079 | $table->addForeignKeyConstraint( |
|
| 1080 | $schema->getTable('oro_user'), |
|
| 1081 | ['user_owner_id'], |
|
| 1082 | ['id'], |
|
| 1083 | ['onDelete' => 'SET NULL'] |
|
| 1084 | ); |
|
| 1085 | $table->addForeignKeyConstraint( |
|
| 1086 | $schema->getTable('oro_integration_channel'), |
|
| 1087 | ['channel_id'], |
|
| 1088 | ['id'], |
|
| 1089 | ['onDelete' => 'SET NULL'] |
|
| 1090 | ); |
|
| 1091 | $table->addForeignKeyConstraint( |
|
| 1092 | $schema->getTable('orocrm_channel'), |
|
| 1093 | ['data_channel_id'], |
|
| 1094 | ['id'], |
|
| 1095 | ['onDelete' => 'SET NULL', 'onUpdate' => null], |
|
| 1096 | 'FK_2A61EE7DBDC09B73' |
|
| 1097 | ); |
|
| 1098 | $table->addForeignKeyConstraint( |
|
| 1099 | $schema->getTable('oro_organization'), |
|
| 1100 | ['organization_id'], |
|
| 1101 | ['id'], |
|
| 1102 | ['onDelete' => 'SET NULL', 'onUpdate' => null], |
|
| 1103 | 'FK_2A61EE7D32C8A3DE' |
|
| 1104 | ); |
|
| 1105 | } |
|
| 1106 | ||
| 1107 | /** |
|
| 1108 | * Add orocrm_magento_cart_item foreign keys. |
|