Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Stud.IP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Jan-Hendrik Willms
Stud.IP
Commits
5c26971b
Commit
5c26971b
authored
2 years ago
by
Jan-Hendrik Willms
Committed by
David Siegfried
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
adjust migration 246 in order to remove the consultation plugin completely, fixes #1731
Closes #1731 Merge request
studip/studip!1131
parent
2fa10e47
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
db/migrations/1.246_consultations.php
+34
-10
34 additions, 10 deletions
db/migrations/1.246_consultations.php
with
34 additions
and
10 deletions
db/migrations/1.246_consultations.php
+
34
−
10
View file @
5c26971b
...
...
@@ -134,7 +134,7 @@ class Consultations extends Migration
if
(
$statement
->
rowCount
()
!==
2
)
{
$this
->
announce
(
'Unable to migrate SprechstundenPlugin data due to incompatible database format'
);
return
false
;
return
;
}
...
...
@@ -280,30 +280,54 @@ class Consultations extends Migration
FROM `SprechstundenAnmeldung`"
;
DBManager
::
get
()
->
exec
(
$query
);
//
Activate consultations if plugin was enabled
$query
=
"SELECT `enabled` = 'yes'
//
Get old plugin info
$query
=
"SELECT
`pluginid`,
`enabled` = 'yes'
AS is_active, `pluginpath`
FROM `plugins`
WHERE `pluginclassname` = 'SprechstundenPlugin'"
;
$
enabled
=
(
bool
)
DBManager
::
get
()
->
query
(
$query
)
->
fetch
Column
(
);
$
info
=
DBManager
::
get
()
->
query
(
$query
)
->
fetch
(
PDO
::
FETCH_ASSOC
);
if
(
!
$
enabled
)
{
if
(
!
$
info
)
{
return
;
}
$query
=
"INSERT INTO `config_values` (
// Active consultations if plugin was activated
if
(
$info
[
'is_active'
])
{
$query
=
"INSERT INTO `config_values` (
`field`, `range_id`, `value`,
`mkdate`, `chdate`, `comment`
) VALUES (
'CONSULTATION_ENABLED', 'studip', '1',
UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), ''
)"
;
DBManager
::
get
()
->
exec
(
$query
);
DBManager
::
get
()
->
exec
(
$query
);
}
// Deactivate plugin
$query
=
"UPDATE `plugins`
SET `enabled` = 'no'
// Remove plugin from database
$query
=
"DELETE FROM `plugins`
WHERE `pluginclassname` = 'SprechstundenPlugin'"
;
DBManager
::
get
()
->
exec
(
$query
);
DBManager
::
get
()
->
execute
(
"DELETE FROM plugins_activated WHERE pluginid = ?"
,
[
$info
[
'pluginid'
]]);
DBManager
::
get
()
->
execute
(
"DELETE FROM roles_plugins WHERE pluginid = ?"
,
[
$info
[
'pluginid'
]]);
// Delete plugin files
$plugin_path
=
"
{
$GLOBALS
[
'PLUGINS_PATH'
]
}
/
{
$info
[
'pluginpath'
]
}
"
;
if
(
file_exists
(
$plugin_path
))
{
@
rmdirr
(
$plugin_path
);
}
// Delete old plugin tables
$query
=
"DROP TABLE IF EXISTS `SprechstundenAnmeldung`"
;
DBManager
::
get
()
->
exec
(
$query
);
$query
=
"DROP TABLE IF EXISTS `SprechstundenTermin`"
;
DBManager
::
get
()
->
exec
(
$query
);
$query
=
"DROP TABLE IF EXISTS `SprechstundenTerminDesc`"
;
DBManager
::
get
()
->
exec
(
$query
);
$query
=
"DROP TABLE IF EXISTS `SprechstundenZeitSlot`"
;
DBManager
::
get
()
->
exec
(
$query
);
}
private
function
adjustTimestamp
(
$current
,
$other
)
...
...
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