19 lines
582 B
TypeScript
19 lines
582 B
TypeScript
import { Schema, model } from "mongoose";
|
|
|
|
export interface IServerVersion {
|
|
serverKey: string;
|
|
branch: string;
|
|
version: string;
|
|
updateDate: Date;
|
|
}
|
|
|
|
export const ServerVersion = new Schema<IServerVersion>({
|
|
serverKey: { type: String, required: true },
|
|
branch: { type: String, required: true },
|
|
version: { type: String, required: true },
|
|
updateDate: { type: Date, required: true },
|
|
}, { autoIndex: false, autoCreate: false, })
|
|
.index({ serverKey: 1 }, { unique: true })
|
|
;
|
|
|
|
export default model<IServerVersion>('ServerVersion', ServerVersion); |