From 1178a7e2d6ee80786b79f36e2f187e8ed416383e Mon Sep 17 00:00:00 2001 From: Richard Fath Date: Thu, 3 Oct 2019 17:14:14 +0200 Subject: [PATCH] [4.0] [com_workflow] Fix default value for not nullable datetime columns and make checkout_time nullable (#26428) --- .../sql/updates/mysql/4.0.0-2018-05-15.sql | 28 ++++++++-------- .../updates/postgresql/4.0.0-2018-05-15.sql | 32 +++++++++---------- .../com_workflow/Table/StageTable.php | 10 +++++- .../com_workflow/Table/TransitionTable.php | 23 +++++++++++++ .../com_workflow/Table/WorkflowTable.php | 16 ++++++++-- installation/sql/mysql/joomla.sql | 28 ++++++++-------- installation/sql/postgresql/joomla.sql | 28 ++++++++-------- 7 files changed, 104 insertions(+), 61 deletions(-) diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-05-15.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-05-15.sql index 89603ac27e28a..7bbedc437e6d4 100644 --- a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-05-15.sql +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-05-15.sql @@ -12,11 +12,11 @@ CREATE TABLE IF NOT EXISTS `#__workflows` ( `default` tinyint(1) NOT NULL DEFAULT 0, `core` tinyint(1) NOT NULL DEFAULT 0, `ordering` int(11) NOT NULL DEFAULT 0, - `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `created` datetime NOT NULL, `created_by` int(10) NOT NULL DEFAULT 0, - `modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `modified` datetime NOT NULL, `modified_by` int(10) NOT NULL DEFAULT 0, - `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `checked_out_time` datetime, `checked_out` int(10) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `idx_asset_id` (`asset_id`), @@ -35,7 +35,7 @@ CREATE TABLE IF NOT EXISTS `#__workflows` ( -- INSERT INTO `#__workflows` (`id`, `asset_id`, `published`, `title`, `description`, `extension`, `default`, `core`,`ordering`, `created`, `created_by`, `modified`, `modified_by`, `checked_out_time`, `checked_out`) VALUES -(1, 0, 1, 'COM_WORKFLOW_DEFAULT_WORKFLOW', '', 'com_content', 1, 1, 1, '0000-00-00 00:00:00', 0, '0000-00-00 00:00:00', 0, '0000-00-00 00:00:00', 0); +(1, 0, 1, 'COM_WORKFLOW_DEFAULT_WORKFLOW', '', 'com_content', 1, 1, 1, CURRENT_TIMESTAMP(), 0, CURRENT_TIMESTAMP(), 0, NULL, 0); -- -- Table structure for table `#__workflow_associations` @@ -66,7 +66,7 @@ CREATE TABLE IF NOT EXISTS `#__workflow_stages` ( `description` text NOT NULL, `condition` int(10) DEFAULT 0, `default` tinyint(1) NOT NULL DEFAULT 0, - `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `checked_out_time` datetime, `checked_out` int(10) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `idx_workflow_id` (`workflow_id`), @@ -81,10 +81,10 @@ CREATE TABLE IF NOT EXISTS `#__workflow_stages` ( -- INSERT INTO `#__workflow_stages` (`id`, `asset_id`, `ordering`, `workflow_id`, `published`, `title`, `description`, `condition`, `default`, `checked_out_time`, `checked_out`) VALUES -(1, 0, 1, 1, 1, 'JUNPUBLISHED', '', 0, 1, '0000-00-00 00:00:00', 0), -(2, 0, 2, 1, 1, 'JPUBLISHED', '', 1, 0, '0000-00-00 00:00:00', 0), -(3, 0, 3, 1, 1, 'JTRASHED', '', -2, 0, '0000-00-00 00:00:00', 0), -(4, 0, 4, 1, 1, 'JARCHIVED', '', 2, 0, '0000-00-00 00:00:00', 0); +(1, 0, 1, 1, 1, 'JUNPUBLISHED', '', 0, 1, NULL, 0), +(2, 0, 2, 1, 1, 'JPUBLISHED', '', 1, 0, NULL, 0), +(3, 0, 3, 1, 1, 'JTRASHED', '', -2, 0, NULL, 0), +(4, 0, 4, 1, 1, 'JARCHIVED', '', 2, 0, NULL, 0); -- -- Table structure for table `#__workflow_transitions` @@ -100,7 +100,7 @@ CREATE TABLE IF NOT EXISTS `#__workflow_transitions` ( `description` text NOT NULL, `from_stage_id` int(10) NOT NULL, `to_stage_id` int(10) NOT NULL, - `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `checked_out_time` datetime, `checked_out` int(10) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `idx_title` (`title`(191)), @@ -116,10 +116,10 @@ CREATE TABLE IF NOT EXISTS `#__workflow_transitions` ( -- INSERT INTO `#__workflow_transitions` (`id`, `asset_id`, `published`, `ordering`, `workflow_id`, `title`, `description`, `from_stage_id`, `to_stage_id`, `checked_out_time`, `checked_out`) VALUES -(1, 0, 1, 1, 1, 'Unpublish', '', -1, 1, '0000-00-00 00:00:00', 0), -(2, 0, 1, 2, 1, 'Publish', '', -1, 2, '0000-00-00 00:00:00', 0), -(3, 0, 1, 3, 1, 'Trash', '', -1, 3, '0000-00-00 00:00:00', 0), -(4, 0, 1, 4, 1, 'Archive', '', -1, 4, '0000-00-00 00:00:00', 0); +(1, 0, 1, 1, 1, 'Unpublish', '', -1, 1, NULL, 0), +(2, 0, 1, 2, 1, 'Publish', '', -1, 2, NULL, 0), +(3, 0, 1, 3, 1, 'Trash', '', -1, 3, NULL, 0), +(4, 0, 1, 4, 1, 'Archive', '', -1, 4, NULL, 0); -- -- Creating extension entry diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-05-15.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-05-15.sql index 31063db00bedf..a41ff39e4f764 100644 --- a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-05-15.sql +++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-05-15.sql @@ -12,11 +12,11 @@ CREATE TABLE IF NOT EXISTS "#__workflows" ( "default" smallint NOT NULL DEFAULT 0, "core" smallint NOT NULL DEFAULT 0, "ordering" bigint NOT NULL DEFAULT 0, - "created" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, + "created" timestamp without time zone NOT NULL, "created_by" bigint DEFAULT 0 NOT NULL, - "modified" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, + "modified" timestamp without time zone NOT NULL, "modified_by" bigint DEFAULT 0 NOT NULL, - "checked_out_time" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, + "checked_out_time" timestamp without time zone, "checked_out" bigint DEFAULT 0 NOT NULL, PRIMARY KEY ("id") ); @@ -32,7 +32,7 @@ CREATE INDEX "#__workflows_idx_modified_by" ON "#__workflows" ("modified_by"); CREATE INDEX "#__workflows_idx_checked_out" ON "#__workflows" ("checked_out"); INSERT INTO "#__workflows" ("id", "asset_id", "published", "title", "description", "extension", "default", "core", "ordering", "created", "created_by", "modified", "modified_by", "checked_out_time", "checked_out") VALUES -(1, 0, 1, 'COM_WORKFLOW_DEFAULT_WORKFLOW', '', 'com_content', 1, 1, 1, '1970-01-01 00:00:00', 0, '1970-01-01 00:00:00', 0, '1970-01-01 00:00:00', 0, '1970-01-01 00:00:00', 0); +(1, 0, 1, 'COM_WORKFLOW_DEFAULT_WORKFLOW', '', 'com_content', 1, 1, 1, CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0, NULL, 0); -- -- Table structure for table "#__workflow_associations" @@ -66,7 +66,7 @@ CREATE TABLE IF NOT EXISTS "#__workflow_stages" ( "description" text NOT NULL, "condition" bigint DEFAULT 0 NOT NULL, "default" smallint NOT NULL DEFAULT 0, - "checked_out_time" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, + "checked_out_time" timestamp without time zone, "checked_out" bigint DEFAULT 0 NOT NULL, PRIMARY KEY ("id") ); @@ -80,11 +80,11 @@ CREATE INDEX "#__workflow_stages_idx_checked_out" ON "#__workflow_stages" ("chec -- Dumping data for table "#__workflow_stages" -- -INSERT INTO "#__workflow_stages" ("id", "asset_id", "ordering", "workflow_id", "published", "title", "description", "condition", "default") VALUES -(1, 0, 1, 1, 1, 'JUNPUBLISHED', '', 0, 1, '1970-01-01 00:00:00', 0), -(2, 0, 2, 1, 1, 'JPUBLISHED', '', 1, 0, '1970-01-01 00:00:00', 0), -(3, 0, 3, 1, 1, 'JTRASHED', '', -2, 0, '1970-01-01 00:00:00', 0), -(4, 0, 4, 1, 1, 'JARCHIVED', '', 2, 0, '1970-01-01 00:00:00', 0); +INSERT INTO "#__workflow_stages" ("id", "asset_id", "ordering", "workflow_id", "published", "title", "description", "condition", "default", "checked_out_time", "checked_out") VALUES +(1, 0, 1, 1, 1, 'JUNPUBLISHED', '', 0, 1, NULL, 0), +(2, 0, 2, 1, 1, 'JPUBLISHED', '', 1, 0, NULL, 0), +(3, 0, 3, 1, 1, 'JTRASHED', '', -2, 0, NULL, 0), +(4, 0, 4, 1, 1, 'JARCHIVED', '', 2, 0, NULL, 0); -- -- Table structure for table "#__workflow_transitions" @@ -100,7 +100,7 @@ CREATE TABLE IF NOT EXISTS "#__workflow_transitions" ( "description" text NOT NULL, "from_stage_id" bigint DEFAULT 0 NOT NULL, "to_stage_id" bigint DEFAULT 0 NOT NULL, - "checked_out_time" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, + "checked_out_time" timestamp without time zone, "checked_out" bigint DEFAULT 0 NOT NULL, PRIMARY KEY ("id") ); @@ -111,11 +111,11 @@ CREATE INDEX "#__workflow_transitions_idx_to_stage_id" ON "#__workflow_transitio CREATE INDEX "#__workflow_transitions_idx_workflow_id" ON "#__workflow_transitions" ("workflow_id"); CREATE INDEX "#__workflow_transitions_idx_checked_out" ON "#__workflow_transitions" ("checked_out"); -INSERT INTO "#__workflow_transitions" ("id", "asset_id", "published", "ordering", "workflow_id", "title", "description", "from_stage_id", "to_stage_id") VALUES -(1, 0, 1, 1, 1, 'Unpublish', '', -1, 1, '1970-01-01 00:00:00', 0), -(2, 0, 1, 2, 1, 'Publish', '', -1, 2, '1970-01-01 00:00:00', 0), -(3, 0, 1, 3, 1, 'Trash', '', -1, 3, '1970-01-01 00:00:00', 0), -(4, 0, 1, 4, 1, 'Archive', '', -1, 4, '1970-01-01 00:00:00', 0); +INSERT INTO "#__workflow_transitions" ("id", "asset_id", "published", "ordering", "workflow_id", "title", "description", "from_stage_id", "to_stage_id", "checked_out_time", "checked_out") VALUES +(1, 0, 1, 1, 1, 'Unpublish', '', -1, 1, NULL, 0), +(2, 0, 1, 2, 1, 'Publish', '', -1, 2, NULL, 0), +(3, 0, 1, 3, 1, 'Trash', '', -1, 3, NULL, 0), +(4, 0, 1, 4, 1, 'Archive', '', -1, 4, NULL, 0); -- -- Creating extension entry diff --git a/administrator/components/com_workflow/Table/StageTable.php b/administrator/components/com_workflow/Table/StageTable.php index 3f3f2e3798661..8dab1c77826a2 100644 --- a/administrator/components/com_workflow/Table/StageTable.php +++ b/administrator/components/com_workflow/Table/StageTable.php @@ -23,6 +23,14 @@ */ class StageTable extends Table { + /** + * Indicates that columns fully support the NULL value in the database + * + * @var boolean + * @since __DEPLOY_VERSION__ + */ + protected $_supportNullValue = true; + /** * Constructor * @@ -167,7 +175,7 @@ public function check() * @see Table::store() * @since 4.0 */ - public function store($updateNulls = false) + public function store($updateNulls = true) { $table = new StageTable($this->getDbo()); diff --git a/administrator/components/com_workflow/Table/TransitionTable.php b/administrator/components/com_workflow/Table/TransitionTable.php index 142eedd4df57b..bb1af6bc2a70e 100644 --- a/administrator/components/com_workflow/Table/TransitionTable.php +++ b/administrator/components/com_workflow/Table/TransitionTable.php @@ -22,6 +22,14 @@ */ class TransitionTable extends Table { + /** + * Indicates that columns fully support the NULL value in the database + * + * @var boolean + * @since __DEPLOY_VERSION__ + */ + protected $_supportNullValue = true; + /** * Constructor * @@ -36,6 +44,21 @@ public function __construct(DatabaseDriver $db) $this->access = (int) Factory::getApplication()->get('access'); } + /** + * Overloaded store function + * + * @param boolean $updateNulls True to update fields even if they are null. + * + * @return mixed False on failure, positive integer on success. + * + * @see Table::store() + * @since __DEPLOY_VERSION__ + */ + public function store($updateNulls = true) + { + return parent::store($updateNulls); + } + /** * Method to compute the default name of the asset. * The default name is in the form table_name.id diff --git a/administrator/components/com_workflow/Table/WorkflowTable.php b/administrator/components/com_workflow/Table/WorkflowTable.php index f17a6b1b23a18..4eca69485e511 100644 --- a/administrator/components/com_workflow/Table/WorkflowTable.php +++ b/administrator/components/com_workflow/Table/WorkflowTable.php @@ -22,6 +22,14 @@ */ class WorkflowTable extends Table { + /** + * Indicates that columns fully support the NULL value in the database + * + * @var boolean + * @since __DEPLOY_VERSION__ + */ + protected $_supportNullValue = true; + /** * Constructor * @@ -171,7 +179,7 @@ public function check() * @see Table::store() * @since 4.0 */ - public function store($updateNulls = false) + public function store($updateNulls = true) { $date = Factory::getDate(); $user = Factory::getUser(); @@ -187,7 +195,6 @@ public function store($updateNulls = false) else { $this->modified_by = 0; - $this->modified = $this->getDbo()->getNullDate(); } if (!(int) $this->created) @@ -200,6 +207,11 @@ public function store($updateNulls = false) $this->created_by = $user->id; } + if (!(int) $this->modified) + { + $this->modified = $this->created; + } + if ($this->default == '1') { // Verify that the default is unique for this workflow diff --git a/installation/sql/mysql/joomla.sql b/installation/sql/mysql/joomla.sql index 1424d516b600c..8e839127fd0d8 100644 --- a/installation/sql/mysql/joomla.sql +++ b/installation/sql/mysql/joomla.sql @@ -2289,11 +2289,11 @@ CREATE TABLE IF NOT EXISTS `#__workflows` ( `default` tinyint(1) NOT NULL DEFAULT 0, `core` tinyint(1) NOT NULL DEFAULT 0, `ordering` int(11) NOT NULL DEFAULT 0, - `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `created` datetime NOT NULL, `created_by` int(10) NOT NULL DEFAULT 0, - `modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `modified` datetime NOT NULL, `modified_by` int(10) NOT NULL DEFAULT 0, - `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `checked_out_time` datetime, `checked_out` int(10) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `idx_asset_id` (`asset_id`), @@ -2312,7 +2312,7 @@ CREATE TABLE IF NOT EXISTS `#__workflows` ( -- INSERT INTO `#__workflows` (`id`, `asset_id`, `published`, `title`, `description`, `extension`, `default`, `core`,`ordering`, `created`, `created_by`, `modified`, `modified_by`, `checked_out_time`, `checked_out`) VALUES -(1, 56, 1, 'COM_WORKFLOW_DEFAULT_WORKFLOW', '', 'com_content', 1, 1, 1, '0000-00-00 00:00:00', 0, '0000-00-00 00:00:00', 0, '0000-00-00 00:00:00', 0); +(1, 56, 1, 'COM_WORKFLOW_DEFAULT_WORKFLOW', '', 'com_content', 1, 1, 1, CURRENT_TIMESTAMP(), 0, CURRENT_TIMESTAMP(), 0, NULL, 0); -- -- Table structure for table `#__workflow_associations` @@ -2343,7 +2343,7 @@ CREATE TABLE IF NOT EXISTS `#__workflow_stages` ( `description` text NOT NULL, `condition` int(10) DEFAULT 0, `default` tinyint(1) NOT NULL DEFAULT 0, - `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `checked_out_time` datetime, `checked_out` int(10) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `idx_workflow_id` (`workflow_id`), @@ -2358,10 +2358,10 @@ CREATE TABLE IF NOT EXISTS `#__workflow_stages` ( -- INSERT INTO `#__workflow_stages` (`id`, `asset_id`, `ordering`, `workflow_id`, `published`, `title`, `description`, `condition`, `default`, `checked_out_time`, `checked_out`) VALUES -(1, 57, 1, 1, 1, 'JUNPUBLISHED', '', 0, 1, '0000-00-00 00:00:00', 0), -(2, 58, 2, 1, 1, 'JPUBLISHED', '', 1, 0, '0000-00-00 00:00:00', 0), -(3, 59, 3, 1, 1, 'JTRASHED', '', -2, 0, '0000-00-00 00:00:00', 0), -(4, 60, 4, 1, 1, 'JARCHIVED', '', 2, 0, '0000-00-00 00:00:00', 0); +(1, 57, 1, 1, 1, 'JUNPUBLISHED', '', 0, 1, NULL, 0), +(2, 58, 2, 1, 1, 'JPUBLISHED', '', 1, 0, NULL, 0), +(3, 59, 3, 1, 1, 'JTRASHED', '', -2, 0, NULL, 0), +(4, 60, 4, 1, 1, 'JARCHIVED', '', 2, 0, NULL, 0); -- -- Table structure for table `#__workflow_transitions` @@ -2377,7 +2377,7 @@ CREATE TABLE IF NOT EXISTS `#__workflow_transitions` ( `description` text NOT NULL, `from_stage_id` int(10) NOT NULL, `to_stage_id` int(10) NOT NULL, - `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `checked_out_time` datetime, `checked_out` int(10) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `idx_title` (`title`(191)), @@ -2393,10 +2393,10 @@ CREATE TABLE IF NOT EXISTS `#__workflow_transitions` ( -- INSERT INTO `#__workflow_transitions` (`id`, `asset_id`, `published`, `ordering`, `workflow_id`, `title`, `description`, `from_stage_id`, `to_stage_id`, `checked_out_time`, `checked_out`) VALUES -(1, 61, 1, 1, 1, 'Unpublish', '', -1, 1, '0000-00-00 00:00:00', 0), -(2, 62, 1, 2, 1, 'Publish', '', -1, 2, '0000-00-00 00:00:00', 0), -(3, 63, 1, 3, 1, 'Trash', '', -1, 3, '0000-00-00 00:00:00', 0), -(4, 64, 1, 4, 1, 'Archive', '', -1, 4, '0000-00-00 00:00:00', 0); +(1, 61, 1, 1, 1, 'Unpublish', '', -1, 1, NULL, 0), +(2, 62, 1, 2, 1, 'Publish', '', -1, 2, NULL, 0), +(3, 63, 1, 3, 1, 'Trash', '', -1, 3, NULL, 0), +(4, 64, 1, 4, 1, 'Archive', '', -1, 4, NULL, 0); -- -- Table structure for table `#__mail_templates` diff --git a/installation/sql/postgresql/joomla.sql b/installation/sql/postgresql/joomla.sql index 6256c62afa0e1..a757d9c80bd3d 100644 --- a/installation/sql/postgresql/joomla.sql +++ b/installation/sql/postgresql/joomla.sql @@ -2291,11 +2291,11 @@ CREATE TABLE IF NOT EXISTS "#__workflows" ( "default" smallint NOT NULL DEFAULT 0, "core" smallint NOT NULL DEFAULT 0, "ordering" bigint NOT NULL DEFAULT 0, - "created" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, + "created" timestamp without time zone NOT NULL, "created_by" bigint DEFAULT 0 NOT NULL, - "modified" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, + "modified" timestamp without time zone NOT NULL, "modified_by" bigint DEFAULT 0 NOT NULL, - "checked_out_time" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, + "checked_out_time" timestamp without time zone, "checked_out" bigint DEFAULT 0 NOT NULL, PRIMARY KEY ("id") ); @@ -2311,7 +2311,7 @@ CREATE INDEX "#__workflows_idx_modified_by" ON "#__workflows" ("modified_by"); CREATE INDEX "#__workflows_idx_checked_out" ON "#__workflows" ("checked_out"); INSERT INTO "#__workflows" ("id", "asset_id", "published", "title", "description", "extension", "default", "core", "ordering", "created", "created_by", "modified", "modified_by", "checked_out_time", "checked_out") VALUES -(1, 56, 1, 'COM_WORKFLOW_DEFAULT_WORKFLOW', '', 'com_content', 1, 1, 1, '1970-01-01 00:00:00', 0, '1970-01-01 00:00:00', 0, '1970-01-01 00:00:00', 0); +(1, 56, 1, 'COM_WORKFLOW_DEFAULT_WORKFLOW', '', 'com_content', 1, 1, 1, CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0, NULL, 0); SELECT setval('#__workflows_id_seq', 2, false); @@ -2347,7 +2347,7 @@ CREATE TABLE IF NOT EXISTS "#__workflow_stages" ( "description" text NOT NULL, "condition" bigint DEFAULT 0 NOT NULL, "default" smallint NOT NULL DEFAULT 0, - "checked_out_time" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, + "checked_out_time" timestamp without time zone, "checked_out" bigint DEFAULT 0 NOT NULL, PRIMARY KEY ("id") ); @@ -2362,10 +2362,10 @@ CREATE INDEX "#__workflow_stages_idx_checked_out" ON "#__workflow_stages" ("chec -- INSERT INTO "#__workflow_stages" ("id", "asset_id", "ordering", "workflow_id", "published", "title", "description", "condition", "default", "checked_out_time", "checked_out") VALUES -(1, 0, 1, 1, 1, 'JUNPUBLISHED', '', 0, 1, '1970-01-01 00:00:00', 0), -(2, 0, 2, 1, 1, 'JPUBLISHED', '', 1, 0, '1970-01-01 00:00:00', 0), -(3, 0, 3, 1, 1, 'JTRASHED', '', -2, 0, '1970-01-01 00:00:00', 0), -(4, 0, 4, 1, 1, 'JARCHIVED', '', 2, 0, '1970-01-01 00:00:00', 0); +(1, 0, 1, 1, 1, 'JUNPUBLISHED', '', 0, 1, NULL, 0), +(2, 0, 2, 1, 1, 'JPUBLISHED', '', 1, 0, NULL, 0), +(3, 0, 3, 1, 1, 'JTRASHED', '', -2, 0, NULL, 0), +(4, 0, 4, 1, 1, 'JARCHIVED', '', 2, 0, NULL, 0); SELECT setval('#__workflow_stages_id_seq', 5, false); -- @@ -2382,7 +2382,7 @@ CREATE TABLE IF NOT EXISTS "#__workflow_transitions" ( "description" text NOT NULL, "from_stage_id" bigint DEFAULT 0 NOT NULL, "to_stage_id" bigint DEFAULT 0 NOT NULL, - "checked_out_time" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, + "checked_out_time" timestamp without time zone, "checked_out" bigint DEFAULT 0 NOT NULL, PRIMARY KEY ("id") ); @@ -2394,10 +2394,10 @@ CREATE INDEX "#__workflow_transitions_idx_workflow_id" ON "#__workflow_transitio CREATE INDEX "#__workflow_transitions_idx_checked_out" ON "#__workflow_transitions" ("checked_out"); INSERT INTO "#__workflow_transitions" ("id", "asset_id", "published", "ordering", "workflow_id", "title", "description", "from_stage_id", "to_stage_id", "checked_out_time", "checked_out") VALUES -(1, 0, 1, 1, 1, 'Unpublish', '', -1, 1, '1970-01-01 00:00:00', 0), -(2, 0, 1, 2, 1, 'Publish', '', -1, 2, '1970-01-01 00:00:00', 0), -(3, 0, 1, 3, 1, 'Trash', '', -1, 3, '1970-01-01 00:00:00', 0), -(4, 0, 1, 4, 1, 'Archive', '', -1, 4, '1970-01-01 00:00:00', 0); +(1, 0, 1, 1, 1, 'Unpublish', '', -1, 1, NULL, 0), +(2, 0, 1, 2, 1, 'Publish', '', -1, 2, NULL, 0), +(3, 0, 1, 3, 1, 'Trash', '', -1, 3, NULL, 0), +(4, 0, 1, 4, 1, 'Archive', '', -1, 4, NULL, 0); SELECT setval('#__workflow_transitions_id_seq', 5, false);