-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
929be89
commit fd7c3b7
Showing
9 changed files
with
54 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,28 @@ | ||
lineSep = '---------------------------' | ||
|
||
Meteor.startup -> | ||
if not Meteor.users.findOne()? | ||
console.log lineSep.red | ||
console.log 'Inserting user admin'.red | ||
console.log 'email: admin@admin.com | password: admin'.red | ||
Meteor.defer -> | ||
|
||
|
||
if not ChatRoom.findOne('name': 'general')? | ||
ChatRoom.insert | ||
_id: 'GENERAL' | ||
usernames: [] | ||
ts: new Date() | ||
t: 'c' | ||
name: 'general' | ||
msgs: 0 | ||
|
||
|
||
# if not Meteor.users.findOne()? | ||
# console.log 'Inserting user admin'.red | ||
# console.log 'email: admin@admin.com | password: admin'.red | ||
|
||
id = Meteor.users.insert | ||
createdAt: new Date | ||
emails: [ | ||
address: 'admin@admin.com' | ||
verified: true | ||
], | ||
name: 'Admin' | ||
avatarOrigin: 'none' | ||
# id = Meteor.users.insert | ||
# createdAt: new Date | ||
# emails: [ | ||
# address: 'admin@admin.com' | ||
# verified: true | ||
# ], | ||
# name: 'Admin' | ||
# avatarOrigin: 'none' | ||
|
||
Accounts.setPassword id, 'admin' | ||
# Accounts.setPassword id, 'admin' |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Meteor.startup -> | ||
Migrations.add | ||
version: 6 | ||
up: -> | ||
|
||
console.log 'Changin _id of #general channel room from 57om6EQCcFami9wuT to GENERAL' | ||
room = ChatRoom.findOne('57om6EQCcFami9wuT') | ||
newId = 'GENERAL' | ||
if room | ||
ChatSubscription.update({'rid':room._id},{'$set':{'rid':newId}},{'multi':1}) | ||
ChatMessage.update({'rid':room._id},{'$set':{'rid':newId}},{'multi':1}) | ||
ChatRoom.remove({'_id':room._id}) | ||
delete room._id | ||
ChatRoom.upsert({'_id':newId}, { $set: room}) | ||
|
||
|
||
console.log 'End' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
Meteor.startup -> | ||
Meteor.defer -> | ||
Migrations.migrateTo 'latest' | ||
if Migrations.getVersion() isnt 0 | ||
Migrations.migrateTo 'latest' | ||
else | ||
control = Migrations._getControl() | ||
control.version = _.last(Migrations._list).version | ||
Migrations._setControl control |