summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-03-31 20:50:10 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2017-03-31 20:50:10 +0200
commit6155af70d53765c7867b18834fe252c1209729bc (patch)
tree7c159cff68cb0bdee1df845ca2864148e5f31e58
parentf4421abda87f9f98d5fd0de88b9e70b146eb91b2 (diff)
downloadprocessor-6155af70d53765c7867b18834fe252c1209729bc.tar.gz
processor-6155af70d53765c7867b18834fe252c1209729bc.zip
move ORM model into seperate repo
-rw-r--r--generate_model.js23
-rw-r--r--model.js28
-rw-r--r--models/asset.js50
-rw-r--r--models/gamer.js41
-rw-r--r--models/hero_core_stats.js69
-rw-r--r--models/hero_dimension.js33
-rw-r--r--models/hero_stats.js41
-rw-r--r--models/heros.js85
-rw-r--r--models/item.js41
-rw-r--r--models/keys.js37
-rw-r--r--models/match.js50
-rw-r--r--models/match_ext.js52
-rw-r--r--models/migrations.js25
-rw-r--r--models/participant.js122
-rw-r--r--models/participant_ext.js42
-rw-r--r--models/participant_item_use.js34
-rw-r--r--models/player.js54
-rw-r--r--models/player_dimension.js33
-rw-r--r--models/player_ext.js60
-rw-r--r--models/player_stats.js33
-rw-r--r--models/roster.js58
-rw-r--r--models/roster_ext.js53
-rw-r--r--models/stats_dimensions.js29
-rw-r--r--package.json5
-rw-r--r--worker.js2
25 files changed, 2 insertions, 1098 deletions
diff --git a/generate_model.js b/generate_model.js
deleted file mode 100644
index d88fb12..0000000
--- a/generate_model.js
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/node
-
-var SequelizeAuto = require("sequelize-auto")
-
-var auto = new SequelizeAuto("vainweb", "vainweb", "vainweb", {
- host: "localhost",
- dialect: "mariadb",
- directory: "models",
- additional: {
- timestamps: false,
- underscored: true,
- freezeTableName: true
- },
- indentation: 2,
- spaces: true
-})
-
-auto.run(function (err) {
- if (err) throw err;
-
- console.log(auto.tables); // table list
- console.log(auto.foreignKeys); // foreign key list
-});
diff --git a/model.js b/model.js
deleted file mode 100644
index 867643b..0000000
--- a/model.js
+++ /dev/null
@@ -1,28 +0,0 @@
-/* jshint esnext:true */
-'use strict';
-
-var JsonField = require("sequelize-json");
-
-module.exports = (seq, Seq) => {
- let Match = seq.import("./models/match.js"),
- Asset = seq.import("./models/asset.js"),
- Roster = seq.import("./models/roster.js"),
- //Team = seq.import("./models/team.js"),
- Participant = seq.import("./models/participant.js"),
- ParticipantItemUse = seq.import("./models/participant_item_use.js"),
- Player = seq.import("./models/player.js"),
- Item = seq.import("./models/item.js");
-
- Match.hasMany(Asset, {as: "Assets"});
- Asset.belongsTo(Match);
- Roster.belongsTo(Match, { foreignKey: "match_api_id", targetKey: "api_id" });
- //Roster.hasOne(Team, {as: "Team"});
- //Team.belongsTo(Roster);
- Participant.belongsTo(Roster, { foreignKey: "roster_api_id", targetKey: "api_id" });
- Participant.hasOne(Player, { foreignKey: "player_api_id", targetKey: "api_id" });
- ParticipantItemUse.belongsTo(Participant, { foreignKey: "participant_api_id", targetKey: "api_id" });
- ParticipantItemUse.hasOne(Item);
-
- //return {Match, Roster, Team, Participant, Player, Asset};
- return {Match, Roster, Participant, ParticipantItemUse, Player, Asset, Item};
-};
diff --git a/models/asset.js b/models/asset.js
deleted file mode 100644
index af8d040..0000000
--- a/models/asset.js
+++ /dev/null
@@ -1,50 +0,0 @@
-/* jshint indent: 2 */
-
-module.exports = function(sequelize, DataTypes) {
- return sequelize.define('asset', {
- id: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: false,
- primaryKey: true,
- autoIncrement: true
- },
- api_id: {
- type: DataTypes.STRING(191),
- allowNull: false,
- unique: true
- },
- match_api_id: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- url: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- content_type: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- created_at: {
- type: DataTypes.TIME,
- allowNull: false
- },
- description: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- filename: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- name: {
- type: DataTypes.STRING(191),
- allowNull: false
- }
- }, {
- tableName: 'asset',
- timestamps: false,
- underscored: true,
- freezeTableName: true
- });
-};
diff --git a/models/gamer.js b/models/gamer.js
deleted file mode 100644
index d88484c..0000000
--- a/models/gamer.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/* jshint indent: 2 */
-
-module.exports = function(sequelize, DataTypes) {
- return sequelize.define('gamer', {
- id: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: false,
- primaryKey: true,
- autoIncrement: true
- },
- player_api_id: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- name: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- vainsocial_status: {
- type: DataTypes.STRING(191),
- allowNull: true
- },
- vainglory_ign: {
- type: DataTypes.STRING(191),
- allowNull: true
- },
- vainglory_shard_id: {
- type: DataTypes.STRING(191),
- allowNull: true
- },
- vainglory_is_pro: {
- type: DataTypes.INTEGER(1),
- allowNull: true
- }
- }, {
- tableName: 'gamer',
- timestamps: false,
- underscored: true,
- freezeTableName: true
- });
-};
diff --git a/models/hero_core_stats.js b/models/hero_core_stats.js
deleted file mode 100644
index bc709af..0000000
--- a/models/hero_core_stats.js
+++ /dev/null
@@ -1,69 +0,0 @@
-/* jshint indent: 2 */
-
-module.exports = function(sequelize, DataTypes) {
- return sequelize.define('hero_core_stats', {
- id: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: false,
- primaryKey: true,
- autoIncrement: true
- },
- created_at: {
- type: DataTypes.TIME,
- allowNull: true
- },
- updated_at: {
- type: DataTypes.TIME,
- allowNull: true
- },
- series: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- hp: {
- type: "DOUBLE",
- allowNull: false
- },
- energy: {
- type: "DOUBLE",
- allowNull: false
- },
- weapon_damage: {
- type: "DOUBLE",
- allowNull: false
- },
- attack_speed: {
- type: "DOUBLE",
- allowNull: false
- },
- armor: {
- type: "DOUBLE",
- allowNull: false
- },
- shield: {
- type: "DOUBLE",
- allowNull: false
- },
- attack_range: {
- type: "DOUBLE",
- allowNull: false
- },
- move_speed: {
- type: "DOUBLE",
- allowNull: false
- },
- hp_regen: {
- type: "DOUBLE",
- allowNull: false
- },
- ep_regen: {
- type: "DOUBLE",
- allowNull: false
- }
- }, {
- tableName: 'hero_core_stats',
- timestamps: false,
- underscored: true,
- freezeTableName: true
- });
-};
diff --git a/models/hero_dimension.js b/models/hero_dimension.js
deleted file mode 100644
index c5af060..0000000
--- a/models/hero_dimension.js
+++ /dev/null
@@ -1,33 +0,0 @@
-/* jshint indent: 2 */
-
-module.exports = function(sequelize, DataTypes) {
- return sequelize.define('hero_dimension', {
- id: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: false,
- primaryKey: true,
- autoIncrement: true
- },
- hero_id: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- dimension_id: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- stats_id: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- computed_on: {
- type: DataTypes.DATE,
- allowNull: false
- }
- }, {
- tableName: 'hero_dimension',
- timestamps: false,
- underscored: true,
- freezeTableName: true
- });
-};
diff --git a/models/hero_stats.js b/models/hero_stats.js
deleted file mode 100644
index c79ea4f..0000000
--- a/models/hero_stats.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/* jshint indent: 2 */
-
-module.exports = function(sequelize, DataTypes) {
- return sequelize.define('hero_stats', {
- id: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: false,
- primaryKey: true,
- autoIncrement: true
- },
- created_at: {
- type: DataTypes.TIME,
- allowNull: true
- },
- updated_at: {
- type: DataTypes.TIME,
- allowNull: true
- },
- pick_rate: {
- type: "DOUBLE(8,2)",
- allowNull: false
- },
- win_rate: {
- type: "DOUBLE(8,2)",
- allowNull: false
- },
- gold_per_min: {
- type: "DOUBLE(8,2)",
- allowNull: false
- },
- cs_per_min: {
- type: "DOUBLE(8,2)",
- allowNull: false
- }
- }, {
- tableName: 'hero_stats',
- timestamps: false,
- underscored: true,
- freezeTableName: true
- });
-};
diff --git a/models/heros.js b/models/heros.js
deleted file mode 100644
index 5260ee7..0000000
--- a/models/heros.js
+++ /dev/null
@@ -1,85 +0,0 @@
-/* jshint indent: 2 */
-
-module.exports = function(sequelize, DataTypes) {
- return sequelize.define('heros', {
- id: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: false,
- primaryKey: true,
- autoIncrement: true
- },
- created_at: {
- type: DataTypes.TIME,
- allowNull: true
- },
- updated_at: {
- type: DataTypes.TIME,
- allowNull: true
- },
- added_in_patch: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- name: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- api_name: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- is_assassin: {
- type: DataTypes.INTEGER(1),
- allowNull: false
- },
- is_mage: {
- type: DataTypes.INTEGER(1),
- allowNull: false
- },
- is_protector: {
- type: DataTypes.INTEGER(1),
- allowNull: false
- },
- is_sniper: {
- type: DataTypes.INTEGER(1),
- allowNull: false
- },
- is_warrior: {
- type: DataTypes.INTEGER(1),
- allowNull: false
- },
- is_carry: {
- type: DataTypes.INTEGER(1),
- allowNull: false
- },
- is_jungler: {
- type: DataTypes.INTEGER(1),
- allowNull: false
- },
- is_captain: {
- type: DataTypes.INTEGER(1),
- allowNull: false
- },
- heroic_perk: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- ability_a: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- ability_b: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- ability_c: {
- type: DataTypes.STRING(191),
- allowNull: false
- }
- }, {
- tableName: 'heros',
- timestamps: false,
- underscored: true,
- freezeTableName: true
- });
-};
diff --git a/models/item.js b/models/item.js
deleted file mode 100644
index 6f2aac9..0000000
--- a/models/item.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/* jshint indent: 2 */
-
-module.exports = function(sequelize, DataTypes) {
- return sequelize.define('item', {
- id: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: false,
- primaryKey: true,
- autoIncrement: true
- },
- created_at: {
- type: DataTypes.TIME,
- allowNull: true
- },
- updated_at: {
- type: DataTypes.TIME,
- allowNull: true
- },
- series: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- name: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- active: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- passive: {
- type: DataTypes.STRING(191),
- allowNull: false
- }
- }, {
- tableName: 'item',
- timestamps: false,
- underscored: true,
- freezeTableName: true
- });
-};
diff --git a/models/keys.js b/models/keys.js
deleted file mode 100644
index 0ba17f0..0000000
--- a/models/keys.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/* jshint indent: 2 */
-
-module.exports = function(sequelize, DataTypes) {
- return sequelize.define('keys', {
- id: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: false,
- primaryKey: true,
- autoIncrement: true
- },
- created_at: {
- type: DataTypes.TIME,
- allowNull: true
- },
- updated_at: {
- type: DataTypes.TIME,
- allowNull: true
- },
- type: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- key: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- value: {
- type: DataTypes.STRING(191),
- allowNull: false
- }
- }, {
- tableName: 'keys',
- timestamps: false,
- underscored: true,
- freezeTableName: true
- });
-};
diff --git a/models/match.js b/models/match.js
deleted file mode 100644
index ec5bdab..0000000
--- a/models/match.js
+++ /dev/null
@@ -1,50 +0,0 @@
-/* jshint indent: 2 */
-
-module.exports = function(sequelize, DataTypes) {
- return sequelize.define('match', {
- id: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: false,
- primaryKey: true,
- autoIncrement: true
- },
- api_id: {
- type: DataTypes.STRING(191),
- allowNull: false,
- unique: true
- },
- shard_id: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- series: {
- type: DataTypes.STRING(191),
- allowNull: true
- },
- created_at: {
- type: DataTypes.TIME,
- allowNull: false
- },
- duration: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- game_mode: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- end_game_reason: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- queue: {
- type: DataTypes.STRING(191),
- allowNull: false
- }
- }, {
- tableName: 'match',
- timestamps: false,
- underscored: true,
- freezeTableName: true
- });
-};
diff --git a/models/match_ext.js b/models/match_ext.js
deleted file mode 100644
index 01d6f6a..0000000
--- a/models/match_ext.js
+++ /dev/null
@@ -1,52 +0,0 @@
-/* jshint indent: 2 */
-
-module.exports = function(sequelize, DataTypes) {
- return sequelize.define('match_ext', {
- id: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- match_api_id: {
- type: DataTypes.STRING(191),
- allowNull: false,
- unique: true
- },
- winning_side: {
- type: DataTypes.STRING(191),
- allowNull: true
- },
- total_kills: {
- type: DataTypes.INTEGER(11),
- allowNull: true
- },
- kraken_captures: {
- type: DataTypes.INTEGER(11),
- allowNull: true
- },
- gold: {
- type: DataTypes.INTEGER(11),
- allowNull: true
- },
- aces_earned: {
- type: DataTypes.INTEGER(11),
- allowNull: true
- },
- turret_captures: {
- type: DataTypes.INTEGER(11),
- allowNull: true
- },
- gold_mine_captures: {
- type: DataTypes.INTEGER(11),
- allowNull: true
- },
- crystal_miner_captures: {
- type: DataTypes.INTEGER(11),
- allowNull: true
- }
- }, {
- tableName: 'match_ext',
- timestamps: false,
- underscored: true,
- freezeTableName: true
- });
-};
diff --git a/models/migrations.js b/models/migrations.js
deleted file mode 100644
index c0b3ecf..0000000
--- a/models/migrations.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/* jshint indent: 2 */
-
-module.exports = function(sequelize, DataTypes) {
- return sequelize.define('migrations', {
- id: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: false,
- primaryKey: true,
- autoIncrement: true
- },
- migration: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- batch: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- }
- }, {
- tableName: 'migrations',
- timestamps: false,
- underscored: true,
- freezeTableName: true
- });
-};
diff --git a/models/participant.js b/models/participant.js
deleted file mode 100644
index 9c17e74..0000000
--- a/models/participant.js
+++ /dev/null
@@ -1,122 +0,0 @@
-/* jshint indent: 2 */
-
-module.exports = function(sequelize, DataTypes) {
- return sequelize.define('participant', {
- id: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: false,
- primaryKey: true,
- autoIncrement: true
- },
- shard_id: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- api_id: {
- type: DataTypes.STRING(191),
- allowNull: false,
- unique: true
- },
- player_api_id: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- roster_api_id: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- created_at: {
- type: DataTypes.TIME,
- allowNull: true
- },
- series: {
- type: DataTypes.TIME,
- allowNull: true
- },
- actor: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- assists: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- crystal_mine_captures: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- deaths: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- farm: {
- type: "DOUBLE",
- allowNull: false
- },
- first_afk_time: {
- type: "DOUBLE",
- allowNull: false
- },
- gold: {
- type: DataTypes.INTEGER(11),
- allowNull: true
- },
- gold_mine_captures: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- jungle_kills: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- karma_level: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- kills: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- kraken_captures: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- level: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- minion_kills: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- non_jungle_minion_kills: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- skill_tier: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- skin_key: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- turret_captures: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- went_afk: {
- type: DataTypes.INTEGER(1),
- allowNull: false
- },
- winner: {
- type: DataTypes.INTEGER(1),
- allowNull: false
- }
- }, {
- tableName: 'participant',
- timestamps: false,
- underscored: true,
- freezeTableName: true
- });
-};
diff --git a/models/participant_ext.js b/models/participant_ext.js
deleted file mode 100644
index abcb5ed..0000000
--- a/models/participant_ext.js
+++ /dev/null
@@ -1,42 +0,0 @@
-/* jshint indent: 2 */
-
-module.exports = function(sequelize, DataTypes) {
- return sequelize.define('participant_ext', {
- id: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: false,
- primaryKey: true,
- autoIncrement: true
- },
- series: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- participant_api_id: {
- type: DataTypes.STRING(191),
- allowNull: false,
- unique: true
- },
- role: {
- type: DataTypes.STRING(191),
- allowNull: true
- },
- score: {
- type: "DOUBLE(8,2)",
- allowNull: true
- },
- kda: {
- type: "DOUBLE(8,2)",
- allowNull: true
- },
- kills_participation: {
- type: "DOUBLE(8,2)",
- allowNull: true
- }
- }, {
- tableName: 'participant_ext',
- timestamps: false,
- underscored: true,
- freezeTableName: true
- });
-};
diff --git a/models/participant_item_use.js b/models/participant_item_use.js
deleted file mode 100644
index 5dc8c39..0000000
--- a/models/participant_item_use.js
+++ /dev/null
@@ -1,34 +0,0 @@
-/* jshint indent: 2 */
-
-module.exports = function(sequelize, DataTypes) {
- return sequelize.define('participant_item_use', {
- id: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: false,
- primaryKey: true,
- autoIncrement: true
- },
- participant_api_id: {
- type: DataTypes.STRING(191),
- allowNull: false,
- unique: true
- },
- item_id: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- action: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- time_from_start: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- }
- }, {
- tableName: 'participant_item_use',
- timestamps: false,
- underscored: true,
- freezeTableName: true
- });
-};
diff --git a/models/player.js b/models/player.js
deleted file mode 100644
index 827e9fc..0000000
--- a/models/player.js
+++ /dev/null
@@ -1,54 +0,0 @@
-/* jshint indent: 2 */
-
-module.exports = function(sequelize, DataTypes) {
- return sequelize.define('player', {
- id: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: false,
- primaryKey: true,
- autoIncrement: true
- },
- shard_id: {
- type: DataTypes.STRING(191),
- allowNull: true
- },
- api_id: {
- type: DataTypes.STRING(191),
- allowNull: false,
- unique: true
- },
- created_at: {
- type: DataTypes.TIME,
- allowNull: true
- },
- name: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- last_match_created_date: {
- type: DataTypes.TIME,
- allowNull: true
- },
- last_update: {
- type: DataTypes.TIME,
- allowNull: true
- },
- level: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- xp: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- lifetime_gold: {
- type: "DOUBLE(8,2)",
- allowNull: false
- }
- }, {
- tableName: 'player',
- timestamps: false,
- underscored: true,
- freezeTableName: true
- });
-};
diff --git a/models/player_dimension.js b/models/player_dimension.js
deleted file mode 100644
index 82ff7a0..0000000
--- a/models/player_dimension.js
+++ /dev/null
@@ -1,33 +0,0 @@
-/* jshint indent: 2 */
-
-module.exports = function(sequelize, DataTypes) {
- return sequelize.define('player_dimension', {
- id: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: false,
- primaryKey: true,
- autoIncrement: true
- },
- player_id: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- dimension_id: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- stats_id: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- computed_on: {
- type: DataTypes.DATE,
- allowNull: false
- }
- }, {
- tableName: 'player_dimension',
- timestamps: false,
- underscored: true,
- freezeTableName: true
- });
-};
diff --git a/models/player_ext.js b/models/player_ext.js
deleted file mode 100644
index 183faf9..0000000
--- a/models/player_ext.js
+++ /dev/null
@@ -1,60 +0,0 @@
-/* jshint indent: 2 */
-
-module.exports = function(sequelize, DataTypes) {
- return sequelize.define('player_ext', {
- id: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- player_api_id: {
- type: DataTypes.STRING(191),
- allowNull: false,
- unique: true
- },
- played: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- played_ranked: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- played_casual: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- played_brawl: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- wins: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- wins_ranked: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- wins_casual: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- wins_brawl: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- skill_tier: {
- type: DataTypes.STRING(191),
- allowNull: true
- },
- streak: {
- type: DataTypes.STRING(191),
- allowNull: false
- }
- }, {
- tableName: 'player_ext',
- timestamps: false,
- underscored: true,
- freezeTableName: true
- });
-};
diff --git a/models/player_stats.js b/models/player_stats.js
deleted file mode 100644
index 6bbeb69..0000000
--- a/models/player_stats.js
+++ /dev/null
@@ -1,33 +0,0 @@
-/* jshint indent: 2 */
-
-module.exports = function(sequelize, DataTypes) {
- return sequelize.define('player_stats', {
- id: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: false,
- primaryKey: true,
- autoIncrement: true
- },
- created_at: {
- type: DataTypes.TIME,
- allowNull: true
- },
- updated_at: {
- type: DataTypes.TIME,
- allowNull: true
- },
- gold_per_min: {
- type: "DOUBLE(8,2)",
- allowNull: false
- },
- cs_per_min: {
- type: "DOUBLE(8,2)",
- allowNull: false
- }
- }, {
- tableName: 'player_stats',
- timestamps: false,
- underscored: true,
- freezeTableName: true
- });
-};
diff --git a/models/roster.js b/models/roster.js
deleted file mode 100644
index 3848c6a..0000000
--- a/models/roster.js
+++ /dev/null
@@ -1,58 +0,0 @@
-/* jshint indent: 2 */
-
-module.exports = function(sequelize, DataTypes) {
- return sequelize.define('roster', {
- id: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: false,
- primaryKey: true,
- autoIncrement: true
- },
- shard_id: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- api_id: {
- type: DataTypes.STRING(191),
- allowNull: false,
- unique: true
- },
- match_api_id: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- aces_earned: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- gold: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- hero_kills: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- kraken_captures: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- side: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- turret_kills: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- turrets_remaining: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- }
- }, {
- tableName: 'roster',
- timestamps: false,
- underscored: true,
- freezeTableName: true
- });
-};
diff --git a/models/roster_ext.js b/models/roster_ext.js
deleted file mode 100644
index 1f7c37d..0000000
--- a/models/roster_ext.js
+++ /dev/null
@@ -1,53 +0,0 @@
-/* jshint indent: 2 */
-
-module.exports = function(sequelize, DataTypes) {
- return sequelize.define('roster_ext', {
- id: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: false,
- primaryKey: true,
- autoIncrement: true
- },
- roster_api_id: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- kills: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- assists: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- deaths: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- gold: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- kraken_captures: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- side: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- turret_captures: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- turrets_remaining: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- }
- }, {
- tableName: 'roster_ext',
- timestamps: false,
- underscored: true,
- freezeTableName: true
- });
-};
diff --git a/models/stats_dimensions.js b/models/stats_dimensions.js
deleted file mode 100644
index 0aa6ef3..0000000
--- a/models/stats_dimensions.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/* jshint indent: 2 */
-
-module.exports = function(sequelize, DataTypes) {
- return sequelize.define('stats_dimensions', {
- id: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: false,
- primaryKey: true,
- autoIncrement: true
- },
- dimension_on: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- name: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- value: {
- type: DataTypes.STRING(191),
- allowNull: false
- }
- }, {
- tableName: 'stats_dimensions',
- timestamps: false,
- underscored: true,
- freezeTableName: true
- });
-};
diff --git a/package.json b/package.json
index 55adacc..17b6f8d 100644
--- a/package.json
+++ b/package.json
@@ -6,10 +6,7 @@
"dependencies": {
"amqplib": "^0.5.1",
"mysql": "^2.13.0",
- "sequelize": "^3.30.4",
- "sequelize-auto": "^0.4.25",
- "sequelize-json": "^2.1.2",
- "superagent-jsonapify": "^1.4.4"
+ "sequelize": "^3.30.4"
},
"devDependencies": {},
"scripts": {
diff --git a/worker.js b/worker.js
index b9268f8..1ea66bd 100644
--- a/worker.js
+++ b/worker.js
@@ -12,7 +12,7 @@ var RABBITMQ_URI = process.env.RABBITMQ_URI || "amqp://localhost",
(async () => {
let seq = new Seq(DATABASE_URI),
- model = require("./model")(seq, Seq),
+ model = require("../orm/model")(seq, Seq),
rabbit = await amqp.connect(RABBITMQ_URI),
ch = await rabbit.createChannel();