Skip to content

Commit

Permalink
Allow NULL values in more columns
Browse files Browse the repository at this point in the history
Release 1.0.4
  • Loading branch information
a-schild committed Nov 9, 2023
1 parent 4b79c5f commit c41fb4d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
4 changes: 4 additions & 0 deletions Changelog.MD
Original file line number Diff line number Diff line change
@@ -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
Expand Down
16 changes: 8 additions & 8 deletions churchtools-wpcalendarsync.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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');
Expand Down Expand Up @@ -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,
Expand All @@ -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);
Expand Down

0 comments on commit c41fb4d

Please sign in to comment.