Skip to content

fix(migration): geonameId column name + widen Relations to VARCHAR(255) - #479

Closed
Neophytis wants to merge 275 commits into
masterfrom
neophytis/fix-migration-db-bugs
Closed

fix(migration): geonameId column name + widen Relations to VARCHAR(255)#479
Neophytis wants to merge 275 commits into
masterfrom
neophytis/fix-migration-db-bugs

Conversation

@Neophytis

Copy link
Copy Markdown
Contributor

Summary

Two bugs in the DB migration path, identified during the Lion→Alpha DB migration work and confirmed by Shevek's review.

Bug 1 — MigrateDatabaseCommand: wrong column name for geonameId

migrateAddressTable() was querying g.geoname_id (snake_case) but:

  • The Location entity maps @ORM\Column(name="geonameId") — camelCase
  • Lion's DB has the column as geonameId

The previous workaround was renaming the DB column in preflight, which would have broken Doctrine entirely. The fix is to query the column by its actual name.

Bug 2 — Version20260801120000: Relations VARCHAR(87) too short

The SET→VARCHAR migration used VARCHAR(87) for comment.relations and comments.Relations. Production data caused truncation. Widened to VARCHAR(255).

Test plan

  • Run bin/console migrate:database against a Lion DB copy — address ETL completes without "Unknown column 'g.geoname_id'" error
  • Run doctrine:migrations:migrate — Version20260801120000 applies without truncation warnings

thisismeonmounteverest and others added 30 commits May 18, 2024 13:36
* Add check for phone number in CommentModel

* Add check for phone number in CommentController

* Add anti-spam check in RelationsController

Added functions to check for email address and phone number, and only add the comment if none are detected
…nd make forum work with strict mode for DB.
thisismeonmounteverest and others added 25 commits July 29, 2026 20:22
Bumps [squizlabs/php_codesniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer) from 3.13.5 to 3.13.6.
- [Release notes](https://github.com/PHPCSStandards/PHP_CodeSniffer/releases)
- [Changelog](https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/4.x/CHANGELOG-3.x.md)
- [Commits](PHPCSStandards/PHP_CodeSniffer@3.13.5...3.13.6)

---
updated-dependencies:
- dependency-name: squizlabs/php_codesniffer
  dependency-version: 3.13.6
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Fixed bun audit failures

* Sitemap generator including newsletters

* Sitemap generator including newsletters
…(255)

MigrateDatabaseCommand.migrateAddressTable queried g.geoname_id (snake_case)
but the Location entity maps @Orm\Column(name="geonameId") and Lion's DB has
the column as geonameId. Renaming the column in preflight was the wrong fix —
it would break Doctrine. Query the column by its actual name instead.

Version20260801120000: Relations SET→VARCHAR used VARCHAR(87) which is the
theoretical maximum but caused data truncation on production data. Widened to
VARCHAR(255) for both the new `comment.relations` and the Lion `comments.Relations`
columns.
@Neophytis
Neophytis marked this pull request as draft August 15, 2026 18:07
@Neophytis
Neophytis changed the base branch from develop to master August 15, 2026 18:07
@Neophytis

Copy link
Copy Markdown
Contributor Author

Closing: these files (MigrateDatabaseCommand.php, Version20260801120000.php) exist only on develop, not on master or feature/docker-beta. Shevek owns the develop migration system. No changes from master perspective are needed here.

@Neophytis Neophytis closed this Aug 15, 2026
@Neophytis
Neophytis deleted the neophytis/fix-migration-db-bugs branch August 15, 2026 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants