-
Notifications
You must be signed in to change notification settings - Fork 0
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 DB Schema #8
Conversation
Progress so far:
Next:
|
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.
How do you feel that in new (maybe next?) PR that we could use babel here so we can use ES2015+?
db/models/sign.js
Outdated
'use strict'; | ||
module.exports = (sequelize, DataTypes) => { | ||
var Sign = sequelize.define('Sign', { | ||
name: DataTypes.STRING, |
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.
Do we need id
in the sign model?
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.
Sequelize will add this automatically when sync'ing the table (along with created/updated fields). We can be more explicit about this.
db/models/terminology.js
Outdated
'use strict'; | ||
module.exports = (sequelize, DataTypes) => { | ||
var Terminology = sequelize.define('Terminology', { | ||
name: DataTypes.STRING, |
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.
Do we need id in the terminology model?
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.
Sequelize will add this automatically when sync'ing the table (along with created/updated fields). We can be more explicit about this.
db/models/user.js
Outdated
'use strict'; | ||
module.exports = (sequelize, DataTypes) => { | ||
var User = sequelize.define('User', { | ||
email: { |
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.
Do we need id in the user model?
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.
Sequelize will add this automatically when sync'ing the table (along with created/updated fields). We can be more explicit about this.
db/models/introspect.js
Outdated
'use strict'; | ||
module.exports = (sequelize, DataTypes) => { | ||
var Introspect = sequelize.define('Introspect', { | ||
name: DataTypes.STRING, |
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.
Do we need id in the introspect model?
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.
Sequelize will add this automatically when sync'ing the table (along with created/updated fields). We can be more explicit about this.
Sure. Most of the files were generated by the sequelize-cli which just didn't directly support ES2015+ out of the box. For now, just to make sure things worked, I just did everything here in vanilla javascript with the ulterior goal to migrate. |
That makes sense. We can keep everything vanilla JavaScript for sequelize |
Tables:
Changes:
Relationship overview:
|
Lets fix the naming tables a bit with proper grammar - Authors |
SQL generated so far, but I will encode this into a migration soon...
|
To do:
|
@meltedspork time for you to look things over! |
SWEET!!!! |
@meltedspork approved offline. |
we can definitely authenticate to the database correctly. This is a WIP and I should add the rest of the functionality soon.