From ad4d79de776741a05277d5a192162d6ff9c22597 Mon Sep 17 00:00:00 2001 From: Yonas Habteab Date: Mon, 10 Jul 2023 15:32:05 +0200 Subject: [PATCH] Drop `start` & `frequency` columns --- library/Reporting/Model/Schedule.php | 3 --- schema/mysql-upgrades/1.0.0.sql | 3 +++ schema/mysql.schema.sql | 2 -- schema/pgsql-upgrades/1.0.0.sql | 3 +++ schema/pgsql.schema.sql | 4 ---- 5 files changed, 6 insertions(+), 9 deletions(-) create mode 100644 schema/mysql-upgrades/1.0.0.sql create mode 100644 schema/pgsql-upgrades/1.0.0.sql diff --git a/library/Reporting/Model/Schedule.php b/library/Reporting/Model/Schedule.php index 7f73aad8..6100d2a4 100644 --- a/library/Reporting/Model/Schedule.php +++ b/library/Reporting/Model/Schedule.php @@ -26,8 +26,6 @@ public function getColumns() return [ 'report_id', 'author', - 'start', - 'frequency', 'action', 'config', 'ctime', @@ -38,7 +36,6 @@ public function getColumns() public function createBehaviors(Behaviors $behaviors) { $behaviors->add(new MillisecondTimestamp([ - 'start', 'ctime', 'mtime' ])); diff --git a/schema/mysql-upgrades/1.0.0.sql b/schema/mysql-upgrades/1.0.0.sql new file mode 100644 index 00000000..4351cd48 --- /dev/null +++ b/schema/mysql-upgrades/1.0.0.sql @@ -0,0 +1,3 @@ +ALTER TABLE schedule + DROP COLUMN IF EXISTS start, + DROP COLUMN IF EXISTS frequency; diff --git a/schema/mysql.schema.sql b/schema/mysql.schema.sql index 5f704817..939bf927 100644 --- a/schema/mysql.schema.sql +++ b/schema/mysql.schema.sql @@ -74,8 +74,6 @@ CREATE TABLE schedule ( id int(10) unsigned NOT NULL AUTO_INCREMENT, report_id int(10) unsigned NOT NULL, author varchar(255) NOT NULL COLLATE utf8mb4_unicode_ci, - start bigint(20) unsigned NOT NULL, - frequency enum('minutely', 'hourly', 'daily', 'weekly', 'monthly'), action varchar(255) NOT NULL, config text NULL DEFAULT NULL, ctime bigint(20) unsigned NOT NULL, diff --git a/schema/pgsql-upgrades/1.0.0.sql b/schema/pgsql-upgrades/1.0.0.sql new file mode 100644 index 00000000..4351cd48 --- /dev/null +++ b/schema/pgsql-upgrades/1.0.0.sql @@ -0,0 +1,3 @@ +ALTER TABLE schedule + DROP COLUMN IF EXISTS start, + DROP COLUMN IF EXISTS frequency; diff --git a/schema/pgsql.schema.sql b/schema/pgsql.schema.sql index 329a65f8..77130908 100644 --- a/schema/pgsql.schema.sql +++ b/schema/pgsql.schema.sql @@ -2,8 +2,6 @@ CREATE OR REPLACE FUNCTION unix_timestamp(timestamp with time zone DEFAULT NOW() AS 'SELECT EXTRACT(EPOCH FROM $1)::bigint' LANGUAGE SQL; -CREATE TYPE frequency AS ENUM ('minutely', 'hourly', 'daily', 'weekly', 'monthly'); - CREATE TABLE template ( id serial PRIMARY KEY, author varchar(255) NOT NULL, @@ -73,8 +71,6 @@ CREATE TABLE schedule ( id serial PRIMARY KEY, report_id int NOT NULL, author varchar(255) NOT NULL, - start bigint NOT NULL, - frequency frequency, action varchar(255) NOT NULL, config text DEFAULT NULL, ctime bigint NOT NULL DEFAULT unix_timestamp() * 1000,