category: remove

as not used for a long time by now
This commit is contained in:
Milan
2021-04-11 12:49:27 +02:00
parent 6ede3d84b3
commit 873d546e13
11 changed files with 299 additions and 71 deletions

View File

@@ -149,14 +149,12 @@ CREATE TABLE `calcms_event_history` (
`status` varchar(40) DEFAULT NULL, `status` varchar(40) DEFAULT NULL,
`visibility` varchar(40) DEFAULT NULL, `visibility` varchar(40) DEFAULT NULL,
`responsible` varchar(40) DEFAULT NULL, `responsible` varchar(40) DEFAULT NULL,
`category` varchar(60) DEFAULT NULL,
`start_date` date NOT NULL, `start_date` date NOT NULL,
`time_of_day` varchar(40) NOT NULL, `time_of_day` varchar(40) NOT NULL,
`end_date` date NOT NULL, `end_date` date NOT NULL,
`program` varchar(40) DEFAULT NULL, `program` varchar(40) DEFAULT NULL,
`series_name` varchar(40) DEFAULT NULL, `series_name` varchar(40) DEFAULT NULL,
`comment_count` int(10) unsigned NOT NULL DEFAULT '0', `comment_count` int(10) unsigned NOT NULL DEFAULT '0',
`category_count` int(10) unsigned NOT NULL DEFAULT '0',
`tag_count` int(10) unsigned NOT NULL DEFAULT '0', `tag_count` int(10) unsigned NOT NULL DEFAULT '0',
`image` varchar(200) DEFAULT NULL, `image` varchar(200) DEFAULT NULL,
`podcast_url` varchar(300) DEFAULT NULL, `podcast_url` varchar(300) DEFAULT NULL,
@@ -187,7 +185,6 @@ CREATE TABLE `calcms_event_history` (
KEY `start_date` (`start_date`), KEY `start_date` (`start_date`),
KEY `status` (`status`), KEY `status` (`status`),
KEY `modified_at` (`modified_at`), KEY `modified_at` (`modified_at`),
KEY `category` (`category`),
KEY `time_of_day` (`time_of_day`), KEY `time_of_day` (`time_of_day`),
KEY `end_date` (`end_date`), KEY `end_date` (`end_date`),
KEY `reference` (`reference`), KEY `reference` (`reference`),
@@ -237,12 +234,10 @@ CREATE TABLE `calcms_events` (
`status` varchar(40) DEFAULT NULL, `status` varchar(40) DEFAULT NULL,
`visibility` varchar(40) DEFAULT NULL, `visibility` varchar(40) DEFAULT NULL,
`responsible` varchar(40) DEFAULT NULL, `responsible` varchar(40) DEFAULT NULL,
`category` varchar(60) DEFAULT NULL,
`start_date` date NOT NULL, `start_date` date NOT NULL,
`end_date` date NOT NULL, `end_date` date NOT NULL,
`time_of_day` varchar(40) DEFAULT NULL, `time_of_day` varchar(40) DEFAULT NULL,
`comment_count` int(10) unsigned DEFAULT '0', `comment_count` int(10) unsigned DEFAULT '0',
`category_count` int(10) unsigned DEFAULT '0',
`tag_count` int(10) unsigned DEFAULT '0', `tag_count` int(10) unsigned DEFAULT '0',
`podcast_url` varchar(300) DEFAULT NULL, `podcast_url` varchar(300) DEFAULT NULL,
`archive_url` varchar(300) DEFAULT NULL, `archive_url` varchar(300) DEFAULT NULL,
@@ -278,7 +273,6 @@ CREATE TABLE `calcms_events` (
KEY `start_date` (`start_date`), KEY `start_date` (`start_date`),
KEY `status` (`status`), KEY `status` (`status`),
KEY `modified_at` (`modified_at`), KEY `modified_at` (`modified_at`),
KEY `category` (`category`),
KEY `time_of_day` (`time_of_day`), KEY `time_of_day` (`time_of_day`),
KEY `end_date` (`end_date`), KEY `end_date` (`end_date`),
KEY `reference` (`reference`), KEY `reference` (`reference`),
@@ -665,7 +659,6 @@ CREATE TABLE `calcms_series` (
`location` varchar(100) DEFAULT NULL, `location` varchar(100) DEFAULT NULL,
`modified_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `modified_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`modified_by` varchar(100) NOT NULL, `modified_by` varchar(100) NOT NULL,
`category` varchar(60) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`assign_event_series_name` varchar(100) DEFAULT NULL, `assign_event_series_name` varchar(100) DEFAULT NULL,
`assign_event_title` varchar(100) DEFAULT NULL, `assign_event_title` varchar(100) DEFAULT NULL,

290
install/migrate.sql Normal file
View File

@@ -0,0 +1,290 @@
ALTER TABLE `calcms_audio_recordings`
DROP COLUMN md5,
ADD COLUMN processed tinyint(1) NULL DEFAULT '0',
ADD COLUMN modified_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN mastered tinyint(1) NULL DEFAULT '0',
ADD COLUMN rmsLeft float NULL,
ADD COLUMN audioDuration float NULL DEFAULT '0' AFTER size,
ADD COLUMN rmsRight float NULL,
ADD COLUMN eventDuration int(11) NULL DEFAULT '0',
CHANGE COLUMN created_at created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
CHANGE COLUMN size size bigint(20) unsigned NOT NULL DEFAULT '0' AFTER created_at;
ALTER TABLE `calcms_playout`
DROP COLUMN relpay_gain,
ADD INDEX modified_at (modified_at),
ADD COLUMN replay_gain float NULL AFTER rms_image,
ADD COLUMN modified_at datetime NULL,
ADD COLUMN updated_at datetime NULL DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE `calcms_roles`
ADD COLUMN read_playout tinyint(1) unsigned NOT NULL AFTER delete_audio_recordings;
ALTER TABLE `calcms_series_events`
ADD INDEX pse (studio_id,project_id,event_id);
ALTER TABLE `calcms_series_schedule`
CHANGE COLUMN start_offset start_offset int(11) NULL DEFAULT '0',
CHANGE COLUMN nextDay nextDay int(11) NULL DEFAULT '0';
ALTER TABLE `calcms_audio_recordings`
CHANGE COLUMN modified_at modified_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP;
ALTER TABLE `calcms_event_history`
CHANGE COLUMN created_at created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE `calcms_events`
CHANGE COLUMN created_at created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE `calcms_images`
CHANGE COLUMN created_at created_at datetime NULL DEFAULT CURRENT_TIMESTAMP,
CHANGE COLUMN modified_at modified_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP;
ALTER TABLE `calcms_roles`
CHANGE COLUMN modified_at modified_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
CHANGE COLUMN created_at created_at timestamp NULL DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE `calcms_series`
CHANGE COLUMN created_at created_at timestamp NULL DEFAULT CURRENT_TIMESTAMP,
CHANGE COLUMN modified_at modified_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP;
ALTER TABLE `calcms_studios`
CHANGE COLUMN created_at created_at timestamp NULL DEFAULT CURRENT_TIMESTAMP,
CHANGE COLUMN modified_at modified_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP;
ALTER TABLE `calcms_user_events`
CHANGE COLUMN modified_at modified_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP;
ALTER TABLE `calcms_user_roles`
CHANGE COLUMN created_at created_at timestamp NULL DEFAULT CURRENT_TIMESTAMP,
CHANGE COLUMN modified_at modified_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP;
ALTER TABLE `calcms_user_series`
CHANGE COLUMN modified_at modified_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP;
ALTER TABLE `calcms_users`
CHANGE COLUMN created_at created_at timestamp NULL DEFAULT CURRENT_TIMESTAMP,
CHANGE COLUMN modified_at modified_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP;
ALTER TABLE `calcms_audio_recordings`
CHANGE COLUMN processed processed tinyint(1) NOT NULL DEFAULT '0',
CHANGE COLUMN modified_at modified_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
CHANGE COLUMN mastered mastered tinyint(1) NOT NULL DEFAULT '0',
CHANGE COLUMN eventDuration eventDuration int(11) NOT NULL DEFAULT '0',
CHANGE COLUMN rmsLeft rmsLeft float NOT NULL,
CHANGE COLUMN rmsRight rmsRight float NOT NULL,
CHANGE COLUMN audioDuration audioDuration float NOT NULL DEFAULT '0';
ALTER TABLE `calcms_events`
ADD COLUMN draft tinyint(1) unsigned NOT NULL DEFAULT '0' AFTER recurrence_count;
ALTER TABLE `calcms_users`
CHANGE COLUMN email email varchar(300) NOT NULL;
ALTER TABLE `calcms_events` ADD COLUMN `series_image` VARCHAR(200) DEFAULT NULL AFTER `draft`;
ALTER TABLE `calcms_events` ADD COLUMN `image_label` VARCHAR(200) DEFAULT NULL AFTER `series_image`,
ADD COLUMN `series_image_label` VARCHAR(200) DEFAULT NULL AFTER `image_label`;
ALTER TABLE `calcms_playout`
CHANGE COLUMN `modified_at` `modified_at` datetime DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE `calcms_images`
ADD COLUMN public tinyint(1) unsigned NULL DEFAULT '0',
ADD COLUMN licence varchar(300) NULL AFTER project_id;
ALTER TABLE `calcms_event_history`
CHANGE COLUMN draft draft tinyint(1) unsigned NOT NULL DEFAULT '0',
ADD COLUMN series_image_label varchar(200) NULL,
ADD COLUMN series_image varchar(200) NULL AFTER draft,
ADD COLUMN recurrence_count int(10) unsigned NOT NULL DEFAULT '0' AFTER project_id,
ADD COLUMN image_label varchar(200) NULL;
-- 2018-06-18 refactor columns
ALTER TABLE `calcms_audio_recordings`
CHANGE COLUMN `created_by` `created_by` VARCHAR(100) NOT NULL AFTER `processed`,
CHANGE COLUMN `created_at` `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `created_by`;
ALTER TABLE `calcms_events`
CHANGE COLUMN `program` `program` VARCHAR(40) NULL DEFAULT NULL AFTER `end`,
CHANGE COLUMN `series_name` `series_name` VARCHAR(40) NULL DEFAULT NULL AFTER `program`,
CHANGE COLUMN `episode` `episode` INT(10) UNSIGNED NULL DEFAULT NULL AFTER `title`,
CHANGE COLUMN `html_content` `html_content` LONGTEXT NULL DEFAULT NULL AFTER `content`,
CHANGE COLUMN `end_date` `end_date` DATE NOT NULL AFTER `start_date`,
CHANGE COLUMN `archive_url` `archive_url` VARCHAR(300) NULL DEFAULT NULL AFTER `podcast_url`,
CHANGE COLUMN `html_topic` `html_topic` LONGTEXT NULL DEFAULT NULL AFTER `user_excerpt`,
CHANGE COLUMN `draft` `draft` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0' AFTER `archived`,
CHANGE COLUMN `recurrence` `recurrence` INT(11) NULL DEFAULT '0' AFTER `recurrence_count`,
CHANGE COLUMN `image` `image` VARCHAR(200) NULL DEFAULT NULL AFTER `recurrence`,
CHANGE COLUMN `image_label` `image_label` VARCHAR(200) NULL DEFAULT NULL AFTER `image`,
CHANGE COLUMN `created_at` `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `series_image_label`,
CHANGE COLUMN `modified_by` `modified_by` VARCHAR(20) NULL DEFAULT NULL AFTER `created_at`,
CHANGE COLUMN `modified_at` `modified_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP AFTER `modified_by`,
CHANGE COLUMN `reference` `reference` VARCHAR(300) NULL DEFAULT NULL AFTER `modified_at`,
CHANGE COLUMN `disable_event_sync` `disable_event_sync` TINYINT(1) UNSIGNED NULL DEFAULT NULL AFTER `reference`;
ALTER TABLE `calcms_images`
CHANGE COLUMN `project_id` `project_id` INT(10) UNSIGNED NOT NULL AFTER `id`,
CHANGE COLUMN `studio_id` `studio_id` INT(10) UNSIGNED NULL DEFAULT NULL AFTER `project_id`,
CHANGE COLUMN `filename` `filename` VARCHAR(64) NOT NULL AFTER `studio_id`,
CHANGE COLUMN `name` `name` VARCHAR(300) NULL DEFAULT NULL AFTER `filename`,
CHANGE COLUMN `licence` `licence` VARCHAR(300) NULL DEFAULT NULL AFTER `description`,
CHANGE COLUMN `public` `public` TINYINT(1) UNSIGNED NULL DEFAULT '0' AFTER `licence`,
CHANGE COLUMN `created_at` `created_at` DATETIME NULL DEFAULT CURRENT_TIMESTAMP AFTER `modified_by`;
ALTER TABLE `calcms_roles`
CHANGE COLUMN `project_id` `project_id` TINYINT(1) UNSIGNED NOT NULL AFTER `id`,
CHANGE COLUMN `studio_id` `studio_id` INT(10) UNSIGNED NOT NULL AFTER `project_id`,
CHANGE COLUMN `level` `level` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `role`,
CHANGE COLUMN `read_role` `read_role` TINYINT(1) UNSIGNED NULL DEFAULT NULL AFTER `level`,
CHANGE COLUMN `update_role` `update_role` TINYINT(1) UNSIGNED NULL DEFAULT NULL AFTER `read_role`,
CHANGE COLUMN `read_user_role` `read_user_role` TINYINT(1) UNSIGNED NULL DEFAULT NULL AFTER `update_role`,
CHANGE COLUMN `delete_user` `delete_user` TINYINT(1) UNSIGNED NULL DEFAULT NULL AFTER `update_user`,
CHANGE COLUMN `update_user_role` `update_user_role` TINYINT(1) UNSIGNED NULL DEFAULT NULL AFTER `delete_user`,
CHANGE COLUMN `create_project` `create_project` TINYINT(1) UNSIGNED NOT NULL AFTER `disable_user`,
CHANGE COLUMN `read_project` `read_project` TINYINT(1) UNSIGNED NOT NULL AFTER `create_project`,
CHANGE COLUMN `update_project` `update_project` TINYINT(1) UNSIGNED NOT NULL AFTER `read_project`,
CHANGE COLUMN `delete_project` `delete_project` TINYINT(1) UNSIGNED NOT NULL AFTER `update_project`,
CHANGE COLUMN `assign_project_studio` `assign_project_studio` TINYINT(1) UNSIGNED NOT NULL AFTER `delete_project`,
CHANGE COLUMN `create_studio` `create_studio` TINYINT(1) UNSIGNED NOT NULL AFTER `assign_project_studio`,
CHANGE COLUMN `read_studio` `read_studio` TINYINT(1) UNSIGNED NOT NULL AFTER `create_studio`,
CHANGE COLUMN `delete_studio` `delete_studio` TINYINT(1) UNSIGNED NOT NULL AFTER `update_studio`,
CHANGE COLUMN `read_studio_timeslot_schedule` `read_studio_timeslot_schedule` TINYINT(1) UNSIGNED NOT NULL AFTER `delete_studio`,
CHANGE COLUMN `update_studio_timeslot_schedule` `update_studio_timeslot_schedule` TINYINT(1) UNSIGNED NOT NULL AFTER `read_studio_timeslot_schedule`,
CHANGE COLUMN `update_series_template` `update_series_template` TINYINT(1) UNSIGNED NOT NULL AFTER `delete_series`,
CHANGE COLUMN `assign_series_member` `assign_series_member` TINYINT(1) UNSIGNED NOT NULL AFTER `update_series_template`,
CHANGE COLUMN `remove_series_member` `remove_series_member` TINYINT(1) UNSIGNED NOT NULL AFTER `assign_series_member`,
CHANGE COLUMN `scan_series_events` `scan_series_events` TINYINT(1) UNSIGNED NOT NULL AFTER `remove_series_member`,
CHANGE COLUMN `assign_series_events` `assign_series_events` TINYINT(1) UNSIGNED NOT NULL AFTER `scan_series_events`,
CHANGE COLUMN `read_schedule` `read_schedule` TINYINT(1) UNSIGNED NOT NULL AFTER `assign_series_events`,
CHANGE COLUMN `update_schedule` `update_schedule` TINYINT(1) UNSIGNED NOT NULL AFTER `read_schedule`,
CHANGE COLUMN `delete_schedule` `delete_schedule` TINYINT(1) UNSIGNED NOT NULL AFTER `update_schedule`,
CHANGE COLUMN `create_event_from_schedule` `create_event_from_schedule` TINYINT(1) UNSIGNED NOT NULL AFTER `create_event`,
CHANGE COLUMN `create_event_of_series` `create_event_of_series` TINYINT(1) UNSIGNED NOT NULL AFTER `create_event_from_schedule`,
CHANGE COLUMN `update_event_after_week` `update_event_after_week` TINYINT(1) UNSIGNED NOT NULL AFTER `update_event_time`,
CHANGE COLUMN `update_event_field_title` `update_event_field_title` TINYINT(1) UNSIGNED NOT NULL AFTER `update_event_after_week`,
CHANGE COLUMN `update_event_field_title_extension` `update_event_field_title_extension` TINYINT(1) UNSIGNED NOT NULL AFTER `update_event_field_title`,
CHANGE COLUMN `update_event_field_excerpt` `update_event_field_excerpt` TINYINT(1) UNSIGNED NOT NULL AFTER `update_event_field_title_extension`,
CHANGE COLUMN `update_event_field_description` `update_event_field_description` TINYINT(1) UNSIGNED NOT NULL AFTER `update_event_field_content`,
CHANGE COLUMN `update_event_field_topic` `update_event_field_topic` TINYINT(1) UNSIGNED NOT NULL AFTER `update_event_field_description`,
CHANGE COLUMN `update_event_field_episode` `update_event_field_episode` TINYINT(1) UNSIGNED NOT NULL AFTER `update_event_field_topic`,
CHANGE COLUMN `update_event_field_excerpt_extension` `update_event_field_excerpt_extension` TINYINT(1) UNSIGNED NOT NULL AFTER `update_event_field_episode`,
CHANGE COLUMN `update_event_field_image` `update_event_field_image` TINYINT(1) UNSIGNED NOT NULL AFTER `update_event_field_excerpt_extension`,
CHANGE COLUMN `update_event_field_podcast_url` `update_event_field_podcast_url` TINYINT(1) UNSIGNED NOT NULL AFTER `update_event_field_image`,
CHANGE COLUMN `update_event_field_archive_url` `update_event_field_archive_url` TINYINT(1) UNSIGNED NOT NULL AFTER `update_event_field_podcast_url`,
CHANGE COLUMN `update_event_status_draft` `update_event_status_draft` TINYINT(1) UNSIGNED NOT NULL AFTER `update_event_status_rerun`,
CHANGE COLUMN `update_event_status_live` `update_event_status_live` TINYINT(1) UNSIGNED NOT NULL AFTER `update_event_status_draft`,
CHANGE COLUMN `update_event_status_playout` `update_event_status_playout` TINYINT(1) UNSIGNED NOT NULL AFTER `update_event_status_live`,
CHANGE COLUMN `update_event_status_archived` `update_event_status_archived` TINYINT(1) UNSIGNED NOT NULL AFTER `update_event_status_playout`,
CHANGE COLUMN `create_image` `create_image` TINYINT(1) UNSIGNED NOT NULL AFTER `update_event_status_archived`,
CHANGE COLUMN `update_image_own` `update_image_own` TINYINT(1) UNSIGNED NOT NULL AFTER `create_image`,
CHANGE COLUMN `created_at` `created_at` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP AFTER `read_playout`,
CHANGE COLUMN `create_download` `create_download` TINYINT(1) UNSIGNED NOT NULL AFTER `created_at`,
CHANGE COLUMN `modified_at` `modified_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP AFTER `create_download`;
ALTER TABLE `calcms_series_dates`
CHANGE COLUMN `project_id` `project_id` INT(10) UNSIGNED NOT NULL AFTER `id`,
CHANGE COLUMN `studio_id` `studio_id` INT(10) UNSIGNED NOT NULL AFTER `project_id`;
ALTER TABLE `calcms_series_events`
CHANGE COLUMN `project_id` `project_id` INT(10) UNSIGNED NOT NULL FIRST,
CHANGE COLUMN `studio_id` `studio_id` INT(12) UNSIGNED NOT NULL AFTER `project_id`;
ALTER TABLE `calcms_series_schedule`
CHANGE COLUMN `project_id` `project_id` INT(10) UNSIGNED NOT NULL DEFAULT '1' AFTER `id`,
CHANGE COLUMN `studio_id` `studio_id` INT(10) UNSIGNED NULL DEFAULT NULL AFTER `project_id`;
ALTER TABLE `calcms_studios`
CHANGE COLUMN `image` `image` VARCHAR(200) NOT NULL AFTER `stream`;
ALTER TABLE `calcms_studio_timeslot_dates`
CHANGE COLUMN `project_id` `project_id` INT(10) UNSIGNED NOT NULL FIRST,
CHANGE COLUMN `schedule_id` `schedule_id` INT(10) UNSIGNED NOT NULL AFTER `studio_id`,
DROP PRIMARY KEY,
ADD PRIMARY KEY USING BTREE (`project_id`, `studio_id`, `start`, `end`);
ALTER TABLE `calcms_studio_timeslot_schedule`
CHANGE COLUMN `project_id` `project_id` INT(10) UNSIGNED NOT NULL AFTER `id`;
ALTER TABLE `calcms_user_events`
CHANGE COLUMN `modified_by` `modified_by` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `location`,
CHANGE COLUMN `modified_at` `modified_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP AFTER `modified_by`;
ALTER TABLE `calcms_user_roles`
CHANGE COLUMN `project_id` `project_id` INT(10) UNSIGNED NOT NULL AFTER `id`,
CHANGE COLUMN `studio_id` `studio_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `project_id`;
ALTER TABLE `calcms_users`
CHANGE COLUMN `email` `email` VARCHAR(300) NOT NULL AFTER `full_name`,
CHANGE COLUMN `pass` `pass` VARCHAR(100) NOT NULL AFTER `email`,
CHANGE COLUMN `created_at` `created_at` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP AFTER `created_by`,
CHANGE COLUMN `modified_at` `modified_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP AFTER `created_at`;
ALTER TABLE `calcms_user_series`
CHANGE COLUMN `project_id` `project_id` INT(10) UNSIGNED NOT NULL AFTER `id`,
CHANGE COLUMN `studio_id` `studio_id` INT(10) UNSIGNED NOT NULL AFTER `project_id`;
ALTER TABLE `calcms_user_stats`
ADD COLUMN `upload_file` INT(10) UNSIGNED NULL DEFAULT 0 AFTER `delete_series`,
ADD COLUMN `download_file` INT(10) UNSIGNED NULL DEFAULT 0 AFTER `upload_file`;
ALTER TABLE `calcms_user_settings`
ADD COLUMN `project_id` INT(10) UNSIGNED NULL AFTER `calendar_fontsize`,
ADD COLUMN `studio_id` INT(10) UNSIGNED NULL AFTER `project_id`;
ALTER TABLE `calcms_series`
ADD COLUMN `predecessor_id` INT(10) NULL AFTER `has_single_events`;
CREATE TABLE `calcms_user_default_studios` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`user` VARCHAR(50) NOT NULL,
`project_id` INT(11) NOT NULL,
`studio_id` INT(11) NOT NULL,
PRIMARY KEY (`id`),
INDEX `user` (`user` ASC));
ALTER TABLE `calcms_series`
ADD COLUMN `content_format` VARCHAR(45) NULL AFTER `predecessor_id`;
ALTER TABLE `calcms_events`
ADD COLUMN `content_format` VARCHAR(45) NULL DEFAULT NULL AFTER `disable_event_sync`;
ALTER TABLE `calcms_roles`
ADD COLUMN `update_event_field_content_format` TINYINT(1) UNSIGNED NOT NULL AFTER `modified_at`;
ALTER TABLE `calcms_events`
ADD COLUMN `listen_key` VARCHAR(100) NULL;
ALTER TABLE `calcms_audio_recordings`
ADD COLUMN `active` TINYINT(1) NOT NULL DEFAULT 0 AFTER `event_id`;
ALTER TABLE `calcms`.`calcms_audio_recordings`
ADD INDEX `active_index` (`active`);
ALTER TABLE `calcms`.`calcms_events`
DROP COLUMN `category_count`,
DROP COLUMN `category`,
DROP INDEX `category` ;
;
ALTER TABLE `calcms`.`calcms_event_history`
DROP COLUMN `category_count`,
DROP COLUMN `category`,
DROP INDEX `category` ;
;

View File

@@ -67,30 +67,11 @@ sub extractEventFromWikiText($;$) {
#extract categories from title #extract categories from title
my @categories = (); my @categories = ();
while ( $title =~ /\((.*?),(.*?)\)/ ) { while ( $title =~ /\((.*?),(.*?)\)/ ) {
my $category = $1;
$category =~ s/\s+/ /g;
$category =~ s/^\s+|\s+$//g;
$category =~ s/\&/\+/g;
push @categories, $category if defined $category && $category =~ /\S/;
$category = '';
$category = $2 if ( defined $2 );
$category =~ s/\s+/ /g;
$category =~ s/^\s+|\s+$//g;
$category =~ s/\&/\+/g;
push @categories, $category if defined $category && $category =~ /\S/;
$title =~ s/\((.*?),(.*?)\)/\($2\)/; $title =~ s/\((.*?),(.*?)\)/\($2\)/;
} }
if ( $title =~ /\((.*?)\)/ ) { if ( $title =~ /\((.*?)\)/ ) {
my $category = $1;
$category =~ s/\s+/ /g;
$category =~ s/^\s+|\s+$//g;
$category =~ s/\&/\+/g;
push @categories, $category if defined $category && $category =~ /\S/;
$title =~ s/\((.*?)\)//; $title =~ s/\((.*?)\)//;
} }
$event->{categories} = \@categories if ( @categories > 0 );
$event->{title} = $title; $event->{title} = $title;
$event->{title} =~ s/^\s+|\s+$//g; $event->{title} =~ s/^\s+|\s+$//g;

View File

@@ -46,7 +46,7 @@ sub setAttributesFromSeriesTemplate($$$) {
my $serie = $series->[0]; my $serie = $series->[0];
for my $attr ( for my $attr (
'program', 'series_name', 'title', 'excerpt', 'topic', 'content', 'html_content', 'project', 'program', 'series_name', 'title', 'excerpt', 'topic', 'content', 'html_content', 'project',
'category', 'location', 'image', 'live', 'archive_url', 'podcast_url', 'content_format' 'location', 'image', 'live', 'archive_url', 'podcast_url', 'content_format'
) )
{ {
$event->{$attr} = $serie->{$attr}; $event->{$attr} = $serie->{$attr};

View File

@@ -49,7 +49,6 @@ sub get_cached_or_render($$$) {
my $results = events::get( $config, $request ); my $results = events::get( $config, $request );
events::render( $response, $config, $request, $results ); events::render( $response, $config, $request, $results );
return $response; return $response;
} }
@@ -900,23 +899,6 @@ sub get_query($$$) {
} }
} }
#filter for category
my $category_cond = '';
if ( $params->{category} ne '' ) {
my $category = ( split( /\,/, $params->{category} ) )[0];
$category =~ s/[^a-zA-Z0-9]/%/g;
$category =~ s/%{2,99}/%/g;
if ( $category ne '' ) {
$category_cond = qq{
id in(
select event_id from calcms_categories
where name like ?
)
};
}
push @$bind_values, $category;
}
my $series_name_cond = ''; my $series_name_cond = '';
if ( ( defined $params->{series_name} ) if ( ( defined $params->{series_name} )
&& ( $params->{series_name} ne '' ) ) && ( $params->{series_name} ne '' ) )
@@ -971,7 +953,7 @@ sub get_query($$$) {
$search =~ s/[\%\s]+$//; $search =~ s/[\%\s]+$//;
if ( $search ne '' ) { if ( $search ne '' ) {
$search = '%' . $search . '%'; $search = '%' . $search . '%';
my @attr = ( 'title', 'series_name', 'excerpt', 'category', 'content', 'topic' ); my @attr = ( 'title', 'series_name', 'excerpt', 'content', 'topic' );
$search_cond = "(" . join( " or ", map { 'lower(' . $_ . ') like ?' } @attr ) . ")"; $search_cond = "(" . join( " or ", map { 'lower(' . $_ . ') like ?' } @attr ) . ")";
for my $attr (@attr) { for my $attr (@attr) {
push @$bind_values, $search; push @$bind_values, $search;
@@ -1021,14 +1003,13 @@ sub get_query($$$) {
#print STDERR $disable_event_sync_cond." ".$bind_values->[-1]."\n"; #print STDERR $disable_event_sync_cond." ".$bind_values->[-1]."\n";
#combine date, location, category, series_name, tag, search and project #combine date, location, series_name, tag, search and project
push @$where_cond, $location_cond if ( $location_cond =~ /\S/ ); push @$where_cond, $location_cond if ( $location_cond =~ /\S/ );
push @$where_cond, $exclude_location_cond push @$where_cond, $exclude_location_cond
if ( $exclude_location_cond =~ /\S/ ); if ( $exclude_location_cond =~ /\S/ );
push @$where_cond, $exclude_project_cond push @$where_cond, $exclude_project_cond
if ( $exclude_project_cond =~ /\S/ ); if ( $exclude_project_cond =~ /\S/ );
push @$where_cond, $category_cond if ( $category_cond =~ /\S/ );
push @$where_cond, $series_name_cond if ( $series_name_cond =~ /\S/ ); push @$where_cond, $series_name_cond if ( $series_name_cond =~ /\S/ );
push @$where_cond, $tag_cond if ( $tag_cond =~ /\S/ ); push @$where_cond, $tag_cond if ( $tag_cond =~ /\S/ );
push @$where_cond, $title_cond if ( $title_cond =~ /\S/ ); push @$where_cond, $title_cond if ( $title_cond =~ /\S/ );
@@ -1221,7 +1202,6 @@ sub render($$$$;$) {
if ( scalar @$results == 0 ) { if ( scalar @$results == 0 ) {
if ( ( $params->{search} ne '' ) if ( ( $params->{search} ne '' )
|| ( $params->{category} ne '' )
|| ( $params->{series_name} ne '' ) ) || ( $params->{series_name} ne '' ) )
{ {
$template_parameters->{no_search_result} = '1'; $template_parameters->{no_search_result} = '1';
@@ -1607,14 +1587,6 @@ sub check_params ($$) {
$tag =~ s/\'//gi; $tag =~ s/\'//gi;
} }
my $category = $params->{category} || '';
if ( ( defined $category ) && ( $category ne '' ) ) {
log::error( $config, "invalid category" ) if ( $category =~ /\;/ );
$category =~ s/^\s+//gi;
$category =~ s/\s+$//gi;
$category =~ s/\'//gi;
}
my $series_name = $params->{series_name} || ''; my $series_name = $params->{series_name} || '';
if ( ( defined $series_name ) && ( $series_name ne '' ) ) { if ( ( defined $series_name ) && ( $series_name ne '' ) ) {
log::error( $config, "invalid series_name" ) log::error( $config, "invalid series_name" )
@@ -1785,7 +1757,6 @@ sub check_params ($$) {
limit => $limit, limit => $limit,
template => $template, template => $template,
location => $location, location => $location,
category => $category,
series_name => $series_name, series_name => $series_name,
tag => $tag, tag => $tag,
title => $title, title => $title,

View File

@@ -73,7 +73,7 @@ sub get ($$) {
$search =~ s/[\%\s]+$//; $search =~ s/[\%\s]+$//;
if ( $search ne '' ) { if ( $search ne '' ) {
$search = '%' . $search . '%'; $search = '%' . $search . '%';
my @attr = ( 'title', 'series_name', 'excerpt', 'category', 'content' ); my @attr = ( 'title', 'series_name', 'excerpt', 'content' );
push @conditions, "(" . join( " or ", map { 'lower(' . $_ . ') like ?' } @attr ) . ")"; push @conditions, "(" . join( " or ", map { 'lower(' . $_ . ') like ?' } @attr ) . ")";
for my $attr (@attr) { for my $attr (@attr) {
push @bind_values, $search; push @bind_values, $search;

View File

@@ -208,7 +208,7 @@ sub get_series($;$) {
$search =~ s/[\%\s]+$//; $search =~ s/[\%\s]+$//;
if ( $search ne '' ) { if ( $search ne '' ) {
$search = '%' . $search . '%'; $search = '%' . $search . '%';
my @attr = ( 's.title', 's.series_name', 's.excerpt', 's.category', 's.content' ); my @attr = ( 's.title', 's.series_name', 's.excerpt', 's.content' );
push @conditions, "(" . join( " or ", map { 'lower(' . $_ . ') like ?' } @attr ) . ")"; push @conditions, "(" . join( " or ", map { 'lower(' . $_ . ') like ?' } @attr ) . ")";
for my $attr (@attr) { for my $attr (@attr) {
push @bind_values, $search; push @bind_values, $search;

View File

@@ -413,8 +413,7 @@ sub check_permission($$) {
} }
#not handled, yet: #not handled, yet:
# responsible, status, rating, podcast_url, media_url, visible, time_of_day, recurrence, reference, created_at # responsible, status, rating, podcast_url, media_url, visible, time_of_day, recurrence, reference, created_at, time_of_day,
# category, time_of_day,
#insert event #insert event
sub insert_event ($$) { sub insert_event ($$) {

View File

@@ -31,7 +31,6 @@ RewriteRule ^kalender/(\d{4}-\d{2}-\d{2})/$ cal.cgi?date=$1 [L]
RewriteRule ^kalender/(\d{4}-\d{2}-\d{2})/(\d{4}-\d{2}-\d{2})/$ cal.cgi?from_date=$1&till_date=$2 [L] RewriteRule ^kalender/(\d{4}-\d{2}-\d{2})/(\d{4}-\d{2}-\d{2})/$ cal.cgi?from_date=$1&till_date=$2 [L]
RewriteRule ^kalender/(.*)$ cal.cgi?$1 [L] RewriteRule ^kalender/(.*)$ cal.cgi?$1 [L]
RewriteRule ^kategorien/(.*)$ category.cgi?$1 [L]
RewriteRule ^sendereihen/(.*)$ series_names.cgi?$1 [L] RewriteRule ^sendereihen/(.*)$ series_names.cgi?$1 [L]
RewriteRule ^playlist/(.*)$ events.cgi?template=event_playlist.html&time=future&limit=5&$1 [L] RewriteRule ^playlist/(.*)$ events.cgi?template=event_playlist.html&time=future&limit=5&$1 [L]
@@ -60,11 +59,6 @@ RewriteRule ^suche/(.*?)/(.*?)/vergangene/(.*)$ events.cgi?template=event_list.h
RewriteRule ^suche/(.*?)/(.*?)/(.*)$ events.cgi?template=event_list.html&project=$1&search=$2&$3 [L] RewriteRule ^suche/(.*?)/(.*?)/(.*)$ events.cgi?template=event_list.html&project=$1&search=$2&$3 [L]
RewriteRule ^suche/(.*?)/(.*)$ events.cgi?template=event_list.html&search=$1&$2 [L] RewriteRule ^suche/(.*?)/(.*)$ events.cgi?template=event_list.html&search=$1&$2 [L]
RewriteRule ^kategorie/(.*?)/(.*?)/kommende/(.*)$ events.cgi?template=event_list.html&project=$1&category=$2&archive=coming&$3 [L]
RewriteRule ^kategorie/(.*?)/(.*?)/vergangene/(.*)$ events.cgi?template=event_list.html&project=$1&category=$2&archive=gone&$3 [L]
RewriteRule ^kategorie/(.*?)/(.*?)/(.*)$ events.cgi?template=event_list.html&project=$1&category=$2&$3 [L]
RewriteRule ^kategorie/(.*?)/(.*)$ events.cgi?template=event_list.html&category=$1&$2 [L]
RewriteRule ^rds/(.*)$ events.cgi?template=event_playlist.txt&time=now&limit=1&$1 [L] RewriteRule ^rds/(.*)$ events.cgi?template=event_playlist.txt&time=now&limit=1&$1 [L]
RewriteRule ^playlist_show/(.*)$ events.cgi?template=event_playlist_show.html&time=future&limit=3&$1 [L] RewriteRule ^playlist_show/(.*)$ events.cgi?template=event_playlist_show.html&time=future&limit=3&$1 [L]
RewriteRule ^json/(.*)$ events.cgi?template=event.json&time=now&limit=15&$1 [L] RewriteRule ^json/(.*)$ events.cgi?template=event.json&time=now&limit=15&$1 [L]

View File

@@ -457,7 +457,7 @@ sub showCalendar {
} }
# series dates # series dates
if ($params->{list} == 1 and defined $options->{series_id}){ if ($params->{list} == 1){
my $series = series::get( my $series = series::get(
$config, $config,
{ {
@@ -2000,7 +2000,7 @@ sub check_params {
entry::set_strings( $checked, $params, [ entry::set_strings( $checked, $params, [
'search', 'filter', 'range', 'search', 'filter', 'range',
'series_name', 'title', 'excerpt', 'content', 'series_name', 'title', 'excerpt', 'content',
'program', 'category', 'image', 'user_content' 'program', 'image', 'user_content'
]); ]);
$checked->{action} = entry::element_of( $params->{action}, $checked->{action} = entry::element_of( $params->{action},

View File

@@ -878,7 +878,7 @@ sub check_params {
entry::set_strings( $checked, $params, [ entry::set_strings( $checked, $params, [
'series_name', 'title', 'excerpt', 'content', 'series_name', 'title', 'excerpt', 'content',
'topic', 'program', 'category', 'image', 'topic', 'program', 'image',
'series_image', 'user_content', 'user_title', 'user_excerpt', 'series_image', 'user_content', 'user_title', 'user_excerpt',
'podcast_url', 'archive_url', 'setImage', 'content_format' 'podcast_url', 'archive_url', 'setImage', 'content_format'
]); ]);