Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict';
- module.exports = function(sequelize, DataTypes) {
- var User = sequelize.define('User', {
- id: {
- allowNull: false,
- autoIncrement: true,
- primaryKey: true,
- type: DataTypes.INTEGER
- },
- fullname:{
- type:DataTypes.STRING,
- allowNull:false
- },
- email: {
- type:DataTypes.STRING,
- allowNull:false
- },
- password: {
- type:DataTypes.STRING,
- allowNull:false
- },
- fb_id:{
- type:DataTypes.STRING
- },
- fb_token:{
- type:DataTypes.STRING
- },
- fb_token_expired:{
- type:DataTypes.DATE
- },
- google_id:{
- type:DataTypes.STRING
- },
- google_token:{
- type:DataTypes.STRING
- },
- google_token_expired:{
- type:DataTypes.DATE
- },
- avatar:{
- type:DataTypes.STRING,
- allowNull:false
- },
- phone:{
- type:DataTypes.STRING,
- allowNull:false
- },
- address_id:{
- type:DataTypes.INTEGER,
- allowNull:false
- },
- is_buyer:{
- type:DataTypes.INTEGER,
- allowNull:false
- },
- is_seller:{
- type:DataTypes.INTEGER,
- allowNull:false
- },
- is_affiliate:{
- type:DataTypes.INTEGER,
- allowNull:false
- },
- is_active: {
- type:DataTypes.INTEGER,
- allowNull:false
- },
- current_balance: {
- type:DataTypes.NUMERIC
- },
- last_login:{
- type:DataTypes.DATE
- },
- }, {
- timestamp:true,
- // lastlogin:"last_login",
- createdAt:"created_at",
- updatedAt:"updated_at",
- tableName: 'users',
- classMethods: {
- associate: function(models) {
- // User.hasMany(models.Topup, { foreignKey:'user_id'} )
- }
- }
- });
- return User;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement