aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/application.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-12-28 15:49:23 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-12-28 15:49:23 +0100
commit67bf9b96bbcd92b069fe86d9223fe0f8b9c6e677 (patch)
treebae6a9b0c3133c9cc38a2972222b5991f0cf614e /server/models/application.js
parent552cc9d646e78edae8b0fe61564d4e49db0b6206 (diff)
downloadPeerTube-67bf9b96bbcd92b069fe86d9223fe0f8b9c6e677.tar.gz
PeerTube-67bf9b96bbcd92b069fe86d9223fe0f8b9c6e677.tar.zst
PeerTube-67bf9b96bbcd92b069fe86d9223fe0f8b9c6e677.zip
Server: add database field validations
Diffstat (limited to 'server/models/application.js')
-rw-r--r--server/models/application.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/server/models/application.js b/server/models/application.js
index 4114ed76d..46dcfde33 100644
--- a/server/models/application.js
+++ b/server/models/application.js
@@ -1,9 +1,15 @@
1'use strict'
2
1module.exports = function (sequelize, DataTypes) { 3module.exports = function (sequelize, DataTypes) {
2 const Application = sequelize.define('Application', 4 const Application = sequelize.define('Application',
3 { 5 {
4 migrationVersion: { 6 migrationVersion: {
5 type: DataTypes.INTEGER, 7 type: DataTypes.INTEGER,
6 defaultValue: 0 8 defaultValue: 0,
9 allowNull: false,
10 validate: {
11 isInt: true
12 }
7 } 13 }
8 }, 14 },
9 { 15 {