-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[chore #166841614] Configure migrations with the current codebase
- Loading branch information
1 parent
f5a11d0
commit d91edb2
Showing
21 changed files
with
356 additions
and
153 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
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
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,10 @@ | ||
require('@babel/register') | ||
|
||
const path = require('path'); | ||
|
||
module.exports = { | ||
"config": path.resolve('./src/configs', 'environments.js'), | ||
"models-path": path.resolve('./src/api/models'), | ||
"seeders-path": path.resolve('./src/api/seeders'), | ||
"migrations-path": path.resolve('./src/api/migrations') | ||
}; |
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
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 |
---|---|---|
@@ -1,71 +1,76 @@ | ||
{ | ||
"name": "express-authorshaven", | ||
"version": "1.0.0", | ||
"description": "A Social platform for the creative at heart", | ||
"main": "index.js", | ||
"scripts": { | ||
"start": "babel-node src/index.js", | ||
"test": "NODE_ENV=test nyc --reporter=html --reporter=text --reporter=lcov ./node_modules/.bin/mocha ./tests/* --require @babel/register --timeout 4000 --exit", | ||
"dev": "NODE_ENV=development nodemon --exec babel-node src/index.js", | ||
"coverage": "nyc report --reporter=text-lcov | coveralls", | ||
"eslint": "eslint . --cache --fix", | ||
"precommit": "lint-staged" | ||
}, | ||
"lint-staged": { | ||
"*.js": [ | ||
"eslint --cache --fix", | ||
"git add" | ||
] | ||
}, | ||
"devDependencies": { | ||
"chai": "^4.2.0", | ||
"chai-http": "^4.3.0", | ||
"coveralls": "^3.0.3", | ||
"eslint": "^5.16.0", | ||
"eslint-config-airbnb-base": "^13.1.0", | ||
"eslint-plugin-import": "^2.17.3", | ||
"husky": "^2.4.1", | ||
"lint-staged": "^8.2.1", | ||
"mocha": "^6.1.4", | ||
"nodemon": "^1.19.1", | ||
"nyc": "^14.1.1" | ||
}, | ||
"dependencies": { | ||
"@babel/cli": "^7.4.4", | ||
"@babel/core": "^7.4.5", | ||
"@babel/node": "^7.4.5", | ||
"@babel/polyfill": "^7.4.4", | ||
"@babel/preset-env": "^7.4.5", | ||
"@babel/register": "^7.4.4", | ||
"@hapi/joi": "^15.0.3", | ||
"@sendgrid/mail": "^6.4.0", | ||
"babel-plugin-istanbul": "^5.1.2", | ||
"bcrypt": "^3.0.6", | ||
"body-parser": "^1.18.3", | ||
"cors": "^2.8.5", | ||
"dotenv": "^8.0.0", | ||
"expect": "^24.8.0", | ||
"express": "^4.16.4", | ||
"joi": "^14.3.1", | ||
"jsonwebtoken": "^8.5.1", | ||
"lodash": "^4.17.11", | ||
"morgan": "^1.9.1", | ||
"pg": "^7.11.0", | ||
"sequelize": "^5.8.7", | ||
"swagger-node-express": "^2.1.3", | ||
"swagger-ui-express": "^4.0.6" | ||
}, | ||
"nyc": { | ||
"per-file": true, | ||
"check-coverage": true, | ||
"branches": 80, | ||
"lines": 80, | ||
"functions": 100, | ||
"statements": 80, | ||
"exclude": [ | ||
"src/index.js" | ||
] | ||
}, | ||
"author": "Andela Simulations Programme", | ||
"license": "MIT" | ||
"name": "express-authorshaven", | ||
"version": "1.0.0", | ||
"description": "A Social platform for the creative at heart", | ||
"main": "index.js", | ||
"scripts": { | ||
"start": "babel-node src/index.js", | ||
"test": "npm run setup:test && NODE_ENV=test nyc --reporter=html --reporter=text --reporter=lcov ./node_modules/.bin/mocha ./tests/* --require @babel/register --timeout 4000 --exit", | ||
"dev": "NODE_ENV=development nodemon --exec babel-node src/index.js", | ||
"coverage": "nyc report --reporter=text-lcov | coveralls", | ||
"eslint": "eslint . --cache --fix", | ||
"setup:test": "NODE_ENV=test npm run migrate:undo && NODE_ENV=test npm run migrate && NODE_ENV=test npm run seed", | ||
"setup:dev": "NODE_ENV=development npm run migrate:undo && NODE_ENV=development npm run migrate && NODE_ENV=development npm run seed", | ||
"precommit": "lint-staged", | ||
"migrate": "node_modules/.bin/sequelize db:migrate", | ||
"seed": "node_modules/.bin/sequelize db:seed:all", | ||
"migrate:undo": "node_modules/.bin/sequelize db:migrate:undo:all" | ||
}, | ||
"lint-staged": { | ||
"*.js": [ | ||
"eslint --cache --fix", | ||
"git add" | ||
] | ||
}, | ||
"devDependencies": { | ||
"chai": "^4.2.0", | ||
"chai-http": "^4.3.0", | ||
"coveralls": "^3.0.3", | ||
"eslint": "^5.16.0", | ||
"eslint-config-airbnb-base": "^13.1.0", | ||
"eslint-plugin-import": "^2.17.3", | ||
"husky": "^2.4.1", | ||
"lint-staged": "^8.2.1", | ||
"mocha": "^6.1.4", | ||
"nodemon": "^1.19.1", | ||
"nyc": "^14.1.1" | ||
}, | ||
"dependencies": { | ||
"@babel/cli": "^7.4.4", | ||
"@babel/core": "^7.4.5", | ||
"@babel/node": "^7.4.5", | ||
"@babel/polyfill": "^7.4.4", | ||
"@babel/preset-env": "^7.4.5", | ||
"@babel/register": "^7.4.4", | ||
"@hapi/joi": "^15.0.3", | ||
"@sendgrid/mail": "^6.4.0", | ||
"babel-plugin-istanbul": "^5.1.2", | ||
"bcrypt": "^3.0.6", | ||
"body-parser": "^1.18.3", | ||
"cors": "^2.8.5", | ||
"dotenv": "^8.0.0", | ||
"expect": "^24.8.0", | ||
"express": "^4.16.4", | ||
"jsonwebtoken": "^8.5.1", | ||
"lodash": "^4.17.11", | ||
"morgan": "^1.9.1", | ||
"pg": "^7.11.0", | ||
"sequelize": "^5.8.7", | ||
"sequelize-cli": "^5.5.0", | ||
"swagger-node-express": "^2.1.3", | ||
"swagger-ui-express": "^4.0.6" | ||
}, | ||
"nyc": { | ||
"per-file": true, | ||
"check-coverage": true, | ||
"branches": 80, | ||
"lines": 80, | ||
"functions": 100, | ||
"statements": 80, | ||
"exclude": [ | ||
"src/index.js" | ||
] | ||
}, | ||
"author": "Andela Simulations Programme", | ||
"license": "MIT" | ||
} |
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
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
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,70 @@ | ||
export default { | ||
up: (queryInterface, Sequelize) => queryInterface.createTable('Users', { | ||
id: { | ||
allowNull: false, | ||
autoIncrement: true, | ||
primaryKey: true, | ||
type: Sequelize.INTEGER | ||
}, | ||
username: { | ||
type: Sequelize.STRING | ||
}, | ||
email: { | ||
type: Sequelize.STRING | ||
}, | ||
password: { | ||
type: Sequelize.STRING | ||
}, | ||
country: { | ||
type: Sequelize.STRING | ||
}, | ||
firstName: { | ||
type: Sequelize.STRING | ||
}, | ||
lastName: { | ||
type: Sequelize.STRING | ||
}, | ||
bio: { | ||
type: Sequelize.STRING | ||
}, | ||
address: { | ||
type: Sequelize.STRING | ||
}, | ||
gender: { | ||
type: Sequelize.STRING | ||
}, | ||
profileImage: { | ||
type: Sequelize.STRING | ||
}, | ||
phoneNumber: { | ||
type: Sequelize.STRING | ||
}, | ||
provider: { | ||
type: Sequelize.STRING, | ||
allowNull: true | ||
}, | ||
uniqueId: { | ||
type: Sequelize.STRING, | ||
allowNull: true | ||
}, | ||
verified: { | ||
type: Sequelize.BOOLEAN, | ||
defaultValue: false | ||
}, | ||
facebook: { | ||
type: Sequelize.STRING | ||
}, | ||
twitter: { | ||
type: Sequelize.STRING | ||
}, | ||
createdAt: { | ||
allowNull: false, | ||
type: Sequelize.DATE | ||
}, | ||
updatedAt: { | ||
allowNull: false, | ||
type: Sequelize.DATE | ||
} | ||
}), | ||
down: (queryInterface, Sequelize) => queryInterface.dropTable('Users') | ||
}; |
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,22 @@ | ||
export default { | ||
up: (queryInterface, Sequelize) => queryInterface.createTable('Tokens', { | ||
id: { | ||
allowNull: false, | ||
autoIncrement: true, | ||
primaryKey: true, | ||
type: Sequelize.INTEGER | ||
}, | ||
data: { | ||
type: Sequelize.TEXT | ||
}, | ||
createdAt: { | ||
allowNull: false, | ||
type: Sequelize.DATE | ||
}, | ||
updatedAt: { | ||
allowNull: false, | ||
type: Sequelize.DATE | ||
} | ||
}), | ||
down: (queryInterface, Sequelize) => queryInterface.dropTable('Tokens') | ||
}; |
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
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 |
---|---|---|
@@ -1,10 +1,8 @@ | ||
const token = (sequelize, DataTypes) => { | ||
const Token = sequelize.define('Tokens', { | ||
data: { | ||
type: DataTypes.TEXT | ||
} | ||
}); | ||
export default (sequelize, DataTypes) => { | ||
const Token = sequelize.define('Token', | ||
{ | ||
data: DataTypes.TEXT | ||
}, | ||
{}); | ||
return Token; | ||
}; | ||
|
||
export default token; |
Oops, something went wrong.