Skip to content

Commit ea5e801

Browse files
fix update.sh and env.example
1 parent 7d54481 commit ea5e801

File tree

1 file changed

+0
-64
lines changed

1 file changed

+0
-64
lines changed

update.sh

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -621,63 +621,6 @@ update_files() {
621621
log_success "Application files updated successfully ($files_copied files)"
622622
}
623623

624-
# Merge new migrations with existing ones
625-
merge_migrations() {
626-
local source_dir="$1"
627-
628-
log "Merging Prisma migrations..."
629-
630-
# Find the actual source directory
631-
local actual_source_dir
632-
actual_source_dir=$(find "$source_dir" -maxdepth 1 -type d -name "community-scripts-ProxmoxVE-Local-*" | head -1)
633-
634-
if [ -z "$actual_source_dir" ]; then
635-
log_error "Could not find source directory for migration merge"
636-
return 1
637-
fi
638-
639-
# Check if source has migrations
640-
if [ ! -d "$actual_source_dir/prisma/migrations" ]; then
641-
log "No migrations found in new release"
642-
return 0
643-
fi
644-
645-
# Check if we have existing migrations
646-
if [ ! -d "prisma/migrations" ]; then
647-
log "No existing migrations found, copying all migrations from new release"
648-
mkdir -p "prisma"
649-
cp -r "$actual_source_dir/prisma/migrations" "prisma/"
650-
log_success "All migrations copied from new release"
651-
return 0
652-
fi
653-
654-
# Merge migrations - copy only new ones
655-
local new_migrations_copied=0
656-
local existing_migrations=$(find prisma/migrations -mindepth 1 -maxdepth 1 -type d | wc -l)
657-
658-
for migration_dir in "$actual_source_dir/prisma/migrations"/*; do
659-
if [ -d "$migration_dir" ]; then
660-
local migration_name=$(basename "$migration_dir")
661-
local target_migration="prisma/migrations/$migration_name"
662-
663-
if [ ! -d "$target_migration" ]; then
664-
log "Adding new migration: $migration_name"
665-
cp -r "$migration_dir" "$target_migration"
666-
new_migrations_copied=$((new_migrations_copied + 1))
667-
else
668-
log "Migration $migration_name already exists, skipping"
669-
fi
670-
fi
671-
done
672-
673-
local final_migrations=$(find prisma/migrations -mindepth 1 -maxdepth 1 -type d | wc -l)
674-
675-
if [ "$new_migrations_copied" -gt 0 ]; then
676-
log_success "Added $new_migrations_copied new migrations (total: $final_migrations)"
677-
else
678-
log "No new migrations to add (total: $final_migrations)"
679-
fi
680-
}
681624

682625
# Install dependencies and build
683626
install_and_build() {
@@ -981,16 +924,9 @@ main() {
981924
rollback
982925
fi
983926

984-
# Merge new migrations with existing ones
985-
if ! merge_migrations "$source_dir"; then
986-
log_error "Migration merge failed, rolling back..."
987-
rollback
988-
fi
989-
990927
# Restore .env and data directory before building
991928
restore_backup_files
992929

993-
994930
# Verify database was restored correctly
995931
if ! verify_database_restored; then
996932
log_error "Database verification failed, rolling back..."

0 commit comments

Comments
 (0)