Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

提交数据库设计 #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lucky-cold
Copy link

第一次数据库设计提交

Copy link
Member

@ATQQ ATQQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

再看看

@@ -1,4 +0,0 @@
| 字段名称 | 数据类型 | 释义 | 示例 |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你把我这删了干啥 嘿嘿

| user_id | Integer | 用户唯一标识 | 1 |
| name | varchar | 用户名称 | 张三 |
| number | varchar | 用户学号 | 201931061008 |
| grade | year | 用户年级 | 2019 |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个用varchar就行

@@ -0,0 +1,25 @@
| 字段名称 | 数据类型 | 释义 | 示例 |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

然后通常还需再记录一下注册时间最后登录时间

这里还有个注册审核的流程,所以还需要一个字段表示用户当前的状态

其次平台区分了管理员和普通用户,所以还需要一个 字段区分角色

| name | varchar | 图片原名称 | 聚会 |
| addtime | datetime | 上传时间 | 2021-5-11 12:12:12 |
| taketime | datetime | 拍摄时间 | 2021-5-10 12:12:12 |
| size | varchar | 图片大小 | 105kb |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个存数字 单位B 由展示方去计算最终展示内容

| :------: | :------: | :----------: | :---------------------------------------------: |
| photo_id | Integer | 图片唯一标识 | 1 |
| name | varchar | 图片原名称 | 聚会 |
| addtime | datetime | 上传时间 | 2021-5-11 12:12:12 |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

日期统一用timestamp 规避一些时区引起的问题

| format | varchar | 图片格式 | .jpg |
| url | varchar | 图片链接 | https://699pic.com/tupian-500470844.html |
| status | int | 图片状态 | 1(表示公开),2(注册用户可看),3(仅自己可看) |
| label | varchar | 图片标签 | 团队聚会 |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

标签这个功能的实现,光这个一个字段可能不行哦,可能还需要 1-2张表

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

仔细品一下需求:
用户和平台管理员都可以为图片增删标签,如果这只有一个字段,那么如果两个用户同时进行更新操作(删除/添加)那么怎么处理

所以这里至少还需要有张标签的表图片与标签关联关系的表

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants