Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iena-competency-block
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
iena
iena-competency-block
Commits
ce083550
Commit
ce083550
authored
3 years ago
by
Myriam Delaruelle
Browse files
Options
Downloads
Patches
Plain Diff
support old version: drop old table when fields are old
parent
ac141265
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
db/upgrade.php
+6
-2
6 additions, 2 deletions
db/upgrade.php
version.php
+1
-1
1 addition, 1 deletion
version.php
with
7 additions
and
3 deletions
db/upgrade.php
+
6
−
2
View file @
ce083550
...
...
@@ -7,7 +7,7 @@ function xmldb_block_competency_iena_upgrade($oldversion) {
$dbman
=
$DB
->
get_manager
();
$result
=
TRUE
;
if
(
$oldversion
<
2021
070600
)
{
if
(
$oldversion
<
2021
240901
)
{
// Define field id to be added to block_competency_iena.
$table
=
new
xmldb_table
(
'block_competency_iena'
);
...
...
@@ -23,6 +23,10 @@ function xmldb_block_competency_iena_upgrade($oldversion) {
if
(
!
$dbman
->
table_exists
(
$table
))
{
$dbman
->
create_table
(
$table
);
}
else
if
(
!
$dbman
->
field_exists
(
'block_competency_iena'
,
'cmid'
)){
$dbman
->
drop_table
(
$table
);
$dbman
->
create_table
(
$table
);
}
//Support for old versions: we copy the already linked activities to the new database
try
{
...
...
@@ -46,7 +50,7 @@ function xmldb_block_competency_iena_upgrade($oldversion) {
}
// Competency_iena savepoint reached.
upgrade_block_savepoint
(
true
,
2021
070600
,
'competency_iena'
);
upgrade_block_savepoint
(
true
,
2021
240901
,
'competency_iena'
);
}
return
$result
;
...
...
This diff is collapsed.
Click to expand it.
version.php
+
1
−
1
View file @
ce083550
...
...
@@ -28,7 +28,7 @@
*/
defined
(
'MOODLE_INTERNAL'
)
||
die
();
$plugin
->
version
=
202124090
0
;
$plugin
->
version
=
202124090
1
;
$plugin
->
requires
=
2014051200
;
$plugin
->
component
=
'block_competency_iena'
;
$plugin
->
release
=
'v1.0'
;
...
...
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