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

Add LinkedIn Url to Officers Table/Model #92

Open
wants to merge 3 commits into
base: devlop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,12 @@ Only need to do this if you are working on scoreboard-related endpoints.

### Running the app
1. `npm install`
2. `npm run keygen`
3. `npm run bootstrap -- --admin:firstName [YOUR NAME] --admin:lastName [YOUR LAST NAME] --admin:dce [YOUR DCE] --keygen --seed` - Creates and migrates the database. If you specify the admin args, a membership will be created for that
2. `mkdir keys`
3. `npm run keygen`
4. `npm run bootstrap -- --admin:firstName [YOUR NAME] --admin:lastName [YOUR LAST NAME] --admin:dce [YOUR DCE] --keygen --seed` - Creates and migrates the database. If you specify the admin args, a membership will be created for that
user with all permissions. If you specify keygen, all keys will be regenerated.
If you specify seed it will seed the database.
4. `npm start`
5. `npm start`

### Additional Notes
1. `PORT="2222" npm start` - Run the server on a different port.
Expand Down
10 changes: 10 additions & 0 deletions db/migrations/20191019215406-add-linkedin-profile-to-officers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export function up(queryInterface, Sequelize) {
return queryInterface.addColumn('officers', 'linkedinUrl', {
type: Sequelize.TEXT,
allowNull: true,
});
}

export function down(queryInterface) {
return queryInterface.removeColumn('officers', 'linkedinUrl');
}
3 changes: 3 additions & 0 deletions models/officer.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ export default sequelize.define('officers', {
type: DataTypes.DATE,
defaultValue: null,
},
linkedinUrl: {
type: DataTypes.TEXT,
Copy link
Member

Choose a reason for hiding this comment

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

do you think it would be worth adding a field validator?

Copy link
Member Author

Choose a reason for hiding this comment

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

I’ll validate that it’s a URL - that’s probably all we need. Since officers are the only ones using this, I trust that they’ll put a LinkedIn or similar URL here.

},
}, {
scopes: {
title(title) {
Expand Down
Loading