mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 21:23:45 +01:00
25 lines
936 B
JavaScript
25 lines
936 B
JavaScript
import mongoose from "../../../../app/src/infrastructure/Mongoose.mjs"
|
|
|
|
const { Schema } = mongoose
|
|
const { ObjectId } = Schema
|
|
|
|
export const GitHubSyncProjectStatesSchema = new Schema(
|
|
{
|
|
projectId: { type: ObjectId, ref: 'Project', required: true, unique: true },
|
|
repoFullName: { type: String, required: true },
|
|
defaultBranchName: { type: String, default: null },
|
|
mergeStatus: { type: String, enum: ['clean', 'conflict', 'diverged'], default: 'clean' },
|
|
lastSyncCommit: { type: String, default: null },
|
|
lastSyncVersion: { type: Number, default: null },
|
|
unmergedBranchName: { type: String, default: null },
|
|
unmergedBranchHead: { type: String, default: null },
|
|
conflictVersion: { type: Number, default: null },
|
|
},
|
|
{ collection: 'githubSyncProjectStates', minimize: false }
|
|
)
|
|
|
|
export const GitHubSyncProjectStates = mongoose.model(
|
|
'GitHubSyncProjectStates',
|
|
GitHubSyncProjectStatesSchema,
|
|
)
|