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