mirror of
				https://github.com/linux-do/new-api.git
				synced 2025-11-04 13:23:42 +08:00 
			
		
		
		
	feat: add database migration script
This commit is contained in:
		@@ -40,6 +40,9 @@ _✨ All in one 的 OpenAI 接口,整合各种 API 访问方式,开箱即用
 | 
			
		||||
  <a href="https://openai.justsong.cn/">在线演示</a>
 | 
			
		||||
</p>
 | 
			
		||||
 | 
			
		||||
> **Warning**:从 `v0.2` 版本升级到 `v0.3` 版本需要手动迁移数据库,请手动执行[数据库迁移脚本](./bin/migration_v0.2-v0.3.sql)。
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## 功能
 | 
			
		||||
1. 支持多种 API 访问渠道,欢迎 PR 或提 issue 添加更多渠道:
 | 
			
		||||
   + [x] OpenAI 官方通道
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										6
									
								
								bin/migration_v0.2-v0.3.sql
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								bin/migration_v0.2-v0.3.sql
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,6 @@
 | 
			
		||||
UPDATE users
 | 
			
		||||
SET quota = quota + (
 | 
			
		||||
    SELECT SUM(remain_quota)
 | 
			
		||||
    FROM tokens
 | 
			
		||||
    WHERE tokens.user_id = users.id
 | 
			
		||||
)
 | 
			
		||||
		Reference in New Issue
	
	Block a user