-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmigration.sql
More file actions
178 lines (162 loc) · 4.3 KB
/
migration.sql
File metadata and controls
178 lines (162 loc) · 4.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
-- AnySwitch 数据迁移 SQL
-- 从 JSON 文件迁移到数据库
-- 生成时间: 2025-12-19
-- ============================================================
-- 1. 后端站点数据
-- ============================================================
-- cpass
INSERT INTO sites (id, name, url, api_key, priority, enabled, created_at, updated_at)
VALUES (
'site_1766134207720_vmxqwqlld',
'cpass',
'https://www.cpass.cc',
'sk-wcjESFvqNSKBc93VwoRRmS4byP3nHNAqNdl5c9YMD9c0ENHY',
1,
1,
'2025-12-19 08:50:07',
'2025-12-19 08:50:07'
);
INSERT INTO site_status (site_id, state, fail_count, last_fail_time, cooldown_until, last_success_time, total_requests, success_requests)
VALUES (
'site_1766134207720_vmxqwqlld',
'available',
0,
1766134366469,
NULL,
1766134990244,
46,
16
);
-- wong公益
INSERT INTO sites (id, name, url, api_key, priority, enabled, created_at, updated_at)
VALUES (
'site_1766134685173_wor07edje',
'wong公益',
'https://wzw.de5.net',
'sk-keVpS7kRCcHPcqIeJNt14xYmX6iSN2uQu1OhgPqTeVisTyxu',
1,
1,
'2025-12-19 08:58:05',
'2025-12-19 08:58:05'
);
INSERT INTO site_status (site_id, state, fail_count, last_fail_time, cooldown_until, last_success_time, total_requests, success_requests)
VALUES (
'site_1766134685173_wor07edje',
'available',
0,
NULL,
NULL,
NULL,
0,
0
);
-- anyrouter
INSERT INTO sites (id, name, url, api_key, priority, enabled, created_at, updated_at)
VALUES (
'site_1766134706992_dqw851475',
'anyrouter',
'https://anyrouter.top',
'sk-mv6FSxyx3Q69ATQzub0M0SpXhtEkm1c66yuSL4Plh2rFR3zJ',
1,
1,
'2025-12-19 08:58:26',
'2025-12-19 08:58:26'
);
INSERT INTO site_status (site_id, state, fail_count, last_fail_time, cooldown_until, last_success_time, total_requests, success_requests)
VALUES (
'site_1766134706992_dqw851475',
'available',
0,
NULL,
NULL,
NULL,
0,
0
);
-- duckcoding
INSERT INTO sites (id, name, url, api_key, priority, enabled, created_at, updated_at)
VALUES (
'site_1766135051623_uqupqgwoj',
'duckcoding',
'https://free.duckcoding.com',
'sk-gxdSM6rWBEGQ8Pst6o5fKABUFmEdvOl267YUw6SFv5Kuefdz',
1,
1,
'2025-12-19 09:04:11',
'2025-12-19 09:04:11'
);
INSERT INTO site_status (site_id, state, fail_count, last_fail_time, cooldown_until, last_success_time, total_requests, success_requests)
VALUES (
'site_1766135051623_uqupqgwoj',
'available',
0,
NULL,
NULL,
NULL,
0,
0
);
-- x666
INSERT INTO sites (id, name, url, api_key, priority, enabled, created_at, updated_at)
VALUES (
'site_1766135118516_lnlwryvpi',
'x666',
'https://x666.me',
'sk-EUlwF2Al0ebH3wgR7YZqSYMNdmRHNViCdQIDfGF9NTz24NhJ',
1,
1,
'2025-12-19 09:05:18',
'2025-12-19 09:05:18'
);
INSERT INTO site_status (site_id, state, fail_count, last_fail_time, cooldown_until, last_success_time, total_requests, success_requests)
VALUES (
'site_1766135118516_lnlwryvpi',
'available',
0,
NULL,
NULL,
NULL,
0,
0
);
-- ============================================================
-- 2. 用户数据
-- ============================================================
INSERT INTO users (id, username, virtual_api_key, quota, used, enabled, description, created_at, updated_at, last_used_at)
VALUES (
'user_1766131847731_kvgdigflh',
'sk-wooyang',
'sk-anyswitch-w81YOCHVxRPT1DZJW46CqeuhoMTeTaqI',
-1,
16,
1,
'杨',
'2025-12-19 08:10:47',
'2025-12-19 09:03:10',
'2025-12-19 09:03:10'
);
-- ============================================================
-- 3. 管理员密码(已设置为 admin123)
-- ============================================================
INSERT INTO config (key, value, updated_at)
VALUES (
'admin_password',
'78442738950db11952505d1e7be39e99a748d985cec04763401202bf858dbefb',
CURRENT_TIMESTAMP
);
-- ============================================================
-- 完成!
-- ============================================================
--
-- 使用方法:
--
-- SQLite:
-- sqlite3 data/anyswitch.db < migration.sql
--
-- MySQL:
-- mysql -u root -p anyswitch < migration.sql
--
-- PostgreSQL:
-- psql -U postgres -d anyswitch -f migration.sql
--
-- ============================================================