mirror of
https://github.com/bigbeartechworld/big-bear-scripts.git
synced 2026-08-04 19:15:12 -04:00
🔧 fix: add MariaDB external_id column fix (#77)
Add database container ID variable and implement fix_external_id function to modify the external_id column for MariaDB compatibility. This resolves user creation failures by ensuring the column definition matches MariaDB requirements. Execute the fix during panel startup before user creation.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
LOG_FILE="pterodactyl_panel_log.txt"
|
||||
CONTAINER_ID="pterodactyl-panel"
|
||||
DB_CONTAINER_ID="big-bear-pterodactyl-panel-database-1"
|
||||
|
||||
log() {
|
||||
local message="$1"
|
||||
@@ -27,6 +28,15 @@ optimize_cache() {
|
||||
log "Laravel cache optimized successfully."
|
||||
}
|
||||
|
||||
fix_external_id() {
|
||||
log "Fixing external_id column for MariaDB compatibility..."
|
||||
if docker exec -i $DB_CONTAINER_ID mysql -u pterodactyl -pcasaos panel -e "ALTER TABLE users MODIFY external_id varchar(191) DEFAULT NULL;" 2>/dev/null; then
|
||||
log "external_id column fixed successfully."
|
||||
else
|
||||
log "WARNING: Could not fix external_id column. User creation may fail."
|
||||
fi
|
||||
}
|
||||
|
||||
prompt_check_login() {
|
||||
echo "Please check your website URL to see if it shows the login." | tee -a $LOG_FILE
|
||||
}
|
||||
@@ -45,6 +55,7 @@ main() {
|
||||
log "Starting script..."
|
||||
generate_key
|
||||
optimize_cache
|
||||
fix_external_id
|
||||
prompt_check_login
|
||||
create_user
|
||||
log "Script finished."
|
||||
|
||||
Reference in New Issue
Block a user