summaryrefslogtreecommitdiff
path: root/models
diff options
context:
space:
mode:
Diffstat (limited to 'models')
-rw-r--r--models/asset.js3
-rw-r--r--models/item_participant.js10
-rw-r--r--models/match.js3
-rw-r--r--models/participant.js3
4 files changed, 14 insertions, 5 deletions
diff --git a/models/asset.js b/models/asset.js
index ae939a0..a10c2da 100644
--- a/models/asset.js
+++ b/models/asset.js
@@ -35,7 +35,8 @@ module.exports = function(sequelize, DataTypes) {
},
created_at: {
type: DataTypes.TIME,
- allowNull: false
+ allowNull: false,
+ defaultValue: sequelize.literal('CURRENT_TIMESTAMP')
},
description: {
type: DataTypes.STRING(191),
diff --git a/models/item_participant.js b/models/item_participant.js
index 94d2061..ca8ef15 100644
--- a/models/item_participant.js
+++ b/models/item_participant.js
@@ -3,8 +3,10 @@
module.exports = function(sequelize, DataTypes) {
return sequelize.define('item_participant', {
id: {
- type: DataTypes.INTEGER(5).UNSIGNED,
- allowNull: false
+ type: DataTypes.INTEGER(10).UNSIGNED,
+ allowNull: false,
+ primaryKey: true,
+ autoIncrement: true
},
participant_api_id: {
type: DataTypes.CHAR(36),
@@ -14,6 +16,10 @@ module.exports = function(sequelize, DataTypes) {
type: DataTypes.STRING(191),
allowNull: false
},
+ number: {
+ type: DataTypes.INTEGER(5).UNSIGNED,
+ allowNull: false
+ },
action: {
type: DataTypes.ENUM('grant','sell','use','final'),
allowNull: false
diff --git a/models/match.js b/models/match.js
index 0b9f6d9..7efd63b 100644
--- a/models/match.js
+++ b/models/match.js
@@ -19,7 +19,8 @@ module.exports = function(sequelize, DataTypes) {
},
created_at: {
type: DataTypes.TIME,
- allowNull: false
+ allowNull: false,
+ defaultValue: sequelize.literal('CURRENT_TIMESTAMP')
},
duration: {
type: DataTypes.INTEGER(5).UNSIGNED,
diff --git a/models/participant.js b/models/participant.js
index caa8c80..f508e9b 100644
--- a/models/participant.js
+++ b/models/participant.js
@@ -51,7 +51,8 @@ module.exports = function(sequelize, DataTypes) {
},
created_at: {
type: DataTypes.TIME,
- allowNull: false
+ allowNull: false,
+ defaultValue: sequelize.literal('CURRENT_TIMESTAMP')
},
actor: {
type: DataTypes.STRING(16),