That’s an unusual error, the plugin should automatically create its database tables during activation. Could you please try deactivating the plugin and then activating it again? This will trigger the table creation process.
Thank you. I tried id. But not working.
I find another Error in the Plugin Activation Process. Maybe it helps:
AH01071: Got error 'PHP message: WordPress database error Invalid default value for 'date_created' for query CREATE TABLE dptvndp_price_alerts_subscriptions (\n\t\t\tid BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,\n\t\t\t\n\t\t\t-- Product info\n\t\t\tproduct_id BIGINT(20) UNSIGNED NOT NULL,\n\t\t\tproduct_type VARCHAR(20) NULL,\n\t\t\tproduct_price DECIMAL(10,2) NOT NULL,\n\t\t\tcurrency VARCHAR(3) NULL,\n\t\t\ttarget_price DECIMAL(10,2) NULL,\n\t\t\n\t\t\t-- User info\n\t\t\tname VARCHAR(120) NULL,\n\t\t\temail VARCHAR(120) NOT NULL,\n\t\t\topt_in TINYINT(1) UNSIGNED NULL,\n\t\t\tmarketing TINYINT(1) UNSIGNED NULL,\n\t\t\n\t\t\t-- Tracking / extra data\n\t\t\tsecurity_token VARCHAR(255) NULL,\n\t\t\tcustom_input VARCHAR(255) NULL,\n\t\t\tcustom_data TEXT NULL,\n\t\t\n\t\t\t-- Status & timestamps\n\t\t\tstatus VARCHAR(20) NULL,\n\t\t\tnotification_date DATETIME NULL,\n\t\t\tdate_created DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,\n\t\t\n\t\t\tPRIMARY KEY (id),\n\t\t\tINDEX (product_id),\n\t\t\tINDEX (email),\n\t\t\tINDEX (status),\n\t\t\tCONSTRAINT email_product_unique UNIQUE (email, product_id)\n\t\t) DEFAULT CHARACTER SET utf8mb4 COLLATE...; PHP message: WordPress database error Can't create table 'wp_hfdso.dptvndp_price_alerts_meta' (errno: 150) for query CREATE TABLE dptvndp_price_alerts_meta (\n\t\t\tid BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,\n\t\t\tsubscribe_id BIGINT(20) UNSIGNED NOT NULL,\n\t\t\tmeta_key VARCHAR(100) NOT NULL,\n\t\t\tmeta_value TEXT NOT NULL,\n\t\t\tPRIMARY KEY (id),\n\t\t\tINDEX (subscribe_id),\n\t\t\tFOREIGN KEY (subscribe_id) REFERENCES dptvndp_price_alerts_subscriptions(id) ON DELETE CASCADE\n\t\t) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci made by activate_plugin, do_action('activate_price-alerts/price-alerts.php'), WP_Hook->do_action, WP_Hook->apply_filters, activate_devnet_price_alerts, Devnet\\PriceAlerts\\Includes\\Activator::activate, Devnet\\PriceAlerts\\Includes\\Activator::setup_db_tables, Devnet\\PriceAlerts\\Includes\\Activator::setup_price_alerts_meta_db_table, dbDelta', referer: https://xxx.de/wp-admin/plugins.php?plugin_status=all&paged=1&s
Thanks for reporting this!
The issue might be related with how MySQL is configured on your server. Some setups don’t allow a DATETIME column to use DEFAULT CURRENT_TIMESTAMP. Because of that, the first table wasn’t created and the second one (with the foreign key) failed too.
If you’re comfortable editing code, find a file located:
/price-alerts/includes/activator.php
and change this line
date_created DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
to
date_created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
Then deactivate and activate the plugin again to re-run table creation.
We’ll include this fix in the next release so it works on all setups.
Thanks again!
Now it works 🙂
Thank you very much
Great to hear it’s working now 🙂 The new version is already released. Thanks for letting me know!