forked from cidadedemocratica/pushingtogether
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creating seeds for setup an User and a Conversation
closes cidadedemocratica#87
- Loading branch information
Luan Guimarães
committed
Dec 1, 2016
1 parent
40b8b92
commit bedf5c4
Showing
2 changed files
with
22 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
'use strict'; | ||
|
||
var models = require('../../src/models'); | ||
var User = models.User; | ||
var helper = require('../../test/helper'); | ||
|
||
module.exports = { | ||
up: (queryInterface, Sequelize) => { | ||
return User.create(helper.validUserAttributes) | ||
.then((user) => { | ||
user.createConversation(helper.validConversationAttributes); | ||
}); | ||
}, | ||
|
||
down: function (queryInterface, Sequelize) { | ||
return User.destroy({ where: {} }); | ||
} | ||
}; | ||
|
||
|
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