Moved from mongodb to sql and sqlite

This commit is contained in:
2024-04-09 21:59:52 +02:00
parent 27b01d0c36
commit ef5c531964
42 changed files with 1645 additions and 198 deletions

View File

@@ -1,9 +0,0 @@
import { Schema, model } from "mongoose"
const guildAppSchema = new Schema({
_id: Schema.Types.ObjectId,
userID: { type: String, required: true },
uuid: { type: String, required: true }
})
export = model("guildapp", guildAppSchema, "guildapp")

View File

@@ -0,0 +1,20 @@
import Sequelize, { InferAttributes, InferCreationAttributes, Model } from "sequelize"
import { sequelize } from "utils/Illegitimate"
interface GuildApp extends Model<InferAttributes<GuildApp>, InferCreationAttributes<GuildApp>> {
userID: string
uuid: string
}
const tag = sequelize.define<GuildApp>("guildApp", {
userID: {
type: Sequelize.STRING,
allowNull: false
},
uuid: {
type: Sequelize.STRING,
allowNull: false
}
})
export default tag

View File

@@ -1,9 +0,0 @@
import { Schema, model } from "mongoose"
const settingsSchema = new Schema({
_id: Schema.Types.ObjectId,
name: { type: String, required: true },
value: { type: String, required: true }
})
export = model("settings", settingsSchema, "settings")

View File

@@ -0,0 +1,20 @@
import Sequelize, { InferAttributes, InferCreationAttributes, Model } from "sequelize"
import { sequelize } from "utils/Illegitimate"
interface Settings extends Model<InferAttributes<Settings>, InferCreationAttributes<Settings>> {
name: string
value: string
}
const tag = sequelize.define<Settings>("settings", {
name: {
type: Sequelize.STRING,
allowNull: false
},
value: {
type: Sequelize.STRING,
allowNull: false
}
})
export default tag

View File

@@ -1,9 +0,0 @@
import { Schema, model } from "mongoose"
const staffAppSchema = new Schema({
_id: Schema.Types.ObjectId,
userID: { type: String, required: true },
uuid: { type: String, required: true }
})
export = model("staffapp", staffAppSchema, "staffapp")

View File

@@ -0,0 +1,20 @@
import Sequelize, { InferAttributes, InferCreationAttributes, Model } from "sequelize"
import { sequelize } from "utils/Illegitimate"
interface StaffApp extends Model<InferAttributes<StaffApp>, InferCreationAttributes<StaffApp>> {
userID: string
uuid: string
}
const tag = sequelize.define<StaffApp>("staffApp", {
userID: {
type: Sequelize.STRING,
allowNull: false
},
uuid: {
type: Sequelize.STRING,
allowNull: false
}
})
export default tag

View File

@@ -1,9 +0,0 @@
import { Schema, model } from "mongoose"
const verifySchema = new Schema({
_id: Schema.Types.ObjectId,
userID: { type: String, required: true },
uuid: { type: String, required: true }
})
export = model("verify", verifySchema, "verify")

20
src/schemas/verifyTag.ts Normal file
View File

@@ -0,0 +1,20 @@
import Sequelize, { InferAttributes, InferCreationAttributes, Model } from "sequelize"
import { sequelize } from "utils/Illegitimate"
interface Verify extends Model<InferAttributes<Verify>, InferCreationAttributes<Verify>> {
userID: string
uuid: string
}
const tag = sequelize.define<Verify>("verify", {
userID: {
type: Sequelize.STRING,
allowNull: false
},
uuid: {
type: Sequelize.STRING,
allowNull: false
}
})
export default tag

View File

@@ -1,10 +0,0 @@
import { Schema, model } from "mongoose"
const waitinglistSchema = new Schema({
_id: Schema.Types.ObjectId,
userID: { type: String, required: true },
uuid: { type: String, required: true },
timestamp: { type: Number, required: true }
})
export = model("waitinglist", waitinglistSchema, "waitinglist")

View File

@@ -0,0 +1,25 @@
import Sequelize, { InferAttributes, InferCreationAttributes, Model } from "sequelize"
import { sequelize } from "utils/Illegitimate"
interface WaitingList extends Model<InferAttributes<WaitingList>, InferCreationAttributes<WaitingList>> {
userID: string;
uuid: string;
timestamp: number;
}
const tag = sequelize.define<WaitingList>("waitingList", {
userID: {
type: Sequelize.STRING,
allowNull: false
},
uuid: {
type: Sequelize.STRING,
allowNull: false
},
timestamp: {
type: Sequelize.INTEGER,
allowNull: false
}
})
export default tag