doctrine / doctrine/migrations

Unable to change the version column length into the table migration_version

Open
#786 18 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug
Dominant language
PHP
Stars
4.8k
Forks
393
PR merge metrics
No merged PRs in 30d

Description

### BC Break Report

I have upgraded the doctrine migration from the version 1.8.1 to 2.0.0 but when I want check the status of the database migration an exception is throwed.

| Q | A
|------------ | ------
| BC Break | yes
| Version | 2.0.0

#### Summary

This query is tried to run: `ALTER TABLE migration_versions ALTER COLUMN version NVARCHAR(14) NOT NULL`

#### Previous behavior

No error displayed !

#### Current behavior

The result is this error:
```
In PDOConnection.php line 90:

[Doctrine\DBAL\Driver\PDOException (42000)]
SQLSTATE[42000]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]The objet 'PK__migratio__79B5C94C0C85DE4D' depends to column 'version'.
```
Unable to use the doctrine migration.

#### How to reproduce

My version column has 510 in length

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the SQL Server failure reported at PDOConnection.php line 90 and reproduce the migration status check against a migration_versions table whose version column length is 510. Trace how the ALTER TABLE migration_versions ALTER COLUMN query is generated and verify that the status check completes without the primary-key dependency error.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, sql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.