Forked from vitorhidalgo/gist:b3dd54a289967f630bafc8a83b8cc71a
Last active
May 26, 2017 00:26
-
-
Save otaviosoares/5c6e9538844523e7253e7953d3eb40e5 to your computer and use it in GitHub Desktop.
config/database.js
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
var sequelize = require('sequelize'); | |
var mysql = require('mysql'); | |
var sequelize = sequelize('mysql://root:root@127.0.01:3306/auction'); | |
module.exports = | |
{ | |
sequelize | |
}; |
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
var sequelize = require('../../config/database.js').sequelize; | |
module.exports = function() | |
{ | |
console.log(Sequelize); | |
var User = sequelize.define | |
( | |
'users', | |
{ | |
id : | |
{ | |
type : DataTypes.INTEGER, | |
primaryKey : true | |
}, | |
email : | |
{ | |
type : DataTypes.STRING | |
}, | |
password : | |
{ | |
type : DataTypes.STRING | |
} | |
} | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment