Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moodle-tool_lifecycle
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elc
moodle-tool_lifecycle
Commits
0c66f833
Commit
0c66f833
authored
7 years ago
by
Tobias Reischmann
Browse files
Options
Downloads
Patches
Plain Diff
Integradted workflows in step and trigger table and removed followedby
parent
8fa6fd21
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
db/install.xml
+3
-14
3 additions, 14 deletions
db/install.xml
db/upgrade.php
+38
-24
38 additions, 24 deletions
db/upgrade.php
version.php
+1
-1
1 addition, 1 deletion
version.php
with
42 additions
and
39 deletions
db/install.xml
+
3
−
14
View file @
0c66f833
...
@@ -44,10 +44,12 @@
...
@@ -44,10 +44,12 @@
<FIELD
NAME=
"id"
TYPE=
"int"
LENGTH=
"10"
NOTNULL=
"true"
SEQUENCE=
"true"
/>
<FIELD
NAME=
"id"
TYPE=
"int"
LENGTH=
"10"
NOTNULL=
"true"
SEQUENCE=
"true"
/>
<FIELD
NAME=
"instancename"
TYPE=
"char"
LENGTH=
"50"
NOTNULL=
"true"
SEQUENCE=
"false"
COMMENT=
"instancename of the step"
/>
<FIELD
NAME=
"instancename"
TYPE=
"char"
LENGTH=
"50"
NOTNULL=
"true"
SEQUENCE=
"false"
COMMENT=
"instancename of the step"
/>
<FIELD
NAME=
"subpluginname"
TYPE=
"char"
LENGTH=
"50"
NOTNULL=
"true"
SEQUENCE=
"false"
COMMENT=
"name of the subplugin"
/>
<FIELD
NAME=
"subpluginname"
TYPE=
"char"
LENGTH=
"50"
NOTNULL=
"true"
SEQUENCE=
"false"
COMMENT=
"name of the subplugin"
/>
<FIELD
NAME=
"followedby"
TYPE=
"int"
LENGTH=
"10"
NOTNULL=
"false"
SEQUENCE=
"false"
COMMENT=
"tells which step follows this one in the cleanup process"
/>
<FIELD
NAME=
"workflowid"
TYPE=
"int"
LENGTH=
"10"
NOTNULL=
"true"
SEQUENCE=
"false"
COMMENT=
"id of the workflow"
/>
<FIELD
NAME=
"sortindex"
TYPE=
"int"
LENGTH=
"5"
NOTNULL=
"true"
SEQUENCE=
"false"
COMMENT=
"Order within the workflow in which the steps are executed"
/>
</FIELDS>
</FIELDS>
<KEYS>
<KEYS>
<KEY
NAME=
"primary"
TYPE=
"primary"
FIELDS=
"id"
/>
<KEY
NAME=
"primary"
TYPE=
"primary"
FIELDS=
"id"
/>
<KEY
NAME=
"workflowid_fk"
TYPE=
"foreign"
FIELDS=
"workflowid"
REFTABLE=
"tool_cleanupcourses_workflow"
REFFIELDS=
"id"
/>
</KEYS>
</KEYS>
</TABLE>
</TABLE>
<TABLE
NAME=
"tool_cleanupcourses_settings"
COMMENT=
"Settings for step instances"
>
<TABLE
NAME=
"tool_cleanupcourses_settings"
COMMENT=
"Settings for step instances"
>
...
@@ -101,18 +103,5 @@
...
@@ -101,18 +103,5 @@
<KEY
NAME=
"primary"
TYPE=
"primary"
FIELDS=
"id"
/>
<KEY
NAME=
"primary"
TYPE=
"primary"
FIELDS=
"id"
/>
</KEYS>
</KEYS>
</TABLE>
</TABLE>
<TABLE
NAME=
"tool_cleanupcourses_wf_steps"
COMMENT=
"Assignment of steps to a workflow"
>
<FIELDS>
<FIELD
NAME=
"id"
TYPE=
"int"
LENGTH=
"10"
NOTNULL=
"true"
SEQUENCE=
"true"
/>
<FIELD
NAME=
"workflowid"
TYPE=
"int"
LENGTH=
"10"
NOTNULL=
"true"
SEQUENCE=
"false"
COMMENT=
"id of the workflow"
/>
<FIELD
NAME=
"stepid"
TYPE=
"int"
LENGTH=
"10"
NOTNULL=
"true"
SEQUENCE=
"false"
COMMENT=
"Id of the step instance"
/>
<FIELD
NAME=
"order"
TYPE=
"int"
LENGTH=
"5"
NOTNULL=
"true"
SEQUENCE=
"false"
COMMENT=
"Order in which the steps are executed"
/>
</FIELDS>
<KEYS>
<KEY
NAME=
"primary"
TYPE=
"primary"
FIELDS=
"id"
/>
<KEY
NAME=
"workflowid_fk"
TYPE=
"foreign"
FIELDS=
"workflowid"
REFTABLE=
"tool_cleanupcourses_workflow"
REFFIELDS=
"id"
/>
<KEY
NAME=
"stepid_fk"
TYPE=
"foreign"
FIELDS=
"stepid"
REFTABLE=
"tool_cleanupcourses_step"
REFFIELDS=
"id"
/>
</KEYS>
</TABLE>
</TABLES>
</TABLES>
</XMLDB>
</XMLDB>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
db/upgrade.php
+
38
−
24
View file @
0c66f833
...
@@ -29,23 +29,7 @@ function xmldb_tool_cleanupcourses_upgrade($oldversion) {
...
@@ -29,23 +29,7 @@ function xmldb_tool_cleanupcourses_upgrade($oldversion) {
global
$DB
;
global
$DB
;
$dbman
=
$DB
->
get_manager
();
$dbman
=
$DB
->
get_manager
();
if
(
$oldversion
<
2017081000
)
{
if
(
$oldversion
<
2017081100
)
{
// Create table tool_cleanupcourses_wf_steps.
$table
=
new
xmldb_table
(
'tool_cleanupcourses_wf_steps'
);
$table
->
add_field
(
'id'
,
XMLDB_TYPE_INTEGER
,
'10'
,
null
,
XMLDB_NOTNULL
,
XMLDB_SEQUENCE
,
null
,
null
);
$table
->
add_field
(
'workflowid'
,
XMLDB_TYPE_INTEGER
,
'10'
,
null
,
XMLDB_NOTNULL
,
null
,
null
,
'id'
);
$table
->
add_field
(
'stepid'
,
XMLDB_TYPE_INTEGER
,
'10'
,
null
,
XMLDB_NOTNULL
,
null
,
null
,
'workflowid'
);
$table
->
add_field
(
'sortindex'
,
XMLDB_TYPE_INTEGER
,
'5'
,
null
,
XMLDB_NOTNULL
,
null
,
null
,
'stepid'
);
$table
->
add_key
(
'primary'
,
XMLDB_KEY_PRIMARY
,
array
(
'id'
));
$table
->
add_key
(
'workflowid_fk'
,
XMLDB_KEY_FOREIGN
,
array
(
'workflowid'
),
'tool_cleanupcourses_workflow'
,
array
(
'id'
));
$table
->
add_key
(
'stepid_fk'
,
XMLDB_KEY_FOREIGN
,
array
(
'stepid'
),
'tool_cleanupcourses_step'
,
array
(
'id'
));
// Conditionally create the table.
if
(
!
$dbman
->
table_exists
(
$table
))
{
$dbman
->
create_table
(
$table
);
}
// Create table tool_cleanupcourses_workflow.
// Create table tool_cleanupcourses_workflow.
$table
=
new
xmldb_table
(
'tool_cleanupcourses_workflow'
);
$table
=
new
xmldb_table
(
'tool_cleanupcourses_workflow'
);
...
@@ -62,20 +46,50 @@ function xmldb_tool_cleanupcourses_upgrade($oldversion) {
...
@@ -62,20 +46,50 @@ function xmldb_tool_cleanupcourses_upgrade($oldversion) {
// Changing precision of field followedby on table tool_cleanupcourses_step to (10).
// Changing precision of field followedby on table tool_cleanupcourses_step to (10).
$table
=
new
xmldb_table
(
'tool_cleanupcourses_step'
);
$table
=
new
xmldb_table
(
'tool_cleanupcourses_step'
);
$field
=
new
xmldb_field
(
'followedby'
,
XMLDB_TYPE_INTEGER
,
'10'
,
null
,
null
,
null
,
null
,
'subpluginname'
);
$field
=
new
xmldb_field
(
'followedby'
);
// Conditionally drop followedby field
if
(
$dbman
->
field_exists
(
$table
,
$field
))
{
$dbman
->
drop_field
(
$table
,
$field
);
}
$field
=
new
xmldb_field
(
'workflowid'
,
XMLDB_TYPE_INTEGER
,
'10'
,
null
,
XMLDB_NOTNULL
,
null
,
null
,
'subpluginname'
);
$key
=
new
xmldb_key
(
'workflowid_fk'
,
XMLDB_KEY_FOREIGN
,
array
(
'workflowid'
),
'tool_cleanupcourses_workflow'
,
array
(
'id'
));
// Conditionally create the field.
if
(
!
$dbman
->
field_exists
(
$table
,
$field
))
{
$dbman
->
add_field
(
$table
,
$field
);
$dbman
->
add_key
(
$table
,
$key
);
}
$field
=
new
xmldb_field
(
'sortindex'
,
XMLDB_TYPE_INTEGER
,
'5'
,
null
,
XMLDB_NOTNULL
,
null
,
null
,
'workflowid'
);
// Launch change of precision for field followedby.
// Conditionally create the field.
$dbman
->
change_field_precision
(
$table
,
$field
);
if
(
!
$dbman
->
field_exists
(
$table
,
$field
))
{
$dbman
->
add_field
(
$table
,
$field
);
}
// Changing precision of field followedby on table tool_cleanupcourses_trigger to (10).
// Changing precision of field followedby on table tool_cleanupcourses_trigger to (10).
$table
=
new
xmldb_table
(
'tool_cleanupcourses_trigger'
);
$table
=
new
xmldb_table
(
'tool_cleanupcourses_trigger'
);
$field
=
new
xmldb_field
(
'followedby'
,
XMLDB_TYPE_INTEGER
,
'10'
,
null
,
null
,
null
,
null
,
'enabled'
);
$field
=
new
xmldb_field
(
'followedby'
);
// Conditionally drop followedby field
if
(
$dbman
->
field_exists
(
$table
,
$field
))
{
$dbman
->
drop_field
(
$table
,
$field
);
}
// Launch change of precision for field followedby.
// Add workflowfield to trigger
$dbman
->
change_field_precision
(
$table
,
$field
);
$field
=
new
xmldb_field
(
'workflowid'
,
XMLDB_TYPE_INTEGER
,
'10'
,
null
,
null
,
null
,
null
,
'enabled'
);
$key
=
new
xmldb_key
(
'workflowid_fk'
,
XMLDB_KEY_FOREIGN
,
array
(
'workflowid'
),
'tool_cleanupcourses_workflow'
,
array
(
'id'
));
// Conditionally create the field.
if
(
!
$dbman
->
field_exists
(
$table
,
$field
))
{
$dbman
->
add_field
(
$table
,
$field
);
$dbman
->
add_key
(
$table
,
$key
);
}
// Cleanupcourses savepoint reached.
// Cleanupcourses savepoint reached.
upgrade_plugin_savepoint
(
true
,
2017081
0
00
,
'tool'
,
'cleanupcourses'
);
upgrade_plugin_savepoint
(
true
,
2017081
1
00
,
'tool'
,
'cleanupcourses'
);
}
}
return
true
;
return
true
;
...
...
This diff is collapsed.
Click to expand it.
version.php
+
1
−
1
View file @
0c66f833
...
@@ -23,5 +23,5 @@
...
@@ -23,5 +23,5 @@
defined
(
'MOODLE_INTERNAL'
)
||
die
;
defined
(
'MOODLE_INTERNAL'
)
||
die
;
$plugin
->
version
=
2017081
0
00
;
$plugin
->
version
=
2017081
1
00
;
$plugin
->
component
=
'tool_cleanupcourses'
;
$plugin
->
component
=
'tool_cleanupcourses'
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment