mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-08-24 03:55:49 -05:00
add category enu
This commit is contained in:
20
index.js
20
index.js
@@ -10,7 +10,6 @@ const cors = require("cors")
|
||||
const passport = require("passport")
|
||||
const DiscordStrategy = require("passport-discord").Strategy
|
||||
const User = require("./mongoose-models/user")
|
||||
const Player = require("./mongoose-models/player")
|
||||
const path = require("path")
|
||||
const schema = require("./schema")
|
||||
const mockUser = require("./utils/mocks")
|
||||
@@ -52,15 +51,16 @@ passport.use(
|
||||
}
|
||||
}
|
||||
|
||||
console.log("userToSave", userToSave)
|
||||
User.updateOne(
|
||||
{ discord_id: userToSave.discord_id },
|
||||
userToSave,
|
||||
{ upsert: true },
|
||||
function (err, user) {
|
||||
return cb(err, userToSave)
|
||||
}
|
||||
)
|
||||
Promise.all([
|
||||
User.updateOne(
|
||||
{ discord_id: userToSave.discord_id },
|
||||
userToSave,
|
||||
{ upsert: true },
|
||||
function (err, user) {
|
||||
return cb(err, userToSave)
|
||||
}
|
||||
),
|
||||
])
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
@@ -3,8 +3,35 @@ import * as Knex from "knex"
|
||||
export async function up(knex: Knex): Promise<void> {
|
||||
return knex.schema.createTable("salmonRunRecords", function (table) {
|
||||
table.increments()
|
||||
table.boolean("approved").notNullable()
|
||||
table.integer("goldenEggCount").notNullable()
|
||||
table.enu("wildcards", ["1_WILDCARD", "4_WILCARDS", "4_GOLDEN_WILDCARDS"])
|
||||
table
|
||||
.enu("category", [
|
||||
"TOTAL",
|
||||
"TOTAL_NO_NIGHT",
|
||||
"PRINCESS",
|
||||
"NT_NORMAL",
|
||||
"HT_NORMAL",
|
||||
"LT_NORMAL",
|
||||
"NT_RUSH",
|
||||
"HT_RUSH",
|
||||
"LT_RUSH",
|
||||
"NT_FOG",
|
||||
"HT_FOG",
|
||||
"LT_FOG",
|
||||
"NT_GOLDIE",
|
||||
"HT_GOLDIE",
|
||||
"LT_GOLDIE",
|
||||
"NT_GRILLERS",
|
||||
"HT_GRILLERS",
|
||||
"LT_GRILLERS",
|
||||
"NT_MOTHERSHIP",
|
||||
"HT_MOTHERSHIP",
|
||||
"LT_MOTHERSHIP",
|
||||
"LT_COHOCK",
|
||||
])
|
||||
.notNullable()
|
||||
table
|
||||
.integer("stageId")
|
||||
.notNullable()
|
||||
@@ -12,6 +39,7 @@ export async function up(knex: Knex): Promise<void> {
|
||||
.inTable("salmonRunStages")
|
||||
table.integer("grizzcoWeaponId").references("id").inTable("weapons")
|
||||
table.specificType("links", "TEXT[]")
|
||||
table.timestamp("createdAt").defaultTo(knex.fn.now())
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user