diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-07-14 18:58:17 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-07-14 18:58:17 +0200 |
| commit | dd2a4f706f20b83144e637896c55c550afa7030a (patch) | |
| tree | b6f48beba19672577cfbfba71b45ea89e780088f /models | |
| parent | 0e5c3afae2be7a36372d9b29a1c7fa5fba649341 (diff) | |
| download | orm-dd2a4f706f20b83144e637896c55c550afa7030a.tar.gz orm-dd2a4f706f20b83144e637896c55c550afa7030a.zip | |
2.14.0 rewrite
Diffstat (limited to 'models')
| -rw-r--r-- | models/asset.js | 3 | ||||
| -rw-r--r-- | models/build.js | 44 | ||||
| -rw-r--r-- | models/division.js | 4 | ||||
| -rw-r--r-- | models/division_team.js | 14 | ||||
| -rw-r--r-- | models/event.js | 8 | ||||
| -rw-r--r-- | models/global_point.js | 100 | ||||
| -rw-r--r-- | models/global_point_filters.js | 25 | ||||
| -rw-r--r-- | models/match.js | 3 | ||||
| -rw-r--r-- | models/participant.js | 3 | ||||
| -rw-r--r-- | models/player_point.js | 32 | ||||
| -rw-r--r-- | models/series.js | 2 | ||||
| -rw-r--r-- | models/stage.js | 8 | ||||
| -rw-r--r-- | models/team.js | 6 | ||||
| -rw-r--r-- | models/team_membership.js | 2 | ||||
| -rw-r--r-- | models/tournament.js | 8 | ||||
| -rw-r--r-- | models/tournament_participants.js | 8 | ||||
| -rw-r--r-- | models/users.js | 14 |
17 files changed, 158 insertions, 126 deletions
diff --git a/models/asset.js b/models/asset.js index 1f51ef6..bc60b3e 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.fn('current_timestamp') }, description: { type: DataTypes.STRING(191), diff --git a/models/build.js b/models/build.js index c3ab621..33e101d 100644 --- a/models/build.js +++ b/models/build.js @@ -12,32 +12,60 @@ module.exports = function(sequelize, DataTypes) { type: DataTypes.STRING(191), allowNull: false }, - item_1: { + dimension_on: { type: DataTypes.STRING(191), allowNull: true }, - item_2: { + database: { type: DataTypes.STRING(191), allowNull: true }, + item_1: { + type: DataTypes.BIGINT, + allowNull: true + }, + item_2: { + type: DataTypes.BIGINT, + allowNull: true + }, item_3: { - type: DataTypes.STRING(191), + type: DataTypes.BIGINT, allowNull: true }, item_4: { - type: DataTypes.STRING(191), + type: DataTypes.BIGINT, allowNull: true }, item_5: { - type: DataTypes.STRING(191), + type: DataTypes.BIGINT, allowNull: true }, item_6: { - type: DataTypes.STRING(191), + type: DataTypes.BIGINT, allowNull: true }, - dimension_on: { - type: DataTypes.STRING(191), + item_1_count: { + type: DataTypes.INTEGER(11), + allowNull: true + }, + item_2_count: { + type: DataTypes.INTEGER(11), + allowNull: true + }, + item_3_count: { + type: DataTypes.INTEGER(11), + allowNull: true + }, + item_4_count: { + type: DataTypes.INTEGER(11), + allowNull: true + }, + item_5_count: { + type: DataTypes.INTEGER(11), + allowNull: true + }, + item_6_count: { + type: DataTypes.INTEGER(11), allowNull: true } }, { diff --git a/models/division.js b/models/division.js index d42e09e..d9c1e10 100644 --- a/models/division.js +++ b/models/division.js @@ -19,6 +19,10 @@ module.exports = function(sequelize, DataTypes) { name: { type: DataTypes.STRING(191), allowNull: false + }, + rank: { + type: DataTypes.INTEGER(11), + allowNull: true } }, { tableName: 'division', diff --git a/models/division_team.js b/models/division_team.js index 4db03f7..90c55f6 100644 --- a/models/division_team.js +++ b/models/division_team.js @@ -24,13 +24,25 @@ module.exports = function(sequelize, DataTypes) { type: DataTypes.INTEGER(11), allowNull: false }, - points: { + games_played: { + type: DataTypes.INTEGER(11), + allowNull: false + }, + games_won: { type: DataTypes.INTEGER(11), allowNull: false }, seed: { type: DataTypes.INTEGER(11), allowNull: false + }, + points: { + type: "DOUBLE", + allowNull: false + }, + sub_division: { + type: DataTypes.STRING(191), + allowNull: false } }, { tableName: 'division_team', diff --git a/models/event.js b/models/event.js index daa9c58..7173acc 100644 --- a/models/event.js +++ b/models/event.js @@ -47,6 +47,14 @@ module.exports = function(sequelize, DataTypes) { winner_id: { type: DataTypes.INTEGER(11), allowNull: true + }, + round: { + type: DataTypes.INTEGER(11), + allowNull: true + }, + position: { + type: DataTypes.INTEGER(11), + allowNull: true } }, { tableName: 'event', diff --git a/models/global_point.js b/models/global_point.js index 85be061..4287abf 100644 --- a/models/global_point.js +++ b/models/global_point.js @@ -40,6 +40,14 @@ module.exports = function(sequelize, DataTypes) { type: DataTypes.BIGINT, allowNull: true }, + enemy_hero_id: { + type: DataTypes.BIGINT, + allowNull: false + }, + enemy_role_id: { + type: DataTypes.BIGINT, + allowNull: false + }, region_id: { type: DataTypes.BIGINT, allowNull: true @@ -68,6 +76,10 @@ module.exports = function(sequelize, DataTypes) { type: DataTypes.BIGINT, allowNull: true }, + farm: { + type: "DOUBLE", + allowNull: false + }, minion_kills: { type: DataTypes.BIGINT, allowNull: true @@ -100,97 +112,9 @@ module.exports = function(sequelize, DataTypes) { type: DataTypes.BIGINT, allowNull: true }, - kda_ratio: { - type: "DOUBLE(20,5)", - allowNull: true - }, - kill_participation: { - type: "DOUBLE(20,5)", - allowNull: true - }, - cs_per_min: { - type: "DOUBLE(20,5)", - allowNull: true - }, - kills_per_min: { - type: "DOUBLE(20,5)", - allowNull: true - }, impact_score: { type: DataTypes.BIGINT, allowNull: true - }, - objective_score: { - type: DataTypes.BIGINT, - allowNull: true - }, - damage_cp_score: { - type: DataTypes.BIGINT, - allowNull: true - }, - damage_wp_score: { - type: DataTypes.BIGINT, - allowNull: true - }, - sustain_score: { - type: DataTypes.BIGINT, - allowNull: true - }, - farm_lane_score: { - type: DataTypes.BIGINT, - allowNull: true - }, - kill_score: { - type: DataTypes.BIGINT, - allowNull: true - }, - objective_lane_score: { - type: DataTypes.BIGINT, - allowNull: true - }, - farm_jungle_score: { - type: DataTypes.BIGINT, - allowNull: true - }, - peel_score: { - type: DataTypes.BIGINT, - allowNull: true - }, - kill_assist_score: { - type: DataTypes.BIGINT, - allowNull: true - }, - objective_jungle_score: { - type: DataTypes.BIGINT, - allowNull: true - }, - vision_score: { - type: DataTypes.BIGINT, - allowNull: true - }, - heal_score: { - type: DataTypes.BIGINT, - allowNull: true - }, - assist_score: { - type: DataTypes.BIGINT, - allowNull: true - }, - utility_score: { - type: DataTypes.BIGINT, - allowNull: true - }, - synergy_score: { - type: DataTypes.BIGINT, - allowNull: true - }, - build_score: { - type: DataTypes.BIGINT, - allowNull: true - }, - offmeta_score: { - type: DataTypes.BIGINT, - allowNull: true } }, { tableName: 'global_point', diff --git a/models/global_point_filters.js b/models/global_point_filters.js new file mode 100644 index 0000000..8129f77 --- /dev/null +++ b/models/global_point_filters.js @@ -0,0 +1,25 @@ +/* jshint indent: 2 */ + +module.exports = function(sequelize, DataTypes) { + return sequelize.define('global_point_filters', { + id: { + type: DataTypes.INTEGER(10).UNSIGNED, + allowNull: false, + primaryKey: true, + autoIncrement: true + }, + filter_id: { + type: DataTypes.BIGINT, + allowNull: false + }, + match_api_id: { + type: DataTypes.CHAR(36), + allowNull: false + } + }, { + tableName: 'global_point_filters', + timestamps: false, + underscored: true, + freezeTableName: true + }); +}; diff --git a/models/match.js b/models/match.js index 4faf015..dfc0b71 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.fn('current_timestamp') }, duration: { type: DataTypes.INTEGER(5).UNSIGNED, diff --git a/models/participant.js b/models/participant.js index d7fc638..5579f31 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.fn('current_timestamp') }, actor: { type: DataTypes.STRING(16), diff --git a/models/player_point.js b/models/player_point.js index ed9a6b1..4f1aae5 100644 --- a/models/player_point.js +++ b/models/player_point.js @@ -12,26 +12,10 @@ module.exports = function(sequelize, DataTypes) { type: DataTypes.CHAR(36), allowNull: false }, - played: { - type: DataTypes.INTEGER(11), - allowNull: true - }, - wins: { - type: DataTypes.INTEGER(11), - allowNull: true - }, - time_spent: { - type: DataTypes.INTEGER(11), - allowNull: true - }, series_id: { type: DataTypes.BIGINT, allowNull: false }, - role_id: { - type: DataTypes.BIGINT, - allowNull: false - }, filter_id: { type: DataTypes.BIGINT, allowNull: false @@ -44,6 +28,22 @@ module.exports = function(sequelize, DataTypes) { type: DataTypes.BIGINT, allowNull: false }, + role_id: { + type: DataTypes.BIGINT, + allowNull: false + }, + played: { + type: DataTypes.INTEGER(11), + allowNull: true + }, + wins: { + type: DataTypes.INTEGER(11), + allowNull: true + }, + time_spent: { + type: DataTypes.INTEGER(11), + allowNull: true + }, updated_at: { type: DataTypes.DATE, allowNull: false diff --git a/models/series.js b/models/series.js index 25a07ac..28aa8d9 100644 --- a/models/series.js +++ b/models/series.js @@ -27,7 +27,7 @@ module.exports = function(sequelize, DataTypes) { currentPatch: { type: DataTypes.INTEGER(1), allowNull: false, - defaultValue: "0" + defaultValue: '0' }, show_in_web: { type: DataTypes.INTEGER(1), diff --git a/models/stage.js b/models/stage.js index 222c130..e7bb294 100644 --- a/models/stage.js +++ b/models/stage.js @@ -35,6 +35,14 @@ module.exports = function(sequelize, DataTypes) { status: { type: DataTypes.ENUM('planned','active','finished'), allowNull: false + }, + phase: { + type: DataTypes.ENUM('pre-season','group','playoffs','finals'), + allowNull: false + }, + rank: { + type: DataTypes.INTEGER(11), + allowNull: false } }, { tableName: 'stage', diff --git a/models/team.js b/models/team.js index c0830b8..e320afb 100644 --- a/models/team.js +++ b/models/team.js @@ -19,11 +19,7 @@ module.exports = function(sequelize, DataTypes) { created_at: { type: DataTypes.TIME, allowNull: false, - defaultValue: sequelize.literal('CURRENT_TIMESTAMP') - }, - tournament_id: { - type: DataTypes.BIGINT, - allowNull: true + defaultValue: sequelize.fn('current_timestamp') }, name: { type: DataTypes.STRING(20), diff --git a/models/team_membership.js b/models/team_membership.js index 755e7bc..eee2061 100644 --- a/models/team_membership.js +++ b/models/team_membership.js @@ -23,7 +23,7 @@ module.exports = function(sequelize, DataTypes) { joined_on: { type: DataTypes.TIME, allowNull: false, - defaultValue: sequelize.literal('CURRENT_TIMESTAMP') + defaultValue: sequelize.fn('current_timestamp') }, status: { type: DataTypes.ENUM('pending','initiate','member','officer','leader','former','veteran'), diff --git a/models/tournament.js b/models/tournament.js index 1c1ff32..27de855 100644 --- a/models/tournament.js +++ b/models/tournament.js @@ -16,6 +16,14 @@ module.exports = function(sequelize, DataTypes) { type: DataTypes.STRING(191), allowNull: false }, + tag_line_1: { + type: DataTypes.STRING(191), + allowNull: true + }, + tag_line_2: { + type: DataTypes.STRING(191), + allowNull: true + }, status: { type: DataTypes.ENUM('planned','active','finished'), allowNull: false diff --git a/models/tournament_participants.js b/models/tournament_participants.js index 010a89e..284ca42 100644 --- a/models/tournament_participants.js +++ b/models/tournament_participants.js @@ -8,11 +8,15 @@ module.exports = function(sequelize, DataTypes) { primaryKey: true, autoIncrement: true }, - tournament_id: { + league_id: { type: DataTypes.BIGINT, allowNull: false }, - tournament_team_id: { + team_id: { + type: DataTypes.BIGINT, + allowNull: false + }, + role_id: { type: DataTypes.BIGINT, allowNull: false }, diff --git a/models/users.js b/models/users.js index 2f62f59..089b480 100644 --- a/models/users.js +++ b/models/users.js @@ -14,11 +14,23 @@ module.exports = function(sequelize, DataTypes) { }, user_token: { type: DataTypes.CHAR(36), - allowNull: false + allowNull: true }, player_api_id: { type: DataTypes.CHAR(36), + allowNull: true + }, + email: { + type: DataTypes.STRING(191), + allowNull: false + }, + password: { + type: DataTypes.STRING(191), allowNull: false + }, + remember_token: { + type: DataTypes.STRING(191), + allowNull: true } }, { tableName: 'users', |
