This commit is contained in:
starified
2026-04-21 22:03:19 -04:00
parent 36e2d11f2e
commit 08bf320b57
4681 changed files with 566542 additions and 0 deletions

44
server/seed.js Normal file
View File

@@ -0,0 +1,44 @@
const dotenv = require("dotenv");
const { pool, ensureDatabase } = require("./db");
dotenv.config();
const SEED_CONFIRMATION = "YES_WIPE_AND_SEED";
if (process.env.ALLOW_SEED !== SEED_CONFIRMATION) {
console.error(
`Seed blocked. To run intentionally, set ALLOW_SEED=${SEED_CONFIRMATION} for this command.`
);
process.exit(1);
}
const samplePlayers = [
"Starified",
"ProtectionZ",
"DopeyDude",
"Morocco",
"chubbsge",
"Madhansh",
"moorona",
"Nepa",
"Krilbex",
"Genvrousbooch",
"Rocketer",
"LeosinEdits",
];
async function seed() {
await ensureDatabase();
for (const username of samplePlayers) {
await pool.query("INSERT IGNORE INTO players (username) VALUES (?)", [username]);
}
console.log("Seed complete (players only, no rank assignment).");
process.exit(0);
}
seed().catch((error) => {
console.error("Seed failed:", error);
process.exit(1);
});