Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rocket.Chat
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor 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
RocketChat
Rocket.Chat
Commits
0821885d
Unverified
Commit
0821885d
authored
8 years ago
by
Marcelo Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
Migration related to #5780
parent
d2b8f292
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
server/startup/migrations/v083.js
+9
-15
9 additions, 15 deletions
server/startup/migrations/v083.js
with
9 additions
and
15 deletions
server/startup/migrations/v083.js
+
9
−
15
View file @
0821885d
RocketChat
.
Migrations
.
add
({
RocketChat
.
Migrations
.
add
({
version
:
83
,
version
:
83
,
up
:
function
()
{
up
:
function
()
{
if
(
RocketChat
&&
RocketChat
.
models
&&
RocketChat
.
models
.
Users
)
{
if
(
RocketChat
&&
RocketChat
.
models
&&
RocketChat
.
models
.
Settings
&&
RocketChat
.
models
.
Users
)
{
RocketChat
.
models
.
Users
.
update
({
username
:
'
Rocket.Cat
'
},
{
$set
:
{
username
:
'
rocket.cat
'
}
});
var
setting
=
RocketChat
.
models
.
Settings
.
findOne
({
_id
:
'
InternalHubot_Username
'
});
}
if
(
setting
&&
setting
.
value
)
{
if
(
RocketChat
&&
RocketChat
.
models
&&
RocketChat
.
models
.
Messages
)
{
var
username
=
setting
.
value
;
RocketChat
.
models
.
Messages
.
update
({
'
editedBy.username
'
:
'
Rocket.Cat
'
},
{
$set
:
{
'
editedBy.username
'
:
'
rocket.cat
'
}
});
var
user
=
RocketChat
.
models
.
Users
.
findOne
({
username
:
username
});
RocketChat
.
models
.
Messages
.
update
({
'
mentions.username
'
:
'
Rocket.Cat
'
},
{
$set
:
{
'
mentions.$.username
'
:
'
rocket.cat
'
}
});
if
(
!
user
&&
setting
.
value
===
'
Rocket.Cat
'
)
{
}
RocketChat
.
models
.
Settings
.
update
({
_id
:
'
InternalHubot_Username
'
},
{
$set
:
{
value
:
'
rocket.cat
'
,
packageValue
:
'
rocket.cat
'
}
});
if
(
RocketChat
&&
RocketChat
.
models
&&
RocketChat
.
models
.
Rooms
)
{
}
RocketChat
.
models
.
Rooms
.
update
({
'
usernames
'
:
'
Rocket.Cat
'
},
{
$set
:
{
'
usernames.$
'
:
'
rocket.cat
'
}
});
}
RocketChat
.
models
.
Rooms
.
update
({
'
muted
'
:
'
Rocket.Cat
'
},
{
$set
:
{
'
muted.$
'
:
'
rocket.cat
'
}
});
RocketChat
.
models
.
Rooms
.
update
({
'
u.username
'
:
'
Rocket.Cat
'
},
{
$set
:
{
'
u.username
'
:
'
rocket.cat
'
}
});
}
if
(
RocketChat
&&
RocketChat
.
models
&&
RocketChat
.
models
.
Subscriptions
)
{
RocketChat
.
models
.
Subscriptions
.
update
({
'
u.username
'
:
'
Rocket.Cat
'
},
{
$set
:
{
'
u.username
'
:
'
rocket.cat
'
}
});
RocketChat
.
models
.
Subscriptions
.
update
({
'
type
'
:
'
d
'
,
'
name
'
:
'
Rocket.Cat
'
},
{
$set
:
{
'
name
'
:
'
rocket.cat
'
}
});
}
}
}
}
});
});
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