0bc384f90a6432dbe7ba9b88b5444ae1afdd0168
[motion.git] / server / models / square_project.js
1 'use strict';
2
3
4 module.exports = function(sequelize, DataTypes) {
5
6   var SquareProject = sequelize.define('SquareProject', {
7     name: {
8       type: DataTypes.STRING,
9       unique: true,
10       allowNull: false,
11       validate: {
12         notEmpty: true
13       }
14     },
15     description: DataTypes.STRING,
16     notes: DataTypes.TEXT,
17     preproduction: {
18       type: DataTypes.BLOB('long'),
19       get: function() {
20         return this.getDataValue('preproduction').toString();
21       }
22     },
23     production: {
24       type: DataTypes.BLOB('long'),
25       get: function() {
26         return this.getDataValue('production').toString();
27       }
28     }
29   }, {
30     tableName: 'square_projects'
31   });
32
33   return SquareProject;
34
35 };