-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRestoreDemoData.java
More file actions
31 lines (25 loc) · 1.02 KB
/
RestoreDemoData.java
File metadata and controls
31 lines (25 loc) · 1.02 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
import config.DatabaseConfig;
import config.DemoDataInitializer;
public class RestoreDemoData {
public static void main(String[] args) {
try {
System.out.println("=".repeat(80));
System.out.println("恢复演示数据...");
System.out.println("=".repeat(80));
// 确保不在测试模式
DatabaseConfig.setTestMode(false);
// 初始化数据库结构
DatabaseConfig.initDatabase();
System.out.println("✓ 数据库结构已初始化");
// 初始化演示数据
DemoDataInitializer.initializeIfNeeded();
System.out.println("\n" + "=".repeat(80));
System.out.println("✓ 演示数据恢复完成!");
System.out.println("=".repeat(80));
} catch (Exception e) {
System.err.println("ERROR: " + e.getMessage());
e.printStackTrace();
System.exit(1);
}
}
}