daily pastebin goal
58%
SHARE
TWEET

Untitled

a guest Jan 18th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'use strict';
  2.  
  3. export default function(sequelize, DataTypes) {
  4.   return sequelize.define('Ladder', {
  5.     ladder_id: {
  6.       type: DataTypes.UUID,
  7.       allowNull: false,
  8.       primaryKey: true,
  9.       autoIncrement: true //<------- If commented it works fine
  10.     },
  11.     ladder_name: {
  12.       type: DataTypes.STRING(50),
  13.       allowNull: false,
  14.       unique: true
  15.     },
  16.     ladder_description: {
  17.       type: DataTypes.TEXT,
  18.       allowNull: true
  19.     },
  20.     ladder_open: {
  21.       type: DataTypes.BOOLEAN,
  22.       allowNull: false
  23.     },
  24.     ladder_hidden: {
  25.       type: DataTypes.BOOLEAN,
  26.       allowNull: false
  27.     },
  28.     ladder_creation_date: {
  29.       type: DataTypes.DATE,
  30.       allowNull: false
  31.     },
  32.     ladder_fk_user: {
  33.       type: DataTypes.INTEGER,
  34.       allowNull: false
  35.     },
  36.     ladder_fk_game: {
  37.       type: DataTypes.UUID,
  38.       allowNull: false
  39.     },
  40.     ladder_fk_platforms: {
  41.       type: DataTypes.ARRAY(DataTypes.UUID),
  42.       allowNull: false
  43.     }
  44.  
  45.   },
  46.     {
  47.       schema: 'ladder',
  48.       tableName: 'ladders'
  49.     });
  50. }
  51.    
  52. ladder_id: {
  53.     type: DataTypes.UUID,
  54.     allowNull: false,
  55.     primaryKey: true,
  56.     default: sequelize.fn('uuid_generate_v4')
  57. }
  58.    
  59. return sequelize.define('Ladder', {
  60.     ladder_id: {
  61.       type: DataTypes.UUID,
  62.       allowNull: false,
  63.       primaryKey: true,
  64.       defaultValue: UUIDV4
  65.     },
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top