Store types

master
rubenwardy 2017-01-19 12:26:57 +00:00
parent 004de36144
commit 8fd76b88b6
2 changed files with 6 additions and 3 deletions

View File

@ -2,14 +2,14 @@
var ModType = { var ModType = {
mod: "mod", mod: "mod",
modpack: "modpack", game: "game",
game: "game" texturepack: "texturepack"
} }
class Mod { class Mod {
constructor(author) { constructor(author) {
this.author = author || null this.author = author || null
this.type = "1" this.type = null
this.basename = null this.basename = null
this.title = null this.title = null
this.description = "" this.description = ""

View File

@ -19,6 +19,7 @@ var User = sequelize.define("user", {
var Mod = sequelize.define("mod", { var Mod = sequelize.define("mod", {
basename: Sequelize.STRING(100), basename: Sequelize.STRING(100),
type: Sequelize.ENUM("mod", "game", "texturepack"),
title: Sequelize.STRING(100), title: Sequelize.STRING(100),
description: Sequelize.STRING(900), description: Sequelize.STRING(900),
@ -41,6 +42,7 @@ const CMod = require("./../../common/mod")
function convertRowToMod(row) { function convertRowToMod(row) {
var mod = new CMod(row.user.username) var mod = new CMod(row.user.username)
mod.basename = row.basename mod.basename = row.basename
mod.type = row.type
mod.title = row.title mod.title = row.title
mod.description = row.description mod.description = row.description
mod.forum_id = row.forum_id mod.forum_id = row.forum_id
@ -80,6 +82,7 @@ async.parallel([
}, },
defaults: { defaults: {
user: user, user: user,
type: "mod",
title: "Awards", title: "Awards",
description: "Adds awards to minetest", description: "Adds awards to minetest",