1e44ba9c20a2d28e9b477433f7c1de9831ba6ab8
[motion.git] / server / models / tools_sound.js
1 'use strict';
2
3 module.exports = function(sequelize, DataTypes) {
4
5         var Sound = sequelize.define('Sound', {
6                 name: DataTypes.STRING,
7                 save_name: DataTypes.STRING,
8                 display_name: {
9                         type: DataTypes.STRING,
10                         allowNull: false,
11                         defaultValue: '',
12                         validate: {
13                                 notEmpty: {
14                                         msg: "The name cannot be empty!"
15                                 } // don't allow empty strings
16                         }
17                 },
18                 description: DataTypes.STRING,
19                 original_format: DataTypes.STRING,
20                 original_duration: DataTypes.FLOAT,
21                 original_sampleCount: DataTypes.BIGINT,
22                 original_channelCount: DataTypes.INTEGER,
23                 original_bitRate: DataTypes.BIGINT,
24                 original_sampleRate: DataTypes.INTEGER,
25                 converted_format: DataTypes.STRING,
26                 converted_duration: DataTypes.FLOAT,
27                 converted_sampleCount: DataTypes.BIGINT,
28                 converted_channelCount: DataTypes.INTEGER,
29                 converted_bitRate: DataTypes.BIGINT,
30                 converted_sampleRate: DataTypes.INTEGER
31         }, {
32                 tableName: 'tools_sounds'
33         });
34
35         return Sound;
36 };