-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconfig.example.yml
More file actions
146 lines (119 loc) · 4.33 KB
/
config.example.yml
File metadata and controls
146 lines (119 loc) · 4.33 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
# Migration Configuration File Example
# Use this file with: uv run migrations/universal.py --config config.yml
# ============================================
# SOURCE CONFIGURATION
# ============================================
source:
# Source database type: postgres, mysql, or sqlite
type: "mysql"
# For SQL dump files or SQLite databases, use 'path':
path: "backup.sql"
# Examples:
# path: "mysql_dump.sql" # MySQL SQL dump
# path: "postgres_dump.sql" # PostgreSQL SQL dump
# path: "database.db" # SQLite database file
# For live database connections, use 'url' instead:
# url: "mysql://user:pass@localhost:3306/sourcedb"
# url: "postgresql://user:pass@localhost:5432/sourcedb"
# ============================================
# TARGET CONFIGURATION
# ============================================
target:
# Target database type: postgres, mysql, or sqlite
type: "postgres"
# For live database connection (recommended), use 'url':
url: "postgresql+asyncpg://user:password@localhost:5432/targetdb"
# Examples:
# url: "postgresql+asyncpg://admin:pass@localhost:5432/mydb" # PostgreSQL
# url: "mysql+pymysql://admin:pass@localhost:3306/mydb" # MySQL
# For SQLite file, use 'path':
# path: "output.db"
# or use 'url':
# url: "sqlite:///output.db"
# ============================================
# OPTIONAL SETTINGS
# ============================================
# Tables to exclude from migration (optional)
exclude_tables:
- admin_usage_logs
- user_usage_logs
- node_stats
# ============================================
# ENUM/STRING COLUMN DEFAULTS (Optional)
# ============================================
# Default values for text/varchar columns when value is NULL but column is NOT NULL
# Useful for enum-like string columns that need default values
# If not specified, uses PasarGuard defaults. Set to {} to disable all defaults.
enum_defaults:
fingerprint: "none"
security: "inbound_default"
# For custom schemas, specify your own enum defaults:
# enum_defaults:
# status: "pending"
# role: "user"
# visibility: "public"
# To disable enum defaults entirely (use empty strings for NOT NULL text columns):
# enum_defaults: {}
# ============================================
# STRING TRUNCATION (Optional)
# ============================================
# Automatically truncate strings that exceed column max length
# Default: false (will fail migration if string is too long)
# Set to true to auto-truncate with warnings
truncate_strings: false
# When enabled:
# - Strings longer than VARCHAR(N) will be truncated to N characters
# - Warnings will be shown for which columns were truncated
# - Helps avoid "string data right truncation" errors
# When disabled (default):
# - Migration will fail if string exceeds max length
# - Safer option - you'll know about data quality issues
# ============================================
# TABLE ORDER (Optional - for custom schemas)
# ============================================
# Specify the order tables should be cleared and imported
# IMPORTANT: Order tables based on foreign key dependencies:
# 1. Tables with no foreign keys first
# 2. Tables that reference those tables next
# 3. Continue in dependency order
# If not specified, uses default PasarGuard schema order
# Default PasarGuard order (customize for your schema):
table_order:
# System/configuration tables (no dependencies)
- jwt
- system
- settings
# Core tables
- admins
- core_configs
- nodes
- inbounds
- groups
# Association tables for many-to-many relationships
- inbounds_groups_association
# Dependent tables
- hosts
- user_templates
- template_group_association
# User tables (depends on groups, templates)
- users
- users_groups_association
- next_plans
# Usage and log tables (depends on users, nodes)
- admin_usage_logs
- user_usage_logs
- notification_reminders
- user_subscription_updates
- node_user_usages
- node_usages
- node_usage_reset_logs
- node_stats
# Example for a custom blog schema:
# table_order:
# - users # No dependencies
# - categories # No dependencies
# - posts # References users
# - tags # No dependencies
# - post_tags # References posts and tags
# - comments # References posts and users
# - likes # References users and comments