506 lines
112 KiB
JavaScript
506 lines
112 KiB
JavaScript
|
|
|
|||
|
|
/* !!! This is code generated by Prisma. Do not edit directly. !!!
|
|||
|
|
/* eslint-disable */
|
|||
|
|
|
|||
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|||
|
|
|
|||
|
|
const {
|
|||
|
|
PrismaClientKnownRequestError,
|
|||
|
|
PrismaClientUnknownRequestError,
|
|||
|
|
PrismaClientRustPanicError,
|
|||
|
|
PrismaClientInitializationError,
|
|||
|
|
PrismaClientValidationError,
|
|||
|
|
getPrismaClient,
|
|||
|
|
sqltag,
|
|||
|
|
empty,
|
|||
|
|
join,
|
|||
|
|
raw,
|
|||
|
|
skip,
|
|||
|
|
Decimal,
|
|||
|
|
Debug,
|
|||
|
|
objectEnumValues,
|
|||
|
|
makeStrictEnum,
|
|||
|
|
Extensions,
|
|||
|
|
warnOnce,
|
|||
|
|
defineDmmfProperty,
|
|||
|
|
Public,
|
|||
|
|
getRuntime,
|
|||
|
|
createParam,
|
|||
|
|
} = require('./runtime/edge.js')
|
|||
|
|
|
|||
|
|
|
|||
|
|
const Prisma = {}
|
|||
|
|
|
|||
|
|
exports.Prisma = Prisma
|
|||
|
|
exports.$Enums = {}
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* Prisma Client JS version: 6.12.0
|
|||
|
|
* Query Engine version: 8047c96bbd92db98a2abc7c9323ce77c02c89dbc
|
|||
|
|
*/
|
|||
|
|
Prisma.prismaVersion = {
|
|||
|
|
client: "6.12.0",
|
|||
|
|
engine: "8047c96bbd92db98a2abc7c9323ce77c02c89dbc"
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
Prisma.PrismaClientKnownRequestError = PrismaClientKnownRequestError;
|
|||
|
|
Prisma.PrismaClientUnknownRequestError = PrismaClientUnknownRequestError
|
|||
|
|
Prisma.PrismaClientRustPanicError = PrismaClientRustPanicError
|
|||
|
|
Prisma.PrismaClientInitializationError = PrismaClientInitializationError
|
|||
|
|
Prisma.PrismaClientValidationError = PrismaClientValidationError
|
|||
|
|
Prisma.Decimal = Decimal
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* Re-export of sql-template-tag
|
|||
|
|
*/
|
|||
|
|
Prisma.sql = sqltag
|
|||
|
|
Prisma.empty = empty
|
|||
|
|
Prisma.join = join
|
|||
|
|
Prisma.raw = raw
|
|||
|
|
Prisma.validator = Public.validator
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* Extensions
|
|||
|
|
*/
|
|||
|
|
Prisma.getExtensionContext = Extensions.getExtensionContext
|
|||
|
|
Prisma.defineExtension = Extensions.defineExtension
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* Shorthand utilities for JSON filtering
|
|||
|
|
*/
|
|||
|
|
Prisma.DbNull = objectEnumValues.instances.DbNull
|
|||
|
|
Prisma.JsonNull = objectEnumValues.instances.JsonNull
|
|||
|
|
Prisma.AnyNull = objectEnumValues.instances.AnyNull
|
|||
|
|
|
|||
|
|
Prisma.NullTypes = {
|
|||
|
|
DbNull: objectEnumValues.classes.DbNull,
|
|||
|
|
JsonNull: objectEnumValues.classes.JsonNull,
|
|||
|
|
AnyNull: objectEnumValues.classes.AnyNull
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* Enums
|
|||
|
|
*/
|
|||
|
|
exports.Prisma.TransactionIsolationLevel = makeStrictEnum({
|
|||
|
|
ReadUncommitted: 'ReadUncommitted',
|
|||
|
|
ReadCommitted: 'ReadCommitted',
|
|||
|
|
RepeatableRead: 'RepeatableRead',
|
|||
|
|
Serializable: 'Serializable'
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
exports.Prisma.UserScalarFieldEnum = {
|
|||
|
|
id: 'id',
|
|||
|
|
name: 'name',
|
|||
|
|
username: 'username',
|
|||
|
|
displayUsername: 'displayUsername',
|
|||
|
|
email: 'email',
|
|||
|
|
emailVerified: 'emailVerified',
|
|||
|
|
image: 'image',
|
|||
|
|
createdAt: 'createdAt',
|
|||
|
|
updatedAt: 'updatedAt',
|
|||
|
|
password: 'password',
|
|||
|
|
deletedAt: 'deletedAt',
|
|||
|
|
organizationId: 'organizationId',
|
|||
|
|
metadata: 'metadata'
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
exports.Prisma.OrganizationScalarFieldEnum = {
|
|||
|
|
id: 'id',
|
|||
|
|
name: 'name',
|
|||
|
|
slug: 'slug',
|
|||
|
|
description: 'description',
|
|||
|
|
logo: 'logo',
|
|||
|
|
parentId: 'parentId',
|
|||
|
|
path: 'path',
|
|||
|
|
level: 'level',
|
|||
|
|
order: 'order',
|
|||
|
|
createdAt: 'createdAt',
|
|||
|
|
updatedAt: 'updatedAt',
|
|||
|
|
deletedAt: 'deletedAt',
|
|||
|
|
metadata: 'metadata'
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
exports.Prisma.PostScalarFieldEnum = {
|
|||
|
|
id: 'id',
|
|||
|
|
type: 'type',
|
|||
|
|
title: 'title',
|
|||
|
|
content: 'content',
|
|||
|
|
excerpt: 'excerpt',
|
|||
|
|
parentId: 'parentId',
|
|||
|
|
path: 'path',
|
|||
|
|
level: 'level',
|
|||
|
|
order: 'order',
|
|||
|
|
status: 'status',
|
|||
|
|
publishedAt: 'publishedAt',
|
|||
|
|
visibility: 'visibility',
|
|||
|
|
viewCount: 'viewCount',
|
|||
|
|
likeCount: 'likeCount',
|
|||
|
|
startCount: 'startCount',
|
|||
|
|
commentCount: 'commentCount',
|
|||
|
|
authorId: 'authorId',
|
|||
|
|
organizationId: 'organizationId',
|
|||
|
|
createdAt: 'createdAt',
|
|||
|
|
updatedAt: 'updatedAt',
|
|||
|
|
deletedAt: 'deletedAt',
|
|||
|
|
metadata: 'metadata'
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
exports.Prisma.TaxonomyScalarFieldEnum = {
|
|||
|
|
id: 'id',
|
|||
|
|
name: 'name',
|
|||
|
|
slug: 'slug',
|
|||
|
|
description: 'description',
|
|||
|
|
postTypes: 'postTypes',
|
|||
|
|
createdAt: 'createdAt',
|
|||
|
|
updatedAt: 'updatedAt',
|
|||
|
|
deletedAt: 'deletedAt'
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
exports.Prisma.TermScalarFieldEnum = {
|
|||
|
|
id: 'id',
|
|||
|
|
name: 'name',
|
|||
|
|
slug: 'slug',
|
|||
|
|
description: 'description',
|
|||
|
|
parentId: 'parentId',
|
|||
|
|
path: 'path',
|
|||
|
|
level: 'level',
|
|||
|
|
order: 'order',
|
|||
|
|
taxonomyId: 'taxonomyId',
|
|||
|
|
createdAt: 'createdAt',
|
|||
|
|
updatedAt: 'updatedAt',
|
|||
|
|
deletedAt: 'deletedAt'
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
exports.Prisma.RoleScalarFieldEnum = {
|
|||
|
|
id: 'id',
|
|||
|
|
name: 'name',
|
|||
|
|
slug: 'slug',
|
|||
|
|
description: 'description',
|
|||
|
|
permissions: 'permissions',
|
|||
|
|
isSystem: 'isSystem',
|
|||
|
|
isActive: 'isActive',
|
|||
|
|
createdAt: 'createdAt',
|
|||
|
|
updatedAt: 'updatedAt'
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
exports.Prisma.UserActionScalarFieldEnum = {
|
|||
|
|
id: 'id',
|
|||
|
|
userId: 'userId',
|
|||
|
|
postId: 'postId',
|
|||
|
|
type: 'type',
|
|||
|
|
description: 'description',
|
|||
|
|
metadata: 'metadata',
|
|||
|
|
ipAddress: 'ipAddress',
|
|||
|
|
userAgent: 'userAgent',
|
|||
|
|
createdAt: 'createdAt',
|
|||
|
|
updatedAt: 'updatedAt'
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
exports.Prisma.SystemConfigScalarFieldEnum = {
|
|||
|
|
id: 'id',
|
|||
|
|
key: 'key',
|
|||
|
|
value: 'value',
|
|||
|
|
type: 'type',
|
|||
|
|
description: 'description',
|
|||
|
|
group: 'group',
|
|||
|
|
isPublic: 'isPublic',
|
|||
|
|
createdAt: 'createdAt',
|
|||
|
|
updatedAt: 'updatedAt'
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
exports.Prisma.ProfileScalarFieldEnum = {
|
|||
|
|
id: 'id',
|
|||
|
|
name: 'name',
|
|||
|
|
gender: 'gender',
|
|||
|
|
idNum: 'idNum',
|
|||
|
|
paperId: 'paperId',
|
|||
|
|
avatar: 'avatar',
|
|||
|
|
command: 'command',
|
|||
|
|
birthday: 'birthday',
|
|||
|
|
hireDate: 'hireDate',
|
|||
|
|
relativeHireDate: 'relativeHireDate',
|
|||
|
|
identity: 'identity',
|
|||
|
|
level: 'level',
|
|||
|
|
levelDate: 'levelDate',
|
|||
|
|
dutyCode: 'dutyCode',
|
|||
|
|
dutyLevel: 'dutyLevel',
|
|||
|
|
dutyName: 'dutyName',
|
|||
|
|
organizationId: 'organizationId',
|
|||
|
|
metadata: 'metadata',
|
|||
|
|
createdAt: 'createdAt',
|
|||
|
|
updatedAt: 'updatedAt',
|
|||
|
|
deletedAt: 'deletedAt'
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
exports.Prisma.ResourceScalarFieldEnum = {
|
|||
|
|
id: 'id',
|
|||
|
|
title: 'title',
|
|||
|
|
description: 'description',
|
|||
|
|
type: 'type',
|
|||
|
|
fileId: 'fileId',
|
|||
|
|
url: 'url',
|
|||
|
|
meta: 'meta',
|
|||
|
|
status: 'status',
|
|||
|
|
createdAt: 'createdAt',
|
|||
|
|
updatedAt: 'updatedAt',
|
|||
|
|
createdBy: 'createdBy',
|
|||
|
|
updatedBy: 'updatedBy',
|
|||
|
|
deletedAt: 'deletedAt',
|
|||
|
|
isPublic: 'isPublic',
|
|||
|
|
ownerId: 'ownerId'
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
exports.Prisma.MemberScalarFieldEnum = {
|
|||
|
|
id: 'id',
|
|||
|
|
userId: 'userId',
|
|||
|
|
organizationId: 'organizationId',
|
|||
|
|
role: 'role',
|
|||
|
|
createdAt: 'createdAt'
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
exports.Prisma.TeamScalarFieldEnum = {
|
|||
|
|
id: 'id',
|
|||
|
|
name: 'name',
|
|||
|
|
organizationId: 'organizationId',
|
|||
|
|
createdAt: 'createdAt',
|
|||
|
|
updatedAt: 'updatedAt'
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
exports.Prisma.TeamMemberScalarFieldEnum = {
|
|||
|
|
id: 'id',
|
|||
|
|
teamId: 'teamId',
|
|||
|
|
userId: 'userId',
|
|||
|
|
createdAt: 'createdAt'
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
exports.Prisma.InvitationScalarFieldEnum = {
|
|||
|
|
id: 'id',
|
|||
|
|
email: 'email',
|
|||
|
|
inviterId: 'inviterId',
|
|||
|
|
organizationId: 'organizationId',
|
|||
|
|
teamId: 'teamId',
|
|||
|
|
role: 'role',
|
|||
|
|
status: 'status',
|
|||
|
|
expiresAt: 'expiresAt',
|
|||
|
|
createdAt: 'createdAt'
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
exports.Prisma.SessionScalarFieldEnum = {
|
|||
|
|
id: 'id',
|
|||
|
|
expiresAt: 'expiresAt',
|
|||
|
|
token: 'token',
|
|||
|
|
createdAt: 'createdAt',
|
|||
|
|
updatedAt: 'updatedAt',
|
|||
|
|
ipAddress: 'ipAddress',
|
|||
|
|
userAgent: 'userAgent',
|
|||
|
|
userId: 'userId',
|
|||
|
|
activeOrganizationId: 'activeOrganizationId',
|
|||
|
|
activeTeamId: 'activeTeamId'
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
exports.Prisma.AccountScalarFieldEnum = {
|
|||
|
|
id: 'id',
|
|||
|
|
accountId: 'accountId',
|
|||
|
|
providerId: 'providerId',
|
|||
|
|
userId: 'userId',
|
|||
|
|
idToken: 'idToken',
|
|||
|
|
accessToken: 'accessToken',
|
|||
|
|
refreshToken: 'refreshToken',
|
|||
|
|
accessTokenExpiresAt: 'accessTokenExpiresAt',
|
|||
|
|
refreshTokenExpiresAt: 'refreshTokenExpiresAt',
|
|||
|
|
scope: 'scope',
|
|||
|
|
password: 'password',
|
|||
|
|
createdAt: 'createdAt',
|
|||
|
|
updatedAt: 'updatedAt'
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
exports.Prisma.VerificationScalarFieldEnum = {
|
|||
|
|
id: 'id',
|
|||
|
|
identifier: 'identifier',
|
|||
|
|
value: 'value',
|
|||
|
|
expiresAt: 'expiresAt',
|
|||
|
|
createdAt: 'createdAt',
|
|||
|
|
updatedAt: 'updatedAt'
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
exports.Prisma.OauthApplicationScalarFieldEnum = {
|
|||
|
|
id: 'id',
|
|||
|
|
clientId: 'clientId',
|
|||
|
|
clientSecret: 'clientSecret',
|
|||
|
|
name: 'name',
|
|||
|
|
redirectURLs: 'redirectURLs',
|
|||
|
|
metadata: 'metadata',
|
|||
|
|
type: 'type',
|
|||
|
|
disabled: 'disabled',
|
|||
|
|
userId: 'userId',
|
|||
|
|
createdAt: 'createdAt',
|
|||
|
|
updatedAt: 'updatedAt'
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
exports.Prisma.OauthAccessTokenScalarFieldEnum = {
|
|||
|
|
id: 'id',
|
|||
|
|
accessToken: 'accessToken',
|
|||
|
|
refreshToken: 'refreshToken',
|
|||
|
|
accessTokenExpiresAt: 'accessTokenExpiresAt',
|
|||
|
|
refreshTokenExpiresAt: 'refreshTokenExpiresAt',
|
|||
|
|
clientId: 'clientId',
|
|||
|
|
userId: 'userId',
|
|||
|
|
scopes: 'scopes',
|
|||
|
|
createdAt: 'createdAt',
|
|||
|
|
updatedAt: 'updatedAt'
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
exports.Prisma.OauthConsentScalarFieldEnum = {
|
|||
|
|
id: 'id',
|
|||
|
|
userId: 'userId',
|
|||
|
|
clientId: 'clientId',
|
|||
|
|
scopes: 'scopes',
|
|||
|
|
consentGiven: 'consentGiven',
|
|||
|
|
createdAt: 'createdAt',
|
|||
|
|
updatedAt: 'updatedAt'
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
exports.Prisma.SsoProviderScalarFieldEnum = {
|
|||
|
|
id: 'id',
|
|||
|
|
issuer: 'issuer',
|
|||
|
|
domain: 'domain',
|
|||
|
|
oidcConfig: 'oidcConfig',
|
|||
|
|
samlConfig: 'samlConfig',
|
|||
|
|
userId: 'userId',
|
|||
|
|
providerId: 'providerId',
|
|||
|
|
organizationId: 'organizationId',
|
|||
|
|
createdAt: 'createdAt',
|
|||
|
|
updatedAt: 'updatedAt'
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
exports.Prisma.SortOrder = {
|
|||
|
|
asc: 'asc',
|
|||
|
|
desc: 'desc'
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
exports.Prisma.NullableJsonNullValueInput = {
|
|||
|
|
DbNull: Prisma.DbNull,
|
|||
|
|
JsonNull: Prisma.JsonNull
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
exports.Prisma.QueryMode = {
|
|||
|
|
default: 'default',
|
|||
|
|
insensitive: 'insensitive'
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
exports.Prisma.JsonNullValueFilter = {
|
|||
|
|
DbNull: Prisma.DbNull,
|
|||
|
|
JsonNull: Prisma.JsonNull,
|
|||
|
|
AnyNull: Prisma.AnyNull
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
exports.Prisma.NullsOrder = {
|
|||
|
|
first: 'first',
|
|||
|
|
last: 'last'
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
|
|||
|
|
exports.Prisma.ModelName = {
|
|||
|
|
User: 'User',
|
|||
|
|
Organization: 'Organization',
|
|||
|
|
Post: 'Post',
|
|||
|
|
Taxonomy: 'Taxonomy',
|
|||
|
|
Term: 'Term',
|
|||
|
|
Role: 'Role',
|
|||
|
|
UserAction: 'UserAction',
|
|||
|
|
SystemConfig: 'SystemConfig',
|
|||
|
|
Profile: 'Profile',
|
|||
|
|
Resource: 'Resource',
|
|||
|
|
Member: 'Member',
|
|||
|
|
Team: 'Team',
|
|||
|
|
TeamMember: 'TeamMember',
|
|||
|
|
Invitation: 'Invitation',
|
|||
|
|
Session: 'Session',
|
|||
|
|
Account: 'Account',
|
|||
|
|
Verification: 'Verification',
|
|||
|
|
oauthApplication: 'oauthApplication',
|
|||
|
|
oauthAccessToken: 'oauthAccessToken',
|
|||
|
|
oauthConsent: 'oauthConsent',
|
|||
|
|
ssoProvider: 'ssoProvider'
|
|||
|
|
};
|
|||
|
|
/**
|
|||
|
|
* Create the Client
|
|||
|
|
*/
|
|||
|
|
const config = {
|
|||
|
|
"generator": {
|
|||
|
|
"name": "client",
|
|||
|
|
"provider": {
|
|||
|
|
"fromEnvVar": null,
|
|||
|
|
"value": "prisma-client-js"
|
|||
|
|
},
|
|||
|
|
"output": {
|
|||
|
|
"value": "/opt/projects/nice/apps/fenghuo/db/generated/prisma",
|
|||
|
|
"fromEnvVar": null
|
|||
|
|
},
|
|||
|
|
"config": {
|
|||
|
|
"engineType": "library"
|
|||
|
|
},
|
|||
|
|
"binaryTargets": [
|
|||
|
|
{
|
|||
|
|
"fromEnvVar": null,
|
|||
|
|
"value": "debian-openssl-3.0.x",
|
|||
|
|
"native": true
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"fromEnvVar": null,
|
|||
|
|
"value": "debian-openssl-3.0.x"
|
|||
|
|
}
|
|||
|
|
],
|
|||
|
|
"previewFeatures": [],
|
|||
|
|
"sourceFilePath": "/opt/projects/nice/apps/fenghuo/db/prisma/schema.prisma",
|
|||
|
|
"isCustomOutput": true
|
|||
|
|
},
|
|||
|
|
"relativeEnvPaths": {
|
|||
|
|
"rootEnvPath": null,
|
|||
|
|
"schemaEnvPath": "../../.env"
|
|||
|
|
},
|
|||
|
|
"relativePath": "../../prisma",
|
|||
|
|
"clientVersion": "6.12.0",
|
|||
|
|
"engineVersion": "8047c96bbd92db98a2abc7c9323ce77c02c89dbc",
|
|||
|
|
"datasourceNames": [
|
|||
|
|
"db"
|
|||
|
|
],
|
|||
|
|
"activeProvider": "postgresql",
|
|||
|
|
"inlineDatasources": {
|
|||
|
|
"db": {
|
|||
|
|
"url": {
|
|||
|
|
"fromEnvVar": "DATABASE_URL",
|
|||
|
|
"value": null
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
"inlineSchema": "generator client {\n provider = \"prisma-client-js\"\n binaryTargets = [\"native\", \"debian-openssl-3.0.x\"]\n output = \"../generated/prisma\"\n}\n\ndatasource db {\n provider = \"postgres\"\n url = env(\"DATABASE_URL\")\n}\n\nmodel User {\n id String @id @default(cuid())\n name String\n username String? @unique\n displayUsername String? @map(\"display_username\")\n email String @unique\n emailVerified Boolean @default(false)\n image String?\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n password String?\n\n deletedAt DateTime?\n\n // 关联关系\n organizationId String? @map(\"organization_id\")\n organization Organization? @relation(fields: [organizationId], references: [id])\n posts Post[]\n userActions UserAction[]\n roles Role[]\n resources Resource[] @relation(\"UserResources\")\n\n // 团队和组织关联\n members Member[] @relation(\"UserMembers\")\n teamMembers TeamMember[] @relation(\"UserTeamMembers\")\n invitations Invitation[] @relation(\"UserInvitations\")\n\n // Better Auth 关联关系\n sessions Session[]\n accounts Account[]\n\n oauthAccessTokens oauthAccessToken[] @relation(\"UserOAuthAccessTokens\")\n oauthConsents oauthConsent[] @relation(\"UserOAuthConsents\")\n\n // SSO Provider 关联关系\n ssoProviders ssoProvider[] @relation(\"UserSsoProviders\")\n\n metadata Json?\n\n @@index([organizationId, deletedAt]) // 优化组织用户查询\n @@map(\"users\")\n}\n\n// 支持树形结构的组织模型\nmodel Organization {\n id String @id @default(cuid())\n name String\n slug String? @unique // URL友好的标识符\n description String?\n logo String?\n // 树形结构字段\n parentId String? @map(\"parent_id\")\n parent Organization? @relation(\"OrganizationHierarchy\", fields: [parentId], references: [id])\n children Organization[] @relation(\"OrganizationHierarchy\")\n\n // 路径字段,用于快速查询整个路径 (例如: \"1.2.3\")\n path String?\n level Int @default(0) // 层级深度\n order Float @default(0) // 同级排序\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n deletedAt DateTime?\n\n // 关联关系\n posts Post[]\n users User[]\n terms Term[]\n profiles Profile[]\n\n // 团队和组织成员关联\n members Member[] @relation(\"OrganizationMembers\")\n teams Team[] @relation(\"OrganizationTeams\")\n invitations Invitation[] @relation(\"OrganizationInvitations\")\n\n // 活跃会话关联\n activeSessions Session[] @relation(\"ActiveOrganization\")\n\n // SSO Provider 关联关系\n ssoProviders ssoProvider[] @relation(\"OrganizationSsoProviders\")\n\n metadata Json?\n\n @@index([parentId])\n @@index([path])\n @@index([level, order])\n @@index([deletedAt]) // 活跃组织查询优化\n @@map(\"organizations\")\n}\n\n// 支持多媒体内容和文件管理的帖子模型(多态设计)\nmodel Post {\n id String @id @default(cuid())\n\n // 基本信息\n type String\n title String\n content String? // 文本内容(可选,文件类型可能只有文件信息)\n excerpt String? // 摘要\n\n // 树形结构字段(支持帖子回复、评论等层级关系,也支持文件夹结构)\n parentId String? @map(\"parent_id\")\n parent Post? @relation(\"PostHierarchy\", fields: [parentId], references: [id])\n children Post[] @relation(\"PostHierarchy\")\n\n // 路径字段,用于快速查询整个路径\n path String?\n level Int @default(0) // 层级深度(0为根帖子/根文件夹,1为一级回复/子文件)\n order Float @default(0) // 同级排序\n\n // 状态管理\n status String // draft, published, archived, deleted\n publishedAt DateTime?\n visibility String @default(\"public\") // public, private\n\n // 统计数据\n viewC
|
|||
|
|
"inlineSchemaHash": "9785f6398eaf8c2bcd1af6462d66eb60f6a568d8703b48d80e4fadd413bced21",
|
|||
|
|
"copyEngine": true
|
|||
|
|
}
|
|||
|
|
config.dirname = '/'
|
|||
|
|
|
|||
|
|
config.runtimeDataModel = JSON.parse("{\"models\":{\"User\":{\"dbName\":\"users\",\"schema\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"nativeType\":null,\"default\":{\"name\":\"cuid\",\"args\":[1]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"username\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"displayUsername\",\"dbName\":\"display_username\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"email\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"emailVerified\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"nativeType\":null,\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"image\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"nativeType\":null,\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"password\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"organizationId\",\"dbName\":\"organization_id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":null,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"organization\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Organization\",\"nativeType\":null,\"relationName\":\"OrganizationToUser\",\"relationFromFields\":[\"organizationId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"posts\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Post\",\"nativeType\":null,\"relationName\":\"PostToUser\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userActions\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":fals
|
|||
|
|
defineDmmfProperty(exports.Prisma, config.runtimeDataModel)
|
|||
|
|
config.engineWasm = undefined
|
|||
|
|
config.compilerWasm = undefined
|
|||
|
|
|
|||
|
|
config.injectableEdgeEnv = () => ({
|
|||
|
|
parsed: {
|
|||
|
|
DATABASE_URL: typeof globalThis !== 'undefined' && globalThis['DATABASE_URL'] || typeof process !== 'undefined' && process.env && process.env.DATABASE_URL || undefined
|
|||
|
|
}
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
if (typeof globalThis !== 'undefined' && globalThis['DEBUG'] || typeof process !== 'undefined' && process.env && process.env.DEBUG || undefined) {
|
|||
|
|
Debug.enable(typeof globalThis !== 'undefined' && globalThis['DEBUG'] || typeof process !== 'undefined' && process.env && process.env.DEBUG || undefined)
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
const PrismaClient = getPrismaClient(config)
|
|||
|
|
exports.PrismaClient = PrismaClient
|
|||
|
|
Object.assign(exports, Prisma)
|
|||
|
|
|