项目从akmon迁入到mall
This commit is contained in:
111
doc_mall/QUICK_START_MIGRATION.md
Normal file
111
doc_mall/QUICK_START_MIGRATION.md
Normal file
@@ -0,0 +1,111 @@
|
||||
# ⚡ 快速开始迁移
|
||||
|
||||
## 🚀 快速执行迁移
|
||||
|
||||
### Windows (PowerShell)
|
||||
|
||||
#### 1. 预览模式(推荐先执行)
|
||||
```powershell
|
||||
cd doc_mall
|
||||
.\migrate.ps1 -TargetPath "D:\path\to\new-repo" -DryRun
|
||||
```
|
||||
|
||||
#### 2. 执行迁移
|
||||
```powershell
|
||||
cd doc_mall
|
||||
.\migrate.ps1 -TargetPath "D:\path\to\new-repo"
|
||||
```
|
||||
|
||||
#### 3. 包含 Supabase 组件
|
||||
```powershell
|
||||
.\migrate.ps1 -TargetPath "D:\path\to\new-repo" -CopySupabaseComponents
|
||||
```
|
||||
|
||||
#### 4. 包含工具函数
|
||||
```powershell
|
||||
.\migrate.ps1 -TargetPath "D:\path\to\new-repo" -CopyUtils
|
||||
```
|
||||
|
||||
### Linux/Mac (Bash)
|
||||
|
||||
#### 1. 预览模式
|
||||
```bash
|
||||
cd doc_mall
|
||||
chmod +x migrate.sh
|
||||
./migrate.sh /path/to/new-repo --dry-run
|
||||
```
|
||||
|
||||
#### 2. 执行迁移
|
||||
```bash
|
||||
./migrate.sh /path/to/new-repo
|
||||
```
|
||||
|
||||
#### 3. 包含可选组件
|
||||
```bash
|
||||
./migrate.sh /path/to/new-repo --copy-supabase --copy-utils
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📋 迁移后的必要步骤
|
||||
|
||||
### 1. 检查迁移结果
|
||||
```powershell
|
||||
# 检查目标目录
|
||||
ls D:\path\to\new-repo\doc_mall
|
||||
ls D:\path\to\new-repo\pages\mall
|
||||
ls D:\path\to\new-repo\types
|
||||
```
|
||||
|
||||
### 2. 配置 Supabase
|
||||
|
||||
创建配置文件 `config/supabase.config.ts`:
|
||||
```typescript
|
||||
export const supabaseConfig = {
|
||||
url: 'https://your-project.supabase.co',
|
||||
anonKey: 'your-anon-key',
|
||||
}
|
||||
```
|
||||
|
||||
### 3. 执行数据库脚本
|
||||
|
||||
#### 方式 1: Supabase Dashboard
|
||||
1. 登录 Supabase Dashboard
|
||||
2. 进入 SQL Editor
|
||||
3. 复制 `doc_mall/database/complete_mall_database.sql` 内容
|
||||
4. 执行脚本
|
||||
|
||||
#### 方式 2: psql 命令行
|
||||
```bash
|
||||
psql -h your-host -U postgres -d your_database -f doc_mall/database/complete_mall_database.sql
|
||||
```
|
||||
|
||||
### 4. 验证数据库
|
||||
```bash
|
||||
psql -h your-host -U postgres -d your_database -f doc_mall/database/validation_test.sql
|
||||
```
|
||||
|
||||
### 5. 插入测试数据(可选)
|
||||
```bash
|
||||
psql -h your-host -U postgres -d your_database -f doc_mall/database/mock_data_insert.sql
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## ✅ 验证清单
|
||||
|
||||
- [ ] 文件已复制到目标目录
|
||||
- [ ] 目录结构正确
|
||||
- [ ] Supabase 配置已更新
|
||||
- [ ] 数据库脚本已执行
|
||||
- [ ] 数据库验证通过
|
||||
- [ ] 项目可以编译
|
||||
- [ ] 页面可以正常加载
|
||||
|
||||
---
|
||||
|
||||
## 📚 更多信息
|
||||
|
||||
- 详细迁移指南: [MIGRATION_GUIDE.md](./MIGRATION_GUIDE.md)
|
||||
- 完整检查清单: [MIGRATION_CHECKLIST.md](./MIGRATION_CHECKLIST.md)
|
||||
- 技术实现文档: [TECHNICAL_IMPLEMENTATION.md](./TECHNICAL_IMPLEMENTATION.md)
|
||||
Reference in New Issue
Block a user