mirror of
https://github.com/spacebarchat/server.git
synced 2026-04-09 03:45:41 +00:00
prettier
This commit is contained in:
@@ -6,75 +6,77 @@ const { execIn } = require("./utils.js");
|
||||
const { ask } = require("./utils/ask.js");
|
||||
|
||||
async function main() {
|
||||
let filename;
|
||||
if(process.argv[2]) filename = process.argv[2];
|
||||
else filename = await ask("Please enter the name of your migration: ");
|
||||
let dbconf;
|
||||
try {
|
||||
dbconf = JSON.parse(fs.readFileSync("dbconf.json"));
|
||||
} catch (e) {
|
||||
console.log("No dbconf.json found!");
|
||||
dbconf = {};
|
||||
}
|
||||
let filename;
|
||||
if (process.argv[2]) filename = process.argv[2];
|
||||
else filename = await ask("Please enter the name of your migration: ");
|
||||
let dbconf;
|
||||
try {
|
||||
dbconf = JSON.parse(fs.readFileSync("dbconf.json"));
|
||||
} catch (e) {
|
||||
console.log("No dbconf.json found!");
|
||||
dbconf = {};
|
||||
}
|
||||
|
||||
if(!dbconf["sqlite"])
|
||||
dbconf.sqlite = {
|
||||
conn_str: "migrations.db",
|
||||
migrations_dir: "sqlite",
|
||||
package: "sqlite3"
|
||||
}
|
||||
if(!dbconf["postgres"] && process.env.FC_DB_POSTGRES) {
|
||||
console.log("Found FC_DB_POSTGRES environment variable. Using it!");
|
||||
dbconf.postgres = {
|
||||
conn_str: process.env.FC_DB_POSTGRES,
|
||||
migrations_dir: "postgres",
|
||||
package: "pg"
|
||||
}
|
||||
}
|
||||
if(!dbconf["mariadb"] && process.env.FC_DB_MARIADB){
|
||||
console.log("Found FC_DB_MARIADB environment variable. Using it!");
|
||||
dbconf.mariadb = {
|
||||
conn_str: process.env.FC_DB_MARIADB,
|
||||
migrations_dir: "mariadb",
|
||||
package: "mysql2"
|
||||
}
|
||||
}
|
||||
fs.writeFileSync("dbconf.json", JSON.stringify(dbconf, null, 4));
|
||||
if (!dbconf["sqlite"])
|
||||
dbconf.sqlite = {
|
||||
conn_str: "migrations.db",
|
||||
migrations_dir: "sqlite",
|
||||
package: "sqlite3"
|
||||
};
|
||||
if (!dbconf["postgres"] && process.env.FC_DB_POSTGRES) {
|
||||
console.log("Found FC_DB_POSTGRES environment variable. Using it!");
|
||||
dbconf.postgres = {
|
||||
conn_str: process.env.FC_DB_POSTGRES,
|
||||
migrations_dir: "postgres",
|
||||
package: "pg"
|
||||
};
|
||||
}
|
||||
if (!dbconf["mariadb"] && process.env.FC_DB_MARIADB) {
|
||||
console.log("Found FC_DB_MARIADB environment variable. Using it!");
|
||||
dbconf.mariadb = {
|
||||
conn_str: process.env.FC_DB_MARIADB,
|
||||
migrations_dir: "mariadb",
|
||||
package: "mysql2"
|
||||
};
|
||||
}
|
||||
fs.writeFileSync("dbconf.json", JSON.stringify(dbconf, null, 4));
|
||||
|
||||
//build
|
||||
execIn(`node scripts/build_new.js`, process.cwd(), {stdio: "inherit"});
|
||||
//build
|
||||
execIn(`node scripts/build_new.js`, process.cwd(), { stdio: "inherit" });
|
||||
|
||||
if(fs.existsSync(".env") && !fs.existsSync(".env.bak"))
|
||||
fs.renameSync(".env", ".env.bak");
|
||||
Object.keys(dbconf).forEach((db) => {
|
||||
console.log(`Applying migrations for ${db}`);
|
||||
if(!fs.existsSync(path.join("node_modules", dbconf[db].package)))
|
||||
execIn(`npm i ${dbconf[db].package}`, process.cwd());
|
||||
fs.writeFileSync(
|
||||
`.env`,
|
||||
`DATABASE=${dbconf[db].conn_str}
|
||||
if (fs.existsSync(".env") && !fs.existsSync(".env.bak")) fs.renameSync(".env", ".env.bak");
|
||||
Object.keys(dbconf).forEach((db) => {
|
||||
console.log(`Applying migrations for ${db}`);
|
||||
if (!fs.existsSync(path.join("node_modules", dbconf[db].package))) execIn(`npm i ${dbconf[db].package}`, process.cwd());
|
||||
fs.writeFileSync(
|
||||
`.env`,
|
||||
`DATABASE=${dbconf[db].conn_str}
|
||||
THREADS=1
|
||||
DB_MIGRATE=true
|
||||
DB_VERBOSE=true`
|
||||
);
|
||||
execIn(`node dist/start.js`, process.cwd(), {stdio: "inherit"});
|
||||
});
|
||||
);
|
||||
execIn(`node dist/start.js`, process.cwd(), { stdio: "inherit" });
|
||||
});
|
||||
|
||||
Object.keys(dbconf).forEach((db) => {
|
||||
console.log(`Generating new migrations for ${db}`);
|
||||
fs.writeFileSync(
|
||||
`.env`,
|
||||
`DATABASE=${dbconf[db].conn_str}
|
||||
Object.keys(dbconf).forEach((db) => {
|
||||
console.log(`Generating new migrations for ${db}`);
|
||||
fs.writeFileSync(
|
||||
`.env`,
|
||||
`DATABASE=${dbconf[db].conn_str}
|
||||
THREADS=1
|
||||
DB_MIGRATE=true
|
||||
DB_VERBOSE=true`
|
||||
);
|
||||
execIn(`node node_modules/typeorm/cli.js migration:generate "src/util/migrations/${db}/${filename}" -d dist/util/util/Database.js -p`, process.cwd(), {stdio: "inherit"});
|
||||
});
|
||||
if(fs.existsSync(".env.bak")) {
|
||||
fs.rmSync(".env");
|
||||
fs.renameSync(".env.bak", ".env");
|
||||
}
|
||||
exit(0);
|
||||
);
|
||||
execIn(
|
||||
`node node_modules/typeorm/cli.js migration:generate "src/util/migrations/${db}/${filename}" -d dist/util/util/Database.js -p`,
|
||||
process.cwd(),
|
||||
{ stdio: "inherit" }
|
||||
);
|
||||
});
|
||||
if (fs.existsSync(".env.bak")) {
|
||||
fs.rmSync(".env");
|
||||
fs.renameSync(".env.bak", ".env");
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
main();
|
||||
main();
|
||||
|
||||
@@ -5,7 +5,6 @@ const { stdout, exit } = require("process");
|
||||
const { execIn } = require("./utils.js");
|
||||
const { ask } = require("./utils/ask.js");
|
||||
|
||||
|
||||
const data = { env: [], config: { register: {} }, extra_pkgs: [] };
|
||||
let rights = [];
|
||||
|
||||
@@ -201,8 +200,6 @@ async function askRights() {
|
||||
return selectedRights;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function printTitle(input) {
|
||||
let width = stdout.columns / 2 - 1; //40
|
||||
console.log();
|
||||
@@ -210,7 +207,6 @@ function printTitle(input) {
|
||||
console.log();
|
||||
}
|
||||
|
||||
|
||||
function BitFlag(int) {
|
||||
return 1n << BigInt(int);
|
||||
}
|
||||
|
||||
@@ -15,6 +15,6 @@ async function askBool(question) {
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
ask,
|
||||
askBool
|
||||
}
|
||||
ask,
|
||||
askBool
|
||||
};
|
||||
|
||||
@@ -45,8 +45,8 @@ export default function TestClient(app: Application) {
|
||||
res.set(name, value);
|
||||
});
|
||||
} else {
|
||||
if(req.params.file.endsWith(".map")) {
|
||||
return res.status(404).send("Not found");
|
||||
if (req.params.file.endsWith(".map")) {
|
||||
return res.status(404).send("Not found");
|
||||
}
|
||||
console.log(`[TestClient] Downloading file not yet cached! Asset file: ${req.params.file}`);
|
||||
response = await fetch(`https://discord.com/assets/${req.params.file}`, {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Request, Response, Router } from "express";
|
||||
import { route, getIpAdress, verifyCaptcha } from "@fosscord/api";
|
||||
import { Config, User, generateToken, adjustEmail, FieldErrors, LoginSchema } from "@fosscord/util";
|
||||
import { getIpAdress, route, verifyCaptcha } from "@fosscord/api";
|
||||
import { adjustEmail, Config, FieldErrors, generateToken, LoginSchema, User } from "@fosscord/util";
|
||||
import crypto from "crypto";
|
||||
import { Request, Response, Router } from "express";
|
||||
|
||||
let bcrypt: any;
|
||||
try {
|
||||
@@ -38,7 +38,7 @@ router.post("/", route({ body: "LoginSchema" }), async (req: Request, res: Respo
|
||||
captcha_key: verify["error-codes"],
|
||||
captcha_sitekey: sitekey,
|
||||
captcha_service: service
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -134,159 +134,159 @@ const skus = new Map([
|
||||
price: 0,
|
||||
price_tier: null
|
||||
}
|
||||
],
|
||||
]
|
||||
],
|
||||
[
|
||||
"978380684370378762",
|
||||
[
|
||||
[
|
||||
{
|
||||
"id": "978380692553465866",
|
||||
"name": "Premium Tier 0 Monthly",
|
||||
"interval": 1,
|
||||
"interval_count": 1,
|
||||
"tax_inclusive": true,
|
||||
"sku_id": "978380684370378762",
|
||||
"currency": "usd",
|
||||
"price": 299,
|
||||
"price_tier": null,
|
||||
"prices": {
|
||||
id: "978380692553465866",
|
||||
name: "Premium Tier 0 Monthly",
|
||||
interval: 1,
|
||||
interval_count: 1,
|
||||
tax_inclusive: true,
|
||||
sku_id: "978380684370378762",
|
||||
currency: "usd",
|
||||
price: 299,
|
||||
price_tier: null,
|
||||
prices: {
|
||||
"0": {
|
||||
"country_prices": {
|
||||
"country_code": "US",
|
||||
"prices": [
|
||||
country_prices: {
|
||||
country_code: "US",
|
||||
prices: [
|
||||
{
|
||||
"currency": "usd",
|
||||
"amount": 0,
|
||||
"exponent": 2
|
||||
currency: "usd",
|
||||
amount: 0,
|
||||
exponent: 2
|
||||
}
|
||||
]
|
||||
},
|
||||
"payment_source_prices": {
|
||||
payment_source_prices: {
|
||||
"775487223059316758": [
|
||||
{
|
||||
"currency": "usd",
|
||||
"amount": 0,
|
||||
"exponent": 2
|
||||
currency: "usd",
|
||||
amount: 0,
|
||||
exponent: 2
|
||||
}
|
||||
],
|
||||
"736345864146255982": [
|
||||
{
|
||||
"currency": "usd",
|
||||
"amount": 0,
|
||||
"exponent": 2
|
||||
currency: "usd",
|
||||
amount: 0,
|
||||
exponent: 2
|
||||
}
|
||||
],
|
||||
"683074999590060249": [
|
||||
{
|
||||
"currency": "usd",
|
||||
"amount": 0,
|
||||
"exponent": 2
|
||||
currency: "usd",
|
||||
amount: 0,
|
||||
exponent: 2
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"3": {
|
||||
"country_prices": {
|
||||
"country_code": "US",
|
||||
"prices": [
|
||||
country_prices: {
|
||||
country_code: "US",
|
||||
prices: [
|
||||
{
|
||||
"currency": "usd",
|
||||
"amount": 0,
|
||||
"exponent": 2
|
||||
currency: "usd",
|
||||
amount: 0,
|
||||
exponent: 2
|
||||
}
|
||||
]
|
||||
},
|
||||
"payment_source_prices": {
|
||||
payment_source_prices: {
|
||||
"775487223059316758": [
|
||||
{
|
||||
"currency": "usd",
|
||||
"amount": 0,
|
||||
"exponent": 2
|
||||
currency: "usd",
|
||||
amount: 0,
|
||||
exponent: 2
|
||||
}
|
||||
],
|
||||
"736345864146255982": [
|
||||
{
|
||||
"currency": "usd",
|
||||
"amount": 0,
|
||||
"exponent": 2
|
||||
currency: "usd",
|
||||
amount: 0,
|
||||
exponent: 2
|
||||
}
|
||||
],
|
||||
"683074999590060249": [
|
||||
{
|
||||
"currency": "usd",
|
||||
"amount": 0,
|
||||
"exponent": 2
|
||||
currency: "usd",
|
||||
amount: 0,
|
||||
exponent: 2
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"4": {
|
||||
"country_prices": {
|
||||
"country_code": "US",
|
||||
"prices": [
|
||||
country_prices: {
|
||||
country_code: "US",
|
||||
prices: [
|
||||
{
|
||||
"currency": "usd",
|
||||
"amount": 0,
|
||||
"exponent": 2
|
||||
currency: "usd",
|
||||
amount: 0,
|
||||
exponent: 2
|
||||
}
|
||||
]
|
||||
},
|
||||
"payment_source_prices": {
|
||||
payment_source_prices: {
|
||||
"775487223059316758": [
|
||||
{
|
||||
"currency": "usd",
|
||||
"amount": 0,
|
||||
"exponent": 2
|
||||
currency: "usd",
|
||||
amount: 0,
|
||||
exponent: 2
|
||||
}
|
||||
],
|
||||
"736345864146255982": [
|
||||
{
|
||||
"currency": "usd",
|
||||
"amount": 0,
|
||||
"exponent": 2
|
||||
currency: "usd",
|
||||
amount: 0,
|
||||
exponent: 2
|
||||
}
|
||||
],
|
||||
"683074999590060249": [
|
||||
{
|
||||
"currency": "usd",
|
||||
"amount": 0,
|
||||
"exponent": 2
|
||||
currency: "usd",
|
||||
amount: 0,
|
||||
exponent: 2
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"1": {
|
||||
"country_prices": {
|
||||
"country_code": "US",
|
||||
"prices": [
|
||||
country_prices: {
|
||||
country_code: "US",
|
||||
prices: [
|
||||
{
|
||||
"currency": "usd",
|
||||
"amount": 0,
|
||||
"exponent": 2
|
||||
currency: "usd",
|
||||
amount: 0,
|
||||
exponent: 2
|
||||
}
|
||||
]
|
||||
},
|
||||
"payment_source_prices": {
|
||||
payment_source_prices: {
|
||||
"775487223059316758": [
|
||||
{
|
||||
"currency": "usd",
|
||||
"amount": 0,
|
||||
"exponent": 2
|
||||
currency: "usd",
|
||||
amount: 0,
|
||||
exponent: 2
|
||||
}
|
||||
],
|
||||
"736345864146255982": [
|
||||
{
|
||||
"currency": "usd",
|
||||
"amount": 0,
|
||||
"exponent": 2
|
||||
currency: "usd",
|
||||
amount: 0,
|
||||
exponent: 2
|
||||
}
|
||||
],
|
||||
"683074999590060249": [
|
||||
{
|
||||
"currency": "usd",
|
||||
"amount": 0,
|
||||
"exponent": 2
|
||||
currency: "usd",
|
||||
amount: 0,
|
||||
exponent: 2
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@ export * from "./handlers/Message";
|
||||
export * from "./handlers/route";
|
||||
export * from "./handlers/Voice";
|
||||
export * from "./utility/Base64";
|
||||
export * from "./utility/captcha";
|
||||
export * from "./utility/ipAddress";
|
||||
export * from "./utility/passwordStrength";
|
||||
export * from "./utility/RandomInviteID";
|
||||
export * from "./utility/String";
|
||||
export * from "./utility/captcha";
|
||||
@@ -7,8 +7,8 @@ export interface hcaptchaResponse {
|
||||
hostname: string;
|
||||
credit: boolean;
|
||||
"error-codes": string[];
|
||||
score: number; // enterprise only
|
||||
score_reason: string[]; // enterprise only
|
||||
score: number; // enterprise only
|
||||
score_reason: string[]; // enterprise only
|
||||
}
|
||||
|
||||
export interface recaptchaResponse {
|
||||
@@ -22,8 +22,8 @@ export interface recaptchaResponse {
|
||||
|
||||
const verifyEndpoints = {
|
||||
hcaptcha: "https://hcaptcha.com/siteverify",
|
||||
recaptcha: "https://www.google.com/recaptcha/api/siteverify",
|
||||
}
|
||||
recaptcha: "https://www.google.com/recaptcha/api/siteverify"
|
||||
};
|
||||
|
||||
export async function verifyCaptcha(response: string, ip?: string) {
|
||||
const { security } = Config.get();
|
||||
@@ -34,13 +34,14 @@ export async function verifyCaptcha(response: string, ip?: string) {
|
||||
const res = await fetch(verifyEndpoints[service], {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
"Content-Type": "application/x-www-form-urlencoded"
|
||||
},
|
||||
body: `response=${encodeURIComponent(response)}`
|
||||
+ `&secret=${encodeURIComponent(secret!)}`
|
||||
+ `&sitekey=${encodeURIComponent(sitekey!)}`
|
||||
+ (ip ? `&remoteip=${encodeURIComponent(ip!)}` : ""),
|
||||
body:
|
||||
`response=${encodeURIComponent(response)}` +
|
||||
`&secret=${encodeURIComponent(secret!)}` +
|
||||
`&sitekey=${encodeURIComponent(sitekey!)}` +
|
||||
(ip ? `&remoteip=${encodeURIComponent(ip!)}` : "")
|
||||
});
|
||||
|
||||
return await res.json() as hcaptchaResponse | recaptchaResponse;
|
||||
}
|
||||
return (await res.json()) as hcaptchaResponse | recaptchaResponse;
|
||||
}
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class test1661273147273 implements MigrationInterface {
|
||||
name = 'test1661273147273'
|
||||
name = "test1661273147273";
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE \`invites\` DROP FOREIGN KEY \`FK_15c35422032e0b22b4ada95f48f\`
|
||||
`);
|
||||
await queryRunner.query(`
|
||||
await queryRunner.query(`
|
||||
DROP INDEX \`IDX_2ce5a55796fe4c2f77ece57a64\` ON \`applications\`
|
||||
`);
|
||||
await queryRunner.query(`
|
||||
await queryRunner.query(`
|
||||
CREATE TABLE \`plugin_config\` (
|
||||
\`key\` varchar(255) NOT NULL,
|
||||
\`value\` text NULL,
|
||||
PRIMARY KEY (\`key\`)
|
||||
) ENGINE = InnoDB
|
||||
`);
|
||||
await queryRunner.query(`
|
||||
await queryRunner.query(`
|
||||
CREATE TABLE \`user_settings\` (
|
||||
\`id\` varchar(255) NOT NULL,
|
||||
\`afk_timeout\` int NULL,
|
||||
@@ -54,96 +54,95 @@ export class test1661273147273 implements MigrationInterface {
|
||||
PRIMARY KEY (\`id\`)
|
||||
) ENGINE = InnoDB
|
||||
`);
|
||||
await queryRunner.query(`
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE \`users\` DROP COLUMN \`settings\`
|
||||
`);
|
||||
await queryRunner.query(`
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE \`users\`
|
||||
ADD \`settingsId\` varchar(255) NULL
|
||||
`);
|
||||
await queryRunner.query(`
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE \`users\`
|
||||
ADD UNIQUE INDEX \`IDX_76ba283779c8441fd5ff819c8c\` (\`settingsId\`)
|
||||
`);
|
||||
await queryRunner.query(`
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE \`channels\`
|
||||
ADD \`flags\` int NULL
|
||||
`);
|
||||
await queryRunner.query(`
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE \`channels\`
|
||||
ADD \`default_thread_rate_limit_per_user\` int NULL
|
||||
`);
|
||||
await queryRunner.query(`
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE \`guilds\`
|
||||
ADD \`premium_progress_bar_enabled\` tinyint NULL
|
||||
`);
|
||||
await queryRunner.query(`
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE \`users\` CHANGE \`bio\` \`bio\` varchar(255) NULL
|
||||
`);
|
||||
await queryRunner.query(`
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE \`users\` CHANGE \`mfa_enabled\` \`mfa_enabled\` tinyint NULL
|
||||
`);
|
||||
await queryRunner.query(`
|
||||
await queryRunner.query(`
|
||||
CREATE UNIQUE INDEX \`REL_76ba283779c8441fd5ff819c8c\` ON \`users\` (\`settingsId\`)
|
||||
`);
|
||||
await queryRunner.query(`
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE \`users\`
|
||||
ADD CONSTRAINT \`FK_76ba283779c8441fd5ff819c8cf\` FOREIGN KEY (\`settingsId\`) REFERENCES \`user_settings\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION
|
||||
`);
|
||||
await queryRunner.query(`
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE \`invites\`
|
||||
ADD CONSTRAINT \`FK_15c35422032e0b22b4ada95f48f\` FOREIGN KEY (\`inviter_id\`) REFERENCES \`users\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION
|
||||
`);
|
||||
}
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE \`invites\` DROP FOREIGN KEY \`FK_15c35422032e0b22b4ada95f48f\`
|
||||
`);
|
||||
await queryRunner.query(`
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE \`users\` DROP FOREIGN KEY \`FK_76ba283779c8441fd5ff819c8cf\`
|
||||
`);
|
||||
await queryRunner.query(`
|
||||
await queryRunner.query(`
|
||||
DROP INDEX \`REL_76ba283779c8441fd5ff819c8c\` ON \`users\`
|
||||
`);
|
||||
await queryRunner.query(`
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE \`users\` CHANGE \`mfa_enabled\` \`mfa_enabled\` tinyint NOT NULL
|
||||
`);
|
||||
await queryRunner.query(`
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE \`users\` CHANGE \`bio\` \`bio\` varchar(255) NOT NULL
|
||||
`);
|
||||
await queryRunner.query(`
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE \`guilds\` DROP COLUMN \`premium_progress_bar_enabled\`
|
||||
`);
|
||||
await queryRunner.query(`
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE \`channels\` DROP COLUMN \`default_thread_rate_limit_per_user\`
|
||||
`);
|
||||
await queryRunner.query(`
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE \`channels\` DROP COLUMN \`flags\`
|
||||
`);
|
||||
await queryRunner.query(`
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE \`users\` DROP INDEX \`IDX_76ba283779c8441fd5ff819c8c\`
|
||||
`);
|
||||
await queryRunner.query(`
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE \`users\` DROP COLUMN \`settingsId\`
|
||||
`);
|
||||
await queryRunner.query(`
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE \`users\`
|
||||
ADD \`settings\` text NOT NULL
|
||||
`);
|
||||
await queryRunner.query(`
|
||||
await queryRunner.query(`
|
||||
DROP TABLE \`user_settings\`
|
||||
`);
|
||||
await queryRunner.query(`
|
||||
await queryRunner.query(`
|
||||
DROP TABLE \`plugin_config\`
|
||||
`);
|
||||
await queryRunner.query(`
|
||||
await queryRunner.query(`
|
||||
CREATE UNIQUE INDEX \`IDX_2ce5a55796fe4c2f77ece57a64\` ON \`applications\` (\`bot_user_id\`)
|
||||
`);
|
||||
await queryRunner.query(`
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE \`invites\`
|
||||
ADD CONSTRAINT \`FK_15c35422032e0b22b4ada95f48f\` FOREIGN KEY (\`inviter_id\`) REFERENCES \`users\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION
|
||||
`);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class test21661273179287 implements MigrationInterface {
|
||||
name = 'test21661273179287'
|
||||
name = "test21661273179287";
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`
|
||||
DROP INDEX \`IDX_76ba283779c8441fd5ff819c8c\` ON \`users\`
|
||||
`);
|
||||
}
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`
|
||||
CREATE UNIQUE INDEX \`IDX_76ba283779c8441fd5ff819c8c\` ON \`users\` (\`settingsId\`)
|
||||
`);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ function getDataSourceOptions(): DataSourceOptions {
|
||||
name: "default",
|
||||
migrations: synchronizeInsteadOfMigrations ? [] : [path.join(__dirname, "..", "migrations", type, "*.js")],
|
||||
migrationsRun: !synchronizeInsteadOfMigrations,
|
||||
applicationName: `Fosscord Server`,
|
||||
applicationName: `Fosscord Server`
|
||||
} as DataSourceOptions;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user