From c41fb4d463e2ea2305393367424409351339626c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Schild?= Date: Thu, 9 Nov 2023 09:16:32 +0100 Subject: [PATCH] Allow NULL values in more columns Release 1.0.4 --- Changelog.MD | 4 ++++ churchtools-wpcalendarsync.php | 16 ++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Changelog.MD b/Changelog.MD index cf7a07b..37faede 100644 --- a/Changelog.MD +++ b/Changelog.MD @@ -1,4 +1,8 @@ # churchtools-wp-calendarsync changelog +## 2023-11-09 +- Release v1.0.4 +- Allow NULL values in more columns + ## 2023-11-07 - Release v1.0.3 - Fix versioning diff --git a/churchtools-wpcalendarsync.php b/churchtools-wpcalendarsync.php index 30df8b5..c3772e9 100644 --- a/churchtools-wpcalendarsync.php +++ b/churchtools-wpcalendarsync.php @@ -10,7 +10,7 @@ * Plugin Name: Churchtools WP Calendarsync * Plugin URI: https://github.com/a-schild/churchtools-wp-calendarsync * Description: Churchtools wordpress calendar sync to events manager, requires "Events Manager" plugin. The sync is scheduled every hour to update WP events from churchtool. - * Version: 1.0.3 + * Version: 1.0.4 * Author: André Schild * Author URI: https://github.com/a-schild/churchtools-wp-calendarsync/ * License: GPLv2 or later @@ -33,7 +33,7 @@ * Start at version 1.0.0 and use SemVer - https://semver.org * Rename this for your plugin and update it as you release new versions. */ -define( 'CTWPSYNC_VERSION', '1.0.3' ); +define( 'CTWPSYNC_VERSION', '1.0.4' ); function ctwpsync_setup_menu() { add_options_page('ChurchTools Calendar Importer','ChurchTools Calsync','manage_options','churchtools-wpcalendarsync','ctwpsync_dashboard'); @@ -155,12 +155,12 @@ function ctwpsync_initplugin() $sql = "CREATE TABLE IF NOT EXISTS ".$table_name."( id mediumint(9) NOT NULL AUTO_INCREMENT, ct_id mediumint(9) NOT NULL, - ct_repeating mediumint(9) NOT NULL, + ct_repeating mediumint(9), wp_id mediumint(9) NOT NULL, - ct_image_id mediumint(9) NOT NULL, - wp_image_id mediumint(9) NOT NULL, - ct_flyer_id mediumint(9) NOT NULL, - wp_flyer_id mediumint(9) NOT NULL, + ct_image_id mediumint(9), + wp_image_id mediumint(9), + ct_flyer_id mediumint(9), + wp_flyer_id mediumint(9), last_seen datetime NOT NULL, event_start datetime NOT NULL, event_end datetime NOT NULL, @@ -176,7 +176,7 @@ function ctwpsync_initplugin() // OK, new table format } else { // Need to add repeating column and change unique constraint on ct_id index - $sql= "alter table `".$table_name."` ADD COLUMN `ct_repeating` TINYINT NULL DEFAULT '0';"; + $sql= "alter table `".$table_name."` ADD COLUMN `ct_repeating` mediumint(9) NULL DEFAULT '0';"; $wpdb->query($sql); $sql= "alter table `".$table_name."` DROP INDEX `ct_id`;"; $wpdb->query($sql);