Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Critical
-
Resolution: Unresolved
-
Affects Version/s: 1.2.3
-
Fix Version/s: None
-
Component/s: Migrations
-
Labels:None
-
Environment:HidePHP 5.3.5-1ubuntu7.2ppa1~lucid with Suhosin-Patch (cli) (built: May 7 2011 03:12:27)
Zend Engine v2.3.0
Xdebug v2.0.5
Turnkey LAMP 10.04 LTS x86_64
Symfony 1.4.11
mysql Ver 14.14 Distrib 5.1.41, for debian-linux-gnu (i486) using readline 6.1ShowPHP 5.3.5-1ubuntu7.2ppa1~lucid with Suhosin-Patch (cli) (built: May 7 2011 03:12:27) Zend Engine v2.3.0 Xdebug v2.0.5 Turnkey LAMP 10.04 LTS x86_64 Symfony 1.4.11 mysql Ver 14.14 Distrib 5.1.41, for debian-linux-gnu (i486) using readline 6.1
Description
Consider the following schema:
schema.yml
MyTable:
columns:
some_text: string
Doctrine creates the table with:
CREATE TABLE `my_table` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `some_text` text, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Now, the following migration should rename the field from some_text to just_text:
<?php class Version1 extends Doctrine_Migration_Base { public function up() { $this->renameColumn('my_table', 'some_text', 'just_text'); } public function down() { $this->renameColumn('my_table', 'just_text', 'some_text'); } }
...however the field gets renamed and the type becomes VARCHAR(255), as the resulting SHOW CREATE TABLE my_table shows:
CREATE TABLE `my_table` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `a_varchar` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Causes data in the column greater than 255 bytes to get truncated
Activity
Ben Lancaster
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Summary | Renaming a doctrine 'string' field results in loss of data as the field's type changes. (MySQL) | Renaming a doctrine 'string' field may result in loss of data as the field's type changes. (MySQL) |
This list may be incomplete, as errors occurred whilst retrieving source from linked applications:
- Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DC-1053, expand=changesets[-21:-1].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)