Skip to content

Commit

Permalink
docs: 增加mysql默认字段
Browse files Browse the repository at this point in the history
  • Loading branch information
CrazyMrYan committed Jun 22, 2024
1 parent 915387e commit 0bb3c4c
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,31 @@ nodejs 实现文件上传功能

### 创建表的字段说明

> 启动项目则会,自动创建,默认创建 `files` 表结构
```sql
CREATE TABLE files (
id VARCHAR(50) DEFAULT NULL,
filename VARCHAR(255) NOT NULL,
filesize BIGINT(20) NOT NULL,
filelocation VARCHAR(255) NOT NULL,
created_by VARCHAR(255) NOT NULL,
created_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
updated_by VARCHAR(255) DEFAULT NULL,
updated_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
is_public TINYINT(1) DEFAULT '0',
public_expiration TIMESTAMP NULL DEFAULT NULL,
public_by VARCHAR(255) DEFAULT NULL,
is_thumb TINYINT(1) DEFAULT NULL,
thumb_location VARCHAR(255) DEFAULT NULL,
is_delete TINYINT(1) NOT NULL DEFAULT '0',
real_file_location VARCHAR(255) DEFAULT NULL,
real_file_thumb_location VARCHAR(255) DEFAULT NULL,
mime VARCHAR(255) DEFAULT NULL,
ext VARCHAR(50) DEFAULT NULL,
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
```

| 列名 | 数据类型 | 是否为空 | 默认值 | 注释 |
|------------------|----------------|----------|----------------------|----------------------------------------------|
| `id` | int(11) | NOT NULL | | 文件的唯一标识 |
Expand Down

0 comments on commit 0bb3c4c

Please sign in to comment.