ds (coupon_id, form_id) ) $charset_collate;" ); } /** * Create table for coupon usage table by form. * * @since 1.2.0 */ private function create_coupons_forms_usage_table() { require_once ABSPATH . 'wp-admin/includes/upgrade.php'; global $wpdb; $table = $wpdb->prefix . 'wpforms_coupons_forms_usage'; $charset_collate = $wpdb->get_charset_collate(); dbDelta( "CREATE TABLE {$table} ( coupon_id BIGINT UNSIGNED NOT NULL, form_id BIGINT UNSIGNED NOT NULL, payments_count MEDIUMINT UNSIGNED NOT NULL DEFAULT 0, usage_count MEDIUMINT UNSIGNED NOT NULL DEFAULT 0, UNIQUE KEY coupon_form_ids (coupon_id, form_id) ) {$charset_collate};" ); } }