Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ARSnova Backend
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Privacy
Imprint
Contact
Snippets
Groups
Projects
Show more breadcrumbs
John Samuel Ako Deutesfeld
ARSnova Backend
Commits
155eba7c
Commit
155eba7c
authored
7 years ago
by
Daniel Gerhardt
Browse files
Options
Downloads
Patches
Plain Diff
Exclude duplicate LoggedIn documents from migration
parent
e48b912e
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/de/thm/arsnova/persistance/couchdb/migrations/V2ToV3Migration.java
+5
-2
5 additions, 2 deletions
...snova/persistance/couchdb/migrations/V2ToV3Migration.java
with
5 additions
and
2 deletions
src/main/java/de/thm/arsnova/persistance/couchdb/migrations/V2ToV3Migration.java
+
5
−
2
View file @
155eba7c
...
@@ -196,6 +196,8 @@ public class V2ToV3Migration implements Migration {
...
@@ -196,6 +196,8 @@ public class V2ToV3Migration implements Migration {
if
(
usernames
.
contains
(
loggedInV2
.
getUser
()))
{
if
(
usernames
.
contains
(
loggedInV2
.
getUser
()))
{
continue
;
continue
;
}
}
/* There might be rare cases of duplicate LoggedIn records for a user so add them to the filter list */
usernames
.
add
(
loggedInV2
.
getUser
());
UserProfile
profileV3
=
migrator
.
migrate
(
null
,
loggedInV2
,
loadMotdList
(
loggedInV2
.
getUser
()));
UserProfile
profileV3
=
migrator
.
migrate
(
null
,
loggedInV2
,
loadMotdList
(
loggedInV2
.
getUser
()));
profileV3
.
setAcknowledgedMotds
(
migrateMotdIds
(
profileV3
.
getAcknowledgedMotds
()));
profileV3
.
setAcknowledgedMotds
(
migrateMotdIds
(
profileV3
.
getAcknowledgedMotds
()));
profilesV3
.
add
(
profileV3
);
profilesV3
.
add
(
profileV3
);
...
@@ -222,8 +224,9 @@ public class V2ToV3Migration implements Migration {
...
@@ -222,8 +224,9 @@ public class V2ToV3Migration implements Migration {
for
(
de
.
thm
.
arsnova
.
entities
.
migration
.
v2
.
Room
roomV2
:
roomsV2
)
{
for
(
de
.
thm
.
arsnova
.
entities
.
migration
.
v2
.
Room
roomV2
:
roomsV2
)
{
List
<
UserProfile
>
profiles
=
userRepository
.
findByLoginId
(
roomV2
.
getCreator
());
List
<
UserProfile
>
profiles
=
userRepository
.
findByLoginId
(
roomV2
.
getCreator
());
if
(
profiles
.
size
()
!=
1
)
{
if
(
profiles
.
size
()
==
0
)
{
throw
new
Error
(
"Session creator cannot be determined ambiguously."
);
// Session creator does not exist, skipping: roomV2.getCreator(), roomV2.getId()
continue
;
}
}
roomsV3
.
add
(
migrator
.
migrate
(
roomV2
,
profiles
.
get
(
0
)));
roomsV3
.
add
(
migrator
.
migrate
(
roomV2
,
profiles
.
get
(
0
)));
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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