Skip to content

migrations: Update migration directory names

Warren Gifford requested to merge ef/migration-filenames into main

Created by: efritz

This PR fixes bad file deletion logic in the migration squash command when there are migration directories with names attached. The following script was used for the rename.

for schema in frontend codeintel codeinsights; do
  for file in "migrations/${schema}/"*; do
    if [ -d "${file}" ] && [[ "${file}" != *'_'* ]]; then
      mv "${file}" "${file}_$(yq '.name' <"${file}/metadata.yaml" | sed 's/ /_/g' | sed 's/[^a-z0-9_]+/_/g')"
    fi
  done
done

Test plan

Existing CI pipelines.

Merge request reports

Loading