mirror of
https://github.com/oiov/vmail.git
synced 2026-06-05 21:03:00 +08:00
docs: upd sql create step
This commit is contained in:
parent
dd72d216e5
commit
64be43e6df
@ -51,6 +51,10 @@ pnpm run remix:dev
|
||||
|
||||
运行前复制 `apps/remix/.env.example` 文件并重命名为 `apps/remix/.env`,填写必要的环境变量。
|
||||
|
||||
## 🌈 下一步计划
|
||||
|
||||
- [ ] 使用 [Cloudflare D1](https://developers.cloudflare.com/d1/) 数据库重构,简化部署流程
|
||||
|
||||
## ❤️ 交流群
|
||||
|
||||
有任何问题或意见,欢迎加入交流群讨论。
|
||||
|
||||
@ -8,28 +8,7 @@
|
||||
|
||||
然后,创建一个名为 `emails` 的表。
|
||||
|
||||
选择您的数据库,您会看到“编辑表”按钮,点击并进入:
|
||||
|
||||

|
||||
|
||||
> ⚠️ 注意:**左上角有一个加号按钮,我尝试点击它没有任何提示或效果,所以我使用了 turso 提供的 cli 来初始化表。**
|
||||
|
||||
Cli 文档:https://docs.turso.tech/cli/introduction
|
||||
|
||||
Linux (或 mac/windows) 终端执行:
|
||||
|
||||
```bash
|
||||
# 安装(安装后记得重启终端生效)
|
||||
curl -sSfL https://get.tur.so/install.sh | bash
|
||||
|
||||
# 登录账户
|
||||
turso auth login
|
||||
|
||||
# 连接到您的Turso数据库
|
||||
turso db shell <database-name>
|
||||
```
|
||||
|
||||
将sql脚本复制到终端运行(packages/database/drizzle/0000_sturdy_arclight.sql)
|
||||
选择您的数据库,您会看到“编辑表”按钮,点击并进入,继续点击左上角的 `SQL runner` 按钮,将[sql脚本](https://github.com/oiov/vmail/blob/main/packages/database/drizzle/0000_sturdy_arclight.sql)复制到终端运行:
|
||||
|
||||
<details>
|
||||
<summary>查看脚本内容</summary>
|
||||
@ -59,8 +38,34 @@ turso db shell <database-name>
|
||||
</code></pre>
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>手动创建表(旧版方法)</summary>
|
||||

|
||||
> ⚠️ 注意:**左上角有一个加号按钮,我尝试点击它没有任何提示或效果,所以我使用了 turso 提供的 cli 来初始化表。**
|
||||
Cli 文档:https://docs.turso.tech/cli/introduction
|
||||
Linux (或 mac/windows) 终端执行:
|
||||
```bash
|
||||
# 安装(安装后记得重启终端生效)
|
||||
curl -sSfL https://get.tur.so/install.sh | bash
|
||||
# 登录账户
|
||||
turso auth login
|
||||
# 连接到您的Turso数据库
|
||||
turso db shell <database-name>
|
||||
```
|
||||
</details>
|
||||
|
||||
**2.部署 email worker**
|
||||
|
||||
需要准备 Node 环境(推荐 18.x 及以上),并且需要安装 wrangler cli 并在本地登录 (登录时建议开启VPN)
|
||||
|
||||
```bash
|
||||
# 安装 pnpm
|
||||
npm install -g pnpm
|
||||
|
||||
# 安装 wrangler cli, 参考 https://developers.cloudflare.com/workers/wrangler/install-and-update
|
||||
npm install wrangler --save-dev
|
||||
```
|
||||
|
||||
```bash
|
||||
git clone https://github.com/oiov/vmail
|
||||
|
||||
@ -83,7 +88,6 @@ pnpm install
|
||||
```bash
|
||||
cd apps/email-worker
|
||||
|
||||
# 需要 Node 环境,并且需要安装 wrangler cli 并在本地登录,参考 https://developers.cloudflare.com/workers/wrangler/install-and-update
|
||||
pnpm run deploy
|
||||
```
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user