-
Notifications
You must be signed in to change notification settings - Fork 12
User schema(db) #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
User schema(db) #116
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
6691225
updated readme
MikeSewell e2d1395
updated readme
MikeSewell 45e72ef
added send msg to new user on join
MikeSewell 40b66aa
added welcome reply
MikeSewell fe11524
Updated welcome to utilize username from code review
MikeSewell 77ae034
fixcode break with author
MikeSewell 37de62a
Added new user schema
MikeSewell 48dda25
added config folder
MikeSewell 8f72e80
changed user table back to members table
MikeSewell b544359
added uuid back to members table
MikeSewell 095c0c2
changed messages to messagesCount
MikeSewell deb82fb
updated with migration files to add current tables with up destroying…
MikeSewell 01d3435
added fields to member schema
MikeSewell f7ce53d
removed files and code that came over with another branch
MikeSewell ec7217e
removed files and code that came over with another branch
MikeSewell 7c60475
Merge branch 'dev' into UserSchema(db)
krogers78 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
updated with migration files to add current tables with up destroying…
… database
- Loading branch information
commit deb82fb952931391ca07dde6f20a2d38d1637496
There are no files selected for viewing
Empty file.
21 changes: 7 additions & 14 deletions
21
db/migrations/20180306015519-create-user.js → ...igrations/20170920201305-create-member.js
100644 → 100755
This file contains hidden or 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 hidden or 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,15 @@ | ||
| 'use strict'; | ||
|
|
||
| module.exports = { | ||
| up: (queryInterface, Sequelize) => { | ||
| return queryInterface.addColumn('Members', 'processed', { | ||
| type: Sequelize.BOOLEAN, | ||
| defaultValue: 0, | ||
| allowNull: false | ||
| }); | ||
| }, | ||
|
|
||
| down: (queryInterface, Sequelize) => { | ||
| return queryInterface.removeColumn('Members', 'processed'); | ||
| } | ||
| }; |
This file contains hidden or 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,9 @@ | ||
| 'use strict'; | ||
|
|
||
| module.exports = { | ||
| up: (queryInterface, Sequelize) => queryInterface.addColumn("Members", "messagesCount", { | ||
| type: Sequelize.INTEGER, | ||
| }), | ||
|
|
||
| down: (queryInterface, Sequelize) => queryInterface.removeColumn("Members", "messagesCount"), | ||
| }; | ||
This file contains hidden or 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,11 @@ | ||
| 'use strict'; | ||
|
|
||
| module.exports = { | ||
| up: (queryInterface, Sequelize) => | ||
| queryInterface.addColumn('Members', 'points', { | ||
| type: Sequelize.INTEGER, | ||
| }), | ||
|
|
||
| down: (queryInterface, Sequelize) => | ||
| queryInterface.removeColumn('Members', 'points'), | ||
| }; |
This file contains hidden or 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 hidden or 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,15 +1,18 @@ | ||
| const utils = require('apex-util'); | ||
|
|
||
|
|
||
| module.exports = (sequelize, DataTypes) => { | ||
| const Member = sequelize.define('Member', { | ||
| discorduser: DataTypes.STRING, | ||
| email: DataTypes.STRING, | ||
| points: DataTypes.STRING, | ||
| messagesCount: DataTypes.INTEGER, | ||
| verified: DataTypes.BOOLEAN }, {}); | ||
| Member.associate = (models) => { | ||
| // associations can be defined here | ||
| utils.log('member models/member :', models, 3); | ||
| }; | ||
| uuid: DataTypes.STRING, | ||
| verified: DataTypes.BOOLEAN, | ||
| }, { | ||
| classMethods: { | ||
| associate: (models) => { | ||
| // associations can be defined here | ||
| console.log(models); | ||
| }, | ||
| }, | ||
| }); | ||
| return Member; | ||
| }; |
This file contains hidden or 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,18 @@ | ||
| 'use strict'; | ||
|
|
||
| const uuidv4 = require('uuid/v4'); | ||
|
|
||
| module.exports = { | ||
| up: (queryInterface, Sequelize) => { | ||
| return queryInterface.bulkInsert('Members', [{ | ||
| discorduser: '226894986262740993', | ||
| email: 'chapman@apextion.com', | ||
| uuid: uuidv4(), | ||
| verified: 0, | ||
| }], {}); | ||
| }, | ||
|
|
||
| down: (queryInterface, Sequelize) => { | ||
| return queryInterface.bulkDelete('Members', null, {}); | ||
| } | ||
| }; |
This file contains hidden or 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,9 @@ | ||
| const models = require('../models'); | ||
| const uuidv4 = require('uuid/v4'); | ||
|
|
||
| models.Member.create({ | ||
| discorduser: '@fsafas', | ||
| email: 'fasfasaf@apextion.com', | ||
| uuid: uuidv4(), | ||
| verified: 1 | ||
| }).then(console.log).catch(console.error); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this column matter as per my previous comments about not needing to count the messages, but rather apply a point transformation onto the user's point total upon a message being sent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We wanted to track who has sent the most messages as well. Of course, this won't start tracking until the merge. But as a reward, we want to track message count.