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
67150c35
Commit
67150c35
authored
7 years ago
by
Tobias Reischmann
Browse files
Options
Downloads
Patches
Plain Diff
Added db tables for workflow and worflow_definition
parent
8639a5c3
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
+24
-0
24 additions, 0 deletions
db/install.xml
db/upgrade.php
+50
-0
50 additions, 0 deletions
db/upgrade.php
version.php
+1
-1
1 addition, 1 deletion
version.php
with
75 additions
and
1 deletion
db/install.xml
+
24
−
0
View file @
67150c35
...
...
@@ -90,5 +90,29 @@
<KEY
NAME=
"primary"
TYPE=
"primary"
FIELDS=
"id"
/>
</KEYS>
</TABLE>
<TABLE
NAME=
"tool_cleanupcourses_workflow"
COMMENT=
"Workflow definitions for processes"
>
<FIELDS>
<FIELD
NAME=
"id"
TYPE=
"int"
LENGTH=
"10"
NOTNULL=
"true"
SEQUENCE=
"true"
/>
<FIELD
NAME=
"title"
TYPE=
"char"
LENGTH=
"255"
NOTNULL=
"true"
SEQUENCE=
"false"
COMMENT=
"Title of a workflow"
/>
<FIELD
NAME=
"active"
TYPE=
"int"
LENGTH=
"1"
NOTNULL=
"true"
DEFAULT=
"0"
SEQUENCE=
"false"
COMMENT=
"active status of a workflow"
/>
<FIELD
NAME=
"timeactive"
TYPE=
"int"
LENGTH=
"10"
NOTNULL=
"false"
SEQUENCE=
"false"
COMMENT=
"timestamp the workflow was set active"
/>
</FIELDS>
<KEYS>
<KEY
NAME=
"primary"
TYPE=
"primary"
FIELDS=
"id"
/>
</KEYS>
</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>
</XMLDB>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
db/upgrade.php
+
50
−
0
View file @
67150c35
...
...
@@ -29,5 +29,55 @@ function xmldb_tool_cleanupcourses_upgrade($oldversion) {
global
$DB
;
$dbman
=
$DB
->
get_manager
();
if
(
$oldversion
<
2017081000
)
{
// 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'
));
// Conditionally launch add field id.
if
(
!
$dbman
->
table_exists
(
$table
))
{
$dbman
->
create_table
(
$table
);
}
// Create table tool_cleanupcourses_workflow.
$table
=
new
xmldb_table
(
'tool_cleanupcourses_workflow'
);
$table
->
add_field
(
'id'
,
XMLDB_TYPE_INTEGER
,
'10'
,
null
,
XMLDB_NOTNULL
,
XMLDB_SEQUENCE
,
null
,
null
);
$table
->
add_field
(
'title'
,
XMLDB_TYPE_CHAR
,
'255'
,
null
,
XMLDB_NOTNULL
,
null
,
null
,
'id'
);
$table
->
add_field
(
'active'
,
XMLDB_TYPE_INTEGER
,
'1'
,
null
,
XMLDB_NOTNULL
,
null
,
'0'
,
'title'
);
$table
->
add_field
(
'timeacive'
,
XMLDB_TYPE_INTEGER
,
'10'
,
null
,
null
,
null
,
null
,
'active'
);
$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 launch add field id.
if
(
!
$dbman
->
table_exists
(
$table
))
{
$dbman
->
create_table
(
$table
);
}
// Changing precision of field followedby on table tool_cleanupcourses_step to (10).
$table
=
new
xmldb_table
(
'tool_cleanupcourses_step'
);
$field
=
new
xmldb_field
(
'followedby'
,
XMLDB_TYPE_INTEGER
,
'10'
,
null
,
null
,
null
,
null
,
'subpluginname'
);
// Launch change of precision for field followedby.
$dbman
->
change_field_precision
(
$table
,
$field
);
// Changing precision of field followedby on table tool_cleanupcourses_trigger to (10).
$table
=
new
xmldb_table
(
'tool_cleanupcourses_trigger'
);
$field
=
new
xmldb_field
(
'followedby'
,
XMLDB_TYPE_INTEGER
,
'10'
,
null
,
null
,
null
,
null
,
'enabled'
);
// Launch change of precision for field followedby.
$dbman
->
change_field_precision
(
$table
,
$field
);
// Cleanupcourses savepoint reached.
upgrade_plugin_savepoint
(
true
,
2017081000
,
'tool'
,
'cleanupcourses'
);
}
return
true
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
version.php
+
1
−
1
View file @
67150c35
...
...
@@ -23,5 +23,5 @@
defined
(
'MOODLE_INTERNAL'
)
||
die
;
$plugin
->
version
=
20170
621
00
;
$plugin
->
version
=
20170
810
00
;
$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