? ? Pending

User tests: Successful: Unsuccessful:

avatar alikon
alikon
10 Aug 2018

Pull Request for Issue #workflow schema .

Summary of Changes

  • idx prefix for index
  • removed ENUM field type to int
  • postgresql schema update
  • postgresql schema install
  • mysql <5.6
avatar alikon alikon - open - 10 Aug 2018
avatar alikon alikon - change - 10 Aug 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 10 Aug 2018
Category SQL Administration com_admin Postgresql
avatar alikon
alikon - comment - 10 Aug 2018

can someone explain this change on #__content table state field https://github.com/joomla/joomla-cms/pull/20381/files#diff-135c6f58583408312a709459b19594c7R333

when in the update sql script we do this :

INSERT INTO `#__workflow_associations` (`item_id`, `state_id`, `extension`)
SELECT `id`, CASE WHEN `state` = -2 THEN 3 WHEN `state` = 0 THEN 1 WHEN `state` = 2 THEN 4 ELSE 2 END, 'com_content' FROM `#__content`;

ping @bembelimen @HLeithner

avatar HLeithner
HLeithner - comment - 10 Aug 2018

I think the reason is that the update script converts the old state values to the default workflow. but the new Workflow can have more states then tinyint, its converted.

I think the insert query copies the current states to the new workflow table to preserve the old behavior.

avatar alikon
alikon - comment - 10 Aug 2018

so then we lack the alter table in the update script only ?

avatar HLeithner
HLeithner - comment - 10 Aug 2018

Thats possible. I will check later.

avatar bembelimen
bembelimen - comment - 10 Aug 2018

Yes, that's true

avatar alikon alikon - change - 11 Aug 2018
Labels Added: ? ?
avatar joomla-cms-bot joomla-cms-bot - change - 11 Aug 2018
Category SQL Administration com_admin Postgresql SQL Administration com_admin Postgresql Installation
avatar alikon alikon - change - 11 Aug 2018
The description was changed
avatar alikon alikon - edited - 11 Aug 2018
cbe0ae0 11 Aug 2018 avatar alikon now()
avatar alikon alikon - change - 11 Aug 2018
Title
[WIP][4.0] - workwflow mysql/postgresql schema
[4.0] - workwflow mysql/postgresql schema
avatar alikon alikon - edited - 11 Aug 2018
avatar alikon alikon - change - 11 Aug 2018
The description was changed
avatar alikon alikon - edited - 11 Aug 2018
avatar wilsonge
wilsonge - comment - 13 Aug 2018

OK I've merged the PR that fixes all the state stuff - so this needs conflicts fixing. Then let's get this tested and merged :)

avatar alikon
alikon - comment - 13 Aug 2018

please hold on ..... work in progress

avatar wilsonge wilsonge - change - 13 Aug 2018
Title
[4.0] - workwflow mysql/postgresql schema
[4.0] [WIP] - Workflow mysql/postgresql schema
avatar wilsonge wilsonge - edited - 13 Aug 2018
avatar alikon alikon - change - 14 Aug 2018
Title
[4.0] [WIP] - Workflow mysql/postgresql schema
[4.0] - Workflow mysql/postgresql schema
avatar alikon alikon - edited - 14 Aug 2018
avatar alikon
alikon - comment - 14 Aug 2018

ready for review/test

avatar alikon alikon - change - 14 Aug 2018
The description was changed
avatar alikon alikon - edited - 14 Aug 2018
avatar infograf768
infograf768 - comment - 14 Aug 2018

I have tested this item successfully on f9bd425

OK here with msqli


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/21520.

avatar infograf768 infograf768 - test_item - 14 Aug 2018 - Tested successfully
avatar infograf768
infograf768 - comment - 14 Aug 2018

You may need to change to tinyint also in joomla.sql. We have now:

CREATE TABLE IF NOT EXISTS `#__content` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `asset_id` int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.',
  `title` varchar(255) NOT NULL DEFAULT '',
  `alias` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  `introtext` mediumtext NOT NULL,
  `fulltext` mediumtext NOT NULL,
`state` int(10) NOT NULL DEFAULT 0,

EDIT: just a second too late :)

avatar alikon
alikon - comment - 14 Aug 2018

state field of #__content table back to tinyint(3)/smallint

avatar wilsonge
wilsonge - comment - 14 Aug 2018

In the installation files and Postgres ones too please (sorry)

avatar infograf768
infograf768 - comment - 14 Aug 2018

installation sql joomla.sql is already done.
for Postgres, do we need a smallint instead of bighint ?

avatar infograf768
infograf768 - comment - 14 Aug 2018

Looks they are already done, @wilsonge

avatar alikon
alikon - comment - 14 Aug 2018

postgresql done too both install & update
yes for postgresql smallint is quite like the tinyint of mysql

avatar wilsonge
wilsonge - comment - 14 Aug 2018

Yup I’m happy with this. Can we test this please :)

avatar infograf768
infograf768 - comment - 14 Aug 2018

I have already tested sqli here (yes, modified directly to tinyint in db)

avatar wilsonge wilsonge - change - 14 Aug 2018
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2018-08-14 15:39:55
Closed_By wilsonge
avatar wilsonge wilsonge - close - 14 Aug 2018
avatar wilsonge wilsonge - merge - 14 Aug 2018
avatar wilsonge
wilsonge - comment - 14 Aug 2018

Thanks guys!

Add a Comment

Login with GitHub to post a comment