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 = {
mod: "mod",
modpack: "modpack",
game: "game"
game: "game",
texturepack: "texturepack"
}
class Mod {
constructor(author) {
this.author = author || null
this.type = "1"
this.type = null
this.basename = null
this.title = null
this.description = ""

View File

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