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

Update mysql.js #147

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update mysql.js #147

wants to merge 1 commit into from

Commits on May 21, 2017

  1. Update mysql.js

    For the following model the index for "testcolumn" is not created for the current master (due to a resulting conflict in l 249 mysql, because the unique property already exists in the table); This is avoided by the proposed change.
    
    /**
     *  Define User Model
     *  @param {Object} schema
     *  @return {Object}
     **/
    module.exports = function (schema) {
    
        const user = schema.define('user', {
               active : { type : schema.Number },
               username : { type : schema.String, unique : true },
               email : { type : schema.String, unique :true },
               password : { type : schema.String},
               note : { type : schema.Text },
               testcolumn : { type : schema.Date, index:true  }
        },{
    
            // primaryKeys:["email"] // fails
        });
    
    
        user.validatesPresenceOf('username', 'email', 'password');
    
        // additional methods and validation here
    
        return user;
    };
    hfwittmann authored May 21, 2017
    Configuration menu
    Copy the full SHA
    439ec92 View commit details
    Browse the repository at this point in the history