-
Notifications
You must be signed in to change notification settings - Fork 8
add mongoose and migrations [closes #11] #12
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
Open
shakalee14
wants to merge
3
commits into
GuildCrafts:master
Choose a base branch
from
Moniarchy:11-add-mongoose-migrations
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+56
−8
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
There are no files selected for viewing
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,12 @@ | ||
| # Contributing | ||
|
|
||
| - Fork this repository | ||
| - Take a ticket from the Ready section of the project page. (Some tickets in the Backlog may be ready for work, but are probably dependent on items in the Ready section - please check with maintainer if you're interested in Backlog work.) | ||
| - Create a topic branch. Branch names should begin with the issue number, followed by text describing the work. Please use lower-kebab-case (i.e. 2-readme-updated). | ||
| - Complete work | ||
| - Submit a pull request | ||
| - Necessary migrations have been created with the following commands: | ||
| - migration:create [ name of migration ] | ||
| - migration:up | ||
| - migration:down [ name of migration ] | ||
|
|
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,11 @@ | ||
| const DATABSE_URL = 'mongodb://127.0.0.1:27017/lizardboard'; | ||
| const MongoClient = require('mongodb').MongoClient, assert = require('assert'); | ||
|
|
||
| MongoClient.connect(DATABASE_URL, (err, response) => { | ||
| .then( DATABASE_URL => { | ||
| response.send('Successfully connected to the database') | ||
| }) | ||
| .catch( error => { | ||
| response.render('error', { error: error }) | ||
| }); | ||
| }); |
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,25 @@ | ||
| 'use strict'; | ||
| const mongoose = require('mongoose'); | ||
|
|
||
| /** | ||
| * Make any changes you need to make to the database here | ||
| */ | ||
|
|
||
| exports.up = function up (done) { | ||
| const add_users = new mongoose.Schema({ | ||
| _id: {seq: 0}, | ||
| name: { | ||
| first: String, | ||
| last: { type: String, trim: true } | ||
| }, | ||
| email: {String} | ||
| }); | ||
| done(); | ||
| }; | ||
|
|
||
| /** | ||
| * Make any changes that UNDO the up function side effects here (if possible) | ||
| */ | ||
| exports.down = function down(done) { | ||
| done(); | ||
| }; |
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 |
|---|---|---|
|
|
@@ -69,5 +69,4 @@ app.use(function(err, req, res, next) { | |
| }); | ||
| }); | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove extra new line |
||
|
|
||
| module.exports = app; | ||
| module.exports = app; | ||
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 |
|---|---|---|
|
|
@@ -6,4 +6,3 @@ block content | |
|
|
||
| #root | ||
| script(src="/public/javascripts/index.js") | ||
|
|
||
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 |
|---|---|---|
|
|
@@ -7,4 +7,3 @@ html | |
| body | ||
| block content | ||
| script(src="/javascripts/index.js") | ||
|
|
||
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
createtake parameters? If it does, does this work?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.
Yes, it does. Are there any specific changes you would like to see? We haven't had trouble with running this script. In CONTRIBUTING.md there are further instructions for using this script.