aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/avatar/avatar.ts
blob: 96308fd5ffc2c1a144548d2d1e81c85b7eed045e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import * as Sequelize from 'sequelize'
import { addMethodsToModel } from '../utils'
import { AvatarAttributes, AvatarInstance } from './avatar-interface'

let Avatar: Sequelize.Model<AvatarInstance, AvatarAttributes>

export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.DataTypes) {
  Avatar = sequelize.define<AvatarInstance, AvatarAttributes>('Avatar',
    {
      filename: {
        type: DataTypes.STRING,
        allowNull: false
      }
    },
    {}
  )

  const classMethods = []
  addMethodsToModel(Avatar, classMethods)

  return Avatar
}

// ------------------------------ Statics ------------------------------