Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
SunWuyuan committed Dec 7, 2024
1 parent 031a776 commit 7946b1f
Show file tree
Hide file tree
Showing 10 changed files with 232 additions and 164 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ QQ:964979747
想了解社区效果,请参考 [ZeroCat](https://ourworld.wuyuan.dev)

## 安装

![使用Nodejs开发](.public/Node.js.png)
这个项目使用 [node](http://nodejs.org) , [npm](https://npmjs.com), [docker](https://docker.com),请确保你本地已经安装了祂们

```sh
Expand Down Expand Up @@ -106,4 +106,5 @@ ZeroCat 的项目 遵循 [Contributor Covenant](http://contributor-covenant.org/
感谢:https://gitee.com/scratch-cn/lite
<br/>此项目声明了 MIT 协议


![社区(Github图床)](https://github.com/ZeroCatDev/ZeroCat/assets/88357633/d6f4a6ba-daa1-45c8-88f7-4b20d9edbb22)
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
"scripts": {
"test": "echo \"No test specified\" && exit 0",
"start": "node .bin/www",
"prisma": "prisma db pull && prisma generate",
"prisma": "prisma generate",
"prisma:pull": "prisma db pull && prisma generate",
"dev": "cross-env NODE_ENV=development nodemon node .bin/www"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.693.0",
"@prisma/client": "^5.22.0",
"@prisma/client": "^6.0.1",
"axios": "^1.7.3",
"body-parser": "^1.20.1",
"compression": "^1.7.5",
Expand All @@ -36,6 +37,6 @@
},
"devDependencies": {
"cross-env": "^7.0.3",
"prisma": "^5.22.0"
"prisma": "^6.0.1"
}
}
74 changes: 37 additions & 37 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 29 additions & 16 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -115,23 +115,25 @@ model ow_counter {

/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
model ow_projects {
id Int @id @default(autoincrement()) @db.UnsignedInt
type String? @default("text") @db.VarChar(32)
licence String? @db.VarChar(32)
id Int @id @default(autoincrement()) @db.UnsignedInt
type String? @default("text") @db.VarChar(32)
licence String? @db.VarChar(32)
authorid Int
teacherid Int? @default(0) @db.UnsignedInt
state String? @default("private") @db.VarChar(32)
view_count Int? @default(0) @db.UnsignedInt
like_count Int? @default(0)
favo_count Int? @default(0)
time DateTime? @default(now()) @db.Timestamp(0)
title String? @default("Scratch新项目") @db.VarChar(1000)
description String? @default("OurWorld上的Scratch项目") @db.VarChar(1000)
source String? @db.MediumText
history Boolean @default(true)
devenv Boolean @default(true)
devsource String @db.MediumText
tags String @default("") @db.VarChar(100)
teacherid Int? @default(0) @db.UnsignedInt
state String? @default("private") @db.VarChar(32)
view_count Int? @default(0) @db.UnsignedInt
like_count Int? @default(0)
favo_count Int? @default(0)
time DateTime? @default(now()) @db.Timestamp(0)
title String? @default("Scratch新项目") @db.VarChar(1000)
description String? @default("OurWorld上的Scratch项目") @db.VarChar(1000)
source String? @db.MediumText
history Boolean @default(true)
devenv Boolean @default(true)
devsource String @db.MediumText
// 移除原来的 tags 字符串字段
// 添加与 tags 表的关联
tags ow_projects_tags[]
}

/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
Expand Down Expand Up @@ -364,6 +366,17 @@ model magiclinktoken {
expiresAt DateTime @db.DateTime(0)
}

model ow_projects_tags {
id Int @id @default(autoincrement())
name String @db.VarChar(45)
projectid Int
created_at DateTime? @default(now()) @db.Timestamp(0)
// 添加与 projects 表的关联
project ow_projects @relation(fields: [projectid], references: [id])
@@index([projectid])
}

/// The underlying view does not contain a valid unique identifier and can therefore currently not be handled by Prisma Client.
/// This view or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
view ow_projects_view {
Expand Down
Binary file added public/Node.js.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 7946b1f

Please sign in to comment.