diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-05-04 13:24:52 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-05-04 13:24:52 +0200 |
| commit | 0f1fef88ca050a3160069594fcff7e19e1899676 (patch) | |
| tree | c5a6e8ac868aadad88698cdd409caa8a03be7d5a | |
| parent | 7802d6bf0d1273fe2e4ba1e6fbd889d733413041 (diff) | |
| download | orm-0f1fef88ca050a3160069594fcff7e19e1899676.tar.gz orm-0f1fef88ca050a3160069594fcff7e19e1899676.zip | |
import teams
| -rw-r--r-- | models/series.js | 4 | ||||
| -rw-r--r-- | models/team.js | 50 | ||||
| -rw-r--r-- | models/team_membership.js | 42 | ||||
| -rw-r--r-- | models/tournament.js | 41 | ||||
| -rw-r--r-- | models/tournament_participants.js | 29 | ||||
| -rw-r--r-- | models/users.js | 29 |
6 files changed, 195 insertions, 0 deletions
diff --git a/models/series.js b/models/series.js index 7c2604e..25a07ac 100644 --- a/models/series.js +++ b/models/series.js @@ -28,6 +28,10 @@ module.exports = function(sequelize, DataTypes) { type: DataTypes.INTEGER(1), allowNull: false, defaultValue: "0" + }, + show_in_web: { + type: DataTypes.INTEGER(1), + allowNull: false } }, { tableName: 'series', diff --git a/models/team.js b/models/team.js new file mode 100644 index 0000000..c9a7880 --- /dev/null +++ b/models/team.js @@ -0,0 +1,50 @@ +/* jshint indent: 2 */ + +module.exports = function(sequelize, DataTypes) { + return sequelize.define('team', { + id: { + type: DataTypes.INTEGER(10).UNSIGNED, + allowNull: false, + primaryKey: true, + autoIncrement: true + }, + shard_id: { + type: DataTypes.STRING(5), + allowNull: true + }, + api_id: { + type: DataTypes.CHAR(36), + allowNull: true + }, + created_at: { + type: DataTypes.TIME, + allowNull: false, + defaultValue: sequelize.literal('CURRENT_TIMESTAMP') + }, + tournament_id: { + type: DataTypes.BIGINT, + allowNull: true + }, + name: { + type: DataTypes.STRING(20), + allowNull: false + }, + identifier: { + type: DataTypes.STRING(10), + allowNull: false + }, + status: { + type: DataTypes.ENUM('planned','active','inactive'), + allowNull: false + }, + type: { + type: DataTypes.ENUM('team','guild','tournament'), + allowNull: false + } + }, { + tableName: 'team', + timestamps: false, + underscored: true, + freezeTableName: true + }); +}; diff --git a/models/team_membership.js b/models/team_membership.js new file mode 100644 index 0000000..502c2df --- /dev/null +++ b/models/team_membership.js @@ -0,0 +1,42 @@ +/* jshint indent: 2 */ + +module.exports = function(sequelize, DataTypes) { + return sequelize.define('team_membership', { + id: { + type: DataTypes.INTEGER(10).UNSIGNED, + allowNull: false, + primaryKey: true, + autoIncrement: true + }, + player_api_id: { + type: DataTypes.CHAR(36), + allowNull: false + }, + user_id: { + type: DataTypes.BIGINT, + allowNull: true + }, + team_id: { + type: DataTypes.INTEGER(5).UNSIGNED, + allowNull: false + }, + joined_on: { + type: DataTypes.TIME, + allowNull: false, + defaultValue: sequelize.literal('CURRENT_TIMESTAMP') + }, + status: { + type: DataTypes.ENUM('pending','initiate','member','officer','leader','former'), + allowNull: false + }, + fame: { + type: DataTypes.BIGINT, + allowNull: false + } + }, { + tableName: 'team_membership', + timestamps: false, + underscored: true, + freezeTableName: true + }); +}; diff --git a/models/tournament.js b/models/tournament.js new file mode 100644 index 0000000..5722d02 --- /dev/null +++ b/models/tournament.js @@ -0,0 +1,41 @@ +/* jshint indent: 2 */ + +module.exports = function(sequelize, DataTypes) { + return sequelize.define('tournament', { + id: { + type: DataTypes.INTEGER(10).UNSIGNED, + allowNull: false, + primaryKey: true, + autoIncrement: true + }, + api_id: { + type: DataTypes.STRING(191), + allowNull: true + }, + name: { + type: DataTypes.STRING(191), + allowNull: false + }, + status: { + type: DataTypes.ENUM('planned','active','finished'), + allowNull: false + }, + type: { + type: DataTypes.ENUM('players','team'), + allowNull: false + }, + start: { + type: DataTypes.TIME, + allowNull: true + }, + end: { + type: DataTypes.TIME, + allowNull: true + } + }, { + tableName: 'tournament', + timestamps: false, + underscored: true, + freezeTableName: true + }); +}; diff --git a/models/tournament_participants.js b/models/tournament_participants.js new file mode 100644 index 0000000..010a89e --- /dev/null +++ b/models/tournament_participants.js @@ -0,0 +1,29 @@ +/* jshint indent: 2 */ + +module.exports = function(sequelize, DataTypes) { + return sequelize.define('tournament_participants', { + id: { + type: DataTypes.INTEGER(10).UNSIGNED, + allowNull: false, + primaryKey: true, + autoIncrement: true + }, + tournament_id: { + type: DataTypes.BIGINT, + allowNull: false + }, + tournament_team_id: { + type: DataTypes.BIGINT, + allowNull: false + }, + player_api_id: { + type: DataTypes.CHAR(36), + allowNull: false + } + }, { + tableName: 'tournament_participants', + timestamps: false, + underscored: true, + freezeTableName: true + }); +}; diff --git a/models/users.js b/models/users.js new file mode 100644 index 0000000..2f62f59 --- /dev/null +++ b/models/users.js @@ -0,0 +1,29 @@ +/* jshint indent: 2 */ + +module.exports = function(sequelize, DataTypes) { + return sequelize.define('users', { + id: { + type: DataTypes.INTEGER(10).UNSIGNED, + allowNull: false, + primaryKey: true, + autoIncrement: true + }, + name: { + type: DataTypes.STRING(191), + allowNull: false + }, + user_token: { + type: DataTypes.CHAR(36), + allowNull: false + }, + player_api_id: { + type: DataTypes.CHAR(36), + allowNull: false + } + }, { + tableName: 'users', + timestamps: false, + underscored: true, + freezeTableName: true + }); +}; |
