-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[4.0] Feature/New Publishing Workflow #20381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
917100e
2383382
a9b6933
b4c49ce
88a0198
63b533c
15761f9
2f8e5c1
b1ffd48
7c9bf89
c9354af
8118524
376da72
0769f1b
ca6b85c
33882e0
602f6ba
dea615c
b05fd2a
07bad9b
70a2498
74a4ef3
6707421
b5180d3
2f3a470
d7c3eb5
9588e40
606a7d7
f04f855
fa1c727
dd123d8
94260f2
0ce906d
0b07295
3904b7a
9fc24fc
987bbed
2581a86
480c779
05cdd51
8edc355
c4a6d32
95e5d6f
5700ccc
0f3f95c
6d040f9
f4a66dd
d45fcce
c5e3671
c7bc6d9
0f2fe70
9061873
9bd1e14
2fe7b6d
bfb899e
5810ae5
71dcc6b
cda42b9
6e963f3
c6afde7
dfdbd14
4a5672a
5c2c1a6
7298671
9fdaa16
b544eb2
a74dfad
4381447
1a9727f
ed9caed
cea5f1a
4545873
54c8842
b8e8541
58cddb0
057b8e2
b3688ff
58e9fc6
0442c28
237a912
db4fdcc
6a28c8e
cdf27ae
3c0ffc2
0b5d565
c4a59ab
7c43e94
01de3b7
beb54f7
52b7736
09544f4
8e432ca
a15abdf
6b8ca8b
2e74e67
6dd98e4
5994700
5d885ca
808e91f
23b3e6f
15388f2
66e037c
7d86308
a116283
353da7e
1bccea0
7f81551
3177778
6c5036d
c0fb0de
be3369f
20a95b6
592c9bd
69d2f79
ca9693e
b7faf2c
1abef37
640546a
cf7c0eb
3356864
82d82f1
233d6ec
ce379ac
10cc00c
26838ea
fd99424
829c410
e1df907
a9e3b1f
22ff96e
12dbc84
8e0df22
04c4967
95f318b
62476b5
4eef4fa
be78904
b091911
6dc75ed
ded7185
6574b04
57ce615
96c37db
175185c
96e4750
3efb1b8
3312363
25ecaae
624ecfe
bdbef68
1025334
cc11b56
62131fe
7b5b9d6
84a10e3
cc22a18
d2ec5c4
7e29b1b
e8dd905
8f46f7f
0486060
570a30b
49d8c8a
c6e230c
c29a2cb
c4f4a7e
5f81e50
56b9ca9
7c3d60c
b6a1429
c207fbb
7ff5bb1
c06af6e
71e3a8f
2976e68
e2c437a
c4a451b
7502626
171d15b
5794c26
a086d41
2795342
6518a92
3ec0ada
4fa5e7e
ecfed93
3463bb4
acdf891
096d72f
34a1d20
db01780
596750d
9b8c734
b323d83
e7b16ab
2c677ef
b709c78
2e65102
f0aa58e
78a4ce7
d121f01
5d838e0
1d4eb57
6402176
114c5dc
5d91bac
5809b57
62bc488
19d5488
b9dcb43
3df8464
4a29c2a
3e16eee
8f3ad98
850c37b
df72d53
52d15d9
d3bab84
dfa2001
827bad1
c87832b
92b87e5
ee15edc
a5e3bac
a96b1ab
149dc38
c747a75
1be7ca5
c0fdba4
404b17b
51c26aa
9657058
0f573e5
5ed18ea
85fcba4
ea514bf
0defc80
da938ad
0a49fe3
d6731ec
c02fb6c
c478b5c
90bca1c
cd02c9a
1567f0a
b3d7869
58aa4e8
c2ed718
370ff8c
729b23c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| -- | ||
| -- Table structure for table `#__workflows` | ||
| -- | ||
|
|
||
| CREATE TABLE IF NOT EXISTS `#__workflows` ( | ||
| `id` int(10) NOT NULL AUTO_INCREMENT, | ||
| `asset_id` int(10) DEFAULT 0, | ||
| `published` tinyint(1) NOT NULL DEFAULT 0, | ||
| `title` varchar(255) NOT NULL, | ||
| `description` text NOT NULL DEFAULT '', | ||
| `extension` varchar(255) NOT NULL, | ||
| `default` tinyint(1) NOT NULL DEFAULT 0, | ||
| `ordering` int(11) NOT NULL DEFAULT 0, | ||
| `created` datetime NOT NULL DEFAULT NOW(), | ||
| `created_by` int(10) NOT NULL DEFAULT 0, | ||
| `modified` datetime NOT NULL DEFAULT NOW(), | ||
| `modified_by` int(10) NOT NULL DEFAULT 0, | ||
| PRIMARY KEY (`id`), | ||
| KEY `asset_id` (`asset_id`), | ||
| KEY `title` (`title`(191)), | ||
| KEY `extension` (`extension`(191)), | ||
| KEY `default` (`default`), | ||
| KEY `created` (`created`), | ||
| KEY `created_by` (`created_by`), | ||
| KEY `modified` (`modified`), | ||
| KEY `modified_by` (`modified_by`) | ||
| ) ENGINE=InnoDB COLLATE=utf8mb4_unicode_ci; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shouldn't be |
||
|
|
||
| -- | ||
| -- Dumping data for table `#__workflows` | ||
| -- | ||
|
|
||
| INSERT INTO `#__workflows` (`id`, `asset_id`, `published`, `title`, `description`, `extension`, `default`, `ordering`, `created`, `created_by`, `modified`, `modified_by`) VALUES | ||
| (1, 0, 1, 'Joomla! Default', '', 'com_content', 1, 1, NOW(), 0, '0000-00-00 00:00:00', 0); | ||
|
|
||
| -- | ||
| -- Table structure for table `#__workflow_associations` | ||
| -- | ||
|
|
||
| CREATE TABLE IF NOT EXISTS `#__workflow_associations` ( | ||
| `item_id` int(10) NOT NULL DEFAULT 0 COMMENT 'Extension table id value', | ||
| `state_id` int(10) NOT NULL COMMENT 'Foreign Key to #__workflow_states.id', | ||
| `extension` varchar(100) NOT NULL, | ||
| PRIMARY KEY (`item_id`, `state_id`, `extension`), | ||
| KEY `idx_item_id` (`item_id`), | ||
| KEY `idx_state_id` (`state_id`), | ||
| KEY `idx_extension` (`extension`(100)) | ||
| ) ENGINE=InnoDB COLLATE=utf8mb4_unicode_ci; | ||
|
|
||
| -- | ||
| -- Table structure for table `#__workflow_states` | ||
| -- | ||
|
|
||
| CREATE TABLE IF NOT EXISTS `#__workflow_states` ( | ||
| `id` int(10) NOT NULL AUTO_INCREMENT, | ||
| `asset_id` int(10) DEFAULT 0, | ||
| `ordering` int(11) NOT NULL DEFAULT 0, | ||
| `workflow_id` int(10) NOT NULL, | ||
| `published` tinyint(1) NOT NULL DEFAULT 0, | ||
| `title` varchar(255) NOT NULL, | ||
| `description` text NOT NULL DEFAULT '', | ||
| `condition` enum('0','1','-2') NOT NULL, | ||
| `default` tinyint(1) NOT NULL DEFAULT 0, | ||
| PRIMARY KEY (`id`), | ||
| KEY `workflow_id` (`workflow_id`), | ||
| KEY `title` (`title`(191)), | ||
| KEY `asset_id` (`asset_id`), | ||
| KEY `default` (`default`) | ||
| ) ENGINE=InnoDB DEFAULT COLLATE=utf8mb4_unicode_ci; | ||
|
|
||
| -- | ||
| -- Dumping data for table `#__workflow_states` | ||
| -- | ||
|
|
||
| INSERT INTO `#__workflow_states` (`id`, `asset_id`, `ordering`, `workflow_id`, `published`, `title`, `description`, `condition`, `default`) VALUES | ||
| (1, 0, 1, 1, 1, 'Unpublished', '', '0', 0), | ||
| (2, 0, 2, 1, 1, 'Published', '', '1', 1), | ||
| (3, 0, 3, 1, 1, 'Trashed', '', '-2', 0), | ||
| (4, 0, 4, 1, 1, 'Archived', '', '1', 0); | ||
|
|
||
| -- | ||
| -- Table structure for table `#__workflow_transitions` | ||
| -- | ||
|
|
||
| CREATE TABLE IF NOT EXISTS `#__workflow_transitions` ( | ||
| `id` int(10) NOT NULL AUTO_INCREMENT, | ||
| `asset_id` int(10) DEFAULT 0, | ||
| `ordering` int(11) NOT NULL DEFAULT 0, | ||
| `workflow_id` int(10) NOT NULL, | ||
| `published` tinyint(1) NOT NULL DEFAULT 0, | ||
| `title` varchar(255) NOT NULL, | ||
| `description` text NOT NULL DEFAULT '', | ||
| `from_state_id` int(10) NOT NULL, | ||
| `to_state_id` int(10) NOT NULL, | ||
| PRIMARY KEY (`id`), | ||
| KEY `title` (`title`(191)), | ||
| KEY `asset_id` (`asset_id`), | ||
| KEY `from_state_id` (`from_state_id`), | ||
| KEY `to_state_id` (`to_state_id`), | ||
| KEY `workflow_id` (`workflow_id`) | ||
| ) ENGINE=InnoDB DEFAULT COLLATE=utf8mb4_unicode_ci; | ||
|
|
||
| -- | ||
| -- Dumping data for table `#__workflow_transitions` | ||
| -- | ||
|
|
||
| INSERT INTO `#__workflow_transitions` (`id`, `asset_id`, `published`, `ordering`, `workflow_id`, `title`, `description`, `from_state_id`, `to_state_id`) VALUES | ||
| (1, 0, 1, 1, 1, 'Unpublish', '', -1, 1), | ||
| (2, 0, 1, 2, 1, 'Publish', '', -1, 2), | ||
| (3, 0, 1, 3, 1, 'Trash', '', -1, 3), | ||
| (4, 0, 1, 4, 1, 'Archive', '', -1, 4); | ||
|
|
||
| -- | ||
| -- Creating extension entry | ||
| -- | ||
|
|
||
| INSERT INTO `#__extensions` (`extension_id`, `package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `checked_out`, `checked_out_time`, `ordering`, `state`, `namespace`) VALUES | ||
| (35, 0, 'com_workflow', 'component', 'com_workflow', '', 1, 1, 0, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0, 'Joomla\\Component\\Workflow'); | ||
|
|
||
| -- | ||
| -- Creating Associations for existing content | ||
| -- | ||
| 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`; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hello @nikosdion as discussed on JAB in Cologne, I added the migration INSERT. Could you please look over the file and see, if there is something to improve? Perhaps we have to handle the asset_id in a seperate way? Thank you very much!
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi Benjamin! Sorry for the late reply. I got a gastrointestinal infection right after JaB and I'm still quite awful. This query is exactly what I had in mind when we talked! 👍
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you! |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The MySQL 'TEXT' type cannot have a DEFAULT value (other than NULL)