Skip to content
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

#167619168 Create Sessions Table #18

Merged
merged 5 commits into from
Aug 1, 2019

Conversation

ayodejiAA
Copy link
Contributor

@ayodejiAA ayodejiAA commented Jul 31, 2019

What does this PR do?

  • Create migration for session table
  • Add demo seed file

Description of Task proposed in this pull request?

  • Add session migration file
  • Add Session model
  • Add Session seed file

How should this be manually tested (Quality Assurance)?

  • Check out the branch
    -Add the database connection string in .env file
  • Run npm run db:seed

What are the relevant pivotal tracker stories?

Any background context you want to add (Operations Impact)?

  • Requires database connection string for it to work

What I have learned working on this feature:

  • Use sequelize cli to generate migrations and seeds

Screenshots: [If you made some visual changes to the application please upload screenshots here, or remove this section]

  • n/a

- Create migration from session table
- Add demo seed file for session details

[Finishes #167619168]
server/database/seeds/20190731140725-demo-session.js Outdated Show resolved Hide resolved
server/database/seeds/20190731140725-demo-session.js Outdated Show resolved Hide resolved
server/database/seeds/20190731140725-demo-session.js Outdated Show resolved Hide resolved
server/database/models/session.js Outdated Show resolved Hide resolved
server/database/models/session.js Outdated Show resolved Hide resolved
@chialuka chialuka temporarily deployed to authors-haven-developmen-pr-18 July 31, 2019 14:59 Inactive
@ayodejiAA ayodejiAA added pr:review This is PR is currently under review by team priority:high This PR has a high priority type:chore Changes that don't modify business code labels Jul 31, 2019
- Create migration from session table
- Add demo seed file for session details

[Finishes #167619168]
@ayodejiAA ayodejiAA temporarily deployed to authors-haven-developmen-pr-18 July 31, 2019 15:04 Inactive
@ayodejiAA ayodejiAA force-pushed the ch-create-session-table-167619168 branch from 3611c93 to 958ef82 Compare July 31, 2019 15:10
@ayodejiAA ayodejiAA temporarily deployed to authors-haven-developmen-pr-18 July 31, 2019 15:10 Inactive
@ayodejiAA ayodejiAA force-pushed the ch-create-session-table-167619168 branch from 958ef82 to 612accb Compare July 31, 2019 15:13
@ayodejiAA ayodejiAA temporarily deployed to authors-haven-developmen-pr-18 July 31, 2019 15:13 Inactive
@ayodejiAA ayodejiAA force-pushed the ch-create-session-table-167619168 branch from 612accb to 42ab2aa Compare July 31, 2019 15:17
@ayodejiAA ayodejiAA temporarily deployed to authors-haven-developmen-pr-18 July 31, 2019 15:17 Inactive
@ayodejiAA ayodejiAA changed the title #167619168 Create sessions table #167619168 Create Sessions Table Jul 31, 2019
type: Sequelize.STRING
},
userAgent: {
allowNull: false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

allow null here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

type: Sequelize.DATE
},
ipAddress: {
allowNull: false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

allow null here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think allow null here means that the field should be nullable, or am I wrong?

userId: DataTypes.INTEGER,
active: DataTypes.BOOLEAN,
devicePlatform: DataTypes.STRING,
expiresAt: DataTypes.DATE,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't sequelize have a date time type?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is datetime, confirmed.

Copy link
Contributor

@dinobi dinobi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add model tests

@ayodejiAA
Copy link
Contributor Author

Please add model tests

Okay. On it.

@ayodejiAA ayodejiAA force-pushed the ch-create-session-table-167619168 branch from 42ab2aa to 2fe96bb Compare July 31, 2019 18:49
@ayodejiAA ayodejiAA temporarily deployed to authors-haven-developmen-pr-18 July 31, 2019 18:49 Inactive
@ayodejiAA ayodejiAA force-pushed the ch-create-session-table-167619168 branch from 2fe96bb to 1021d4f Compare July 31, 2019 18:51
@ayodejiAA ayodejiAA temporarily deployed to authors-haven-developmen-pr-18 July 31, 2019 18:52 Inactive
- Create migration for session table
- Add demo seed file for session details

[Finishes #167619168]
@ayodejiAA ayodejiAA force-pushed the ch-create-session-table-167619168 branch from 1021d4f to d8cb777 Compare July 31, 2019 18:58
@ayodejiAA ayodejiAA temporarily deployed to authors-haven-developmen-pr-18 July 31, 2019 18:59 Inactive
@ayodejiAA ayodejiAA requested a review from dinobi July 31, 2019 19:02
@ayodejiAA
Copy link
Contributor Author

Please add model tests
@dinobi Implemented the model test

henryade
henryade previously approved these changes Aug 1, 2019
@ayodejiAA ayodejiAA force-pushed the ch-create-session-table-167619168 branch from d8cb777 to 6914c9b Compare August 1, 2019 12:20
@ayodejiAA ayodejiAA temporarily deployed to authors-haven-developmen-pr-18 August 1, 2019 12:21 Inactive
Adekoreday
Adekoreday previously approved these changes Aug 1, 2019
type: Sequelize.DATE
},
ipAddress: {
allowNull: false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think allow null here means that the field should be nullable, or am I wrong?

@ayodejiAA ayodejiAA force-pushed the ch-create-session-table-167619168 branch from 6914c9b to f3f7b32 Compare August 1, 2019 13:56
@ayodejiAA ayodejiAA temporarily deployed to authors-haven-developmen-pr-18 August 1, 2019 13:56 Inactive
- Create migration from session table
- Add demo seed file for session details

[Finishes #167619168]
@ayodejiAA ayodejiAA force-pushed the ch-create-session-table-167619168 branch from f3f7b32 to 84febf5 Compare August 1, 2019 14:09
@ayodejiAA ayodejiAA temporarily deployed to authors-haven-developmen-pr-18 August 1, 2019 14:09 Inactive
- Create migration from session table
- Add demo seed file for session details

[Finishes #167619168]
@dinobi dinobi merged commit 452b993 into develop Aug 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:review This is PR is currently under review by team priority:high This PR has a high priority type:chore Changes that don't modify business code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants