Hi agrolsy, I stumbled over this too.
problem is there are two bugs in the sql querry:
When you open the woocommerce-gift-coupon.php you have to change it like that:
$sql = ‘CREATE TABLE IF NOT EXISTS ‘ . $table . ‘(
id_user BIGINT(20) UNSIGNED NOT NULL,
id_coupon BIGINT(20) UNSIGNED NOT NULL,
id_order BIGINT(20) UNSIGNED NOT NULL,
KEY woocomerce_key_user_generate_coupons (id_user),
KEY woocomerce_key_coupon_generate_coupons (id_coupon),
KEY woocomerce_key_order_generate_coupons (id_order),
FOREIGN KEY (id_user) REFERENCES ‘ . $wpdb->base_prefix . ‘users(ID) ON DELETE CASCADE,
FOREIGN KEY (id_coupon) REFERENCES ‘ . $wpdb->prefix . ‘posts(ID) ON DELETE CASCADE,
FOREIGN KEY (id_order) REFERENCES ‘ . $wpdb->prefix . ‘woocommerce_order_items(order_id) ON DELETE CASCADE
)CHARACTER SET utf8 COLLATE utf8_general_ci’;
1. I changed the way $table is set as otherwise you just create a table named “$table”
2. I changed the database prefix for the user table $wpdb->base_prefix . ‘users(ID). This is because for multisites there is not extra user table. All use the base-sites user table. Thus the prefix has to link to the base table.
Btw: I guess your manual creation did fail bc your wordpress db prefix seems “s5s8zrr” but you tried it with: “wp”
cheers!