Repository navigation
Conversation
Index func names are built by concatenating storing column names and index column names, so adding a STORING column to an index changes the func name, even though storing columns are not used as filter conditions. Add options to build index func names from index names instead, which is the same naming as yo v2: - --use-index-name-for-func-name: apply to all indexes - --use-index-name-for-func-name-index: apply only to the given indexes (can be specified multiple times) to migrate index by index. An error is returned if the given index is not found. Also fix the README description of the default naming convention.
- Return an error when generated index func names conflict, which can happen when func names built from index names and from index column names are mixed. - Do not treat an index as not found when its table is excluded by --ignore-tables or --target-tables. Only indexes that do not exist in the schema are reported. - Compare index names case insensitively, as Spanner identifiers are case insensitive. - Return ErrIndexNotFound from internal and add the flag name in cmd. - Share the func name prefix logic between the two naming modes.
sinmetal
marked this pull request as ready for review
October 20, 2026 10:52
vvakame
approved these changes
Oct 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WHAT
I created an option for v1 to generate function names from INDEX names, similar to v2. In v1.
An option
--use-index-name-for-func-name-indexwas also provided to individually specify INDEXes so that it can be enabled for only a subset of them.WHY
function names are generated by concatenating column names, but this has several issues
Collisions occur when different INDEXes exist on the same column:
Duplicating an INDEX on the same column to avoid hotspots results in function name collisions.
STORING columns are included in the function name:
Adding a STORING column to an existing index changes the function name. Moreover, since STORING columns are not used for filtering, it results in function names like
FindByCreateTimeUserID(ctx, db, userID).