[DBAL-377] Rename Table foreignkey not changed Created: 07/Nov/12 Updated: 21/Nov/12 |
|
| Status: | Awaiting Feedback |
| Project: | Doctrine DBAL |
| Component/s: | Schema Managers |
| Affects Version/s: | 2.3 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | Manuel | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
if i want to change a tablename the foreign key doesnt change and i get an error $config = new Doctrine\DBAL\Configuration(); } ################################################## PDOException: SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'doc_xml_consultant_new' already exists in /Applications/MAMP/bin/php/php5.3.14/lib/php/Doctrine/DBAL/Connection.php on line 646 Call Stack: 0.0430 771936 2. require_once('/PATH/TO/jobs/config.php') /PATH/TO/jobs/import.php:7 0.0528 775448 3. require_once('/PATH/TO/jobs/bootstrap.php') /PATH/TO/jobs/config.php:3 0.0623 812680 4. require_once('/PATH/TO/jobs/bootstrap_doctrine.php') /PATH/TO/jobs/bootstrap.php:5 16.7866 16304048 5. Doctrine\ORM\Tools\SchemaTool->createSchema() /PATH/TO/jobs/bootstrap_doctrine.php:70 16.8798 16562624 6. Doctrine\DBAL\Connection->executeQuery() /Applications/MAMP/bin/php/php5.3.14/lib/php/Doctrine/ORM/Tools/SchemaTool.php:90 16.8804 16564080 7. PDO->query() /Applications/MAMP/bin/php/php5.3.14/lib/php/Doctrine/DBAL/Connection.php:646 Doctrine\DBAL\DBALException: An exception occurred while executing 'CREATE TABLE doc_xml_consultant_new (id INT NOT NULL, name VARCHAR(255) DEFAULT NULL, email VARCHAR(255) DEFAULT NULL, lastCommaFirstName VARCHAR(255) DEFAULT NULL, education LONGTEXT DEFAULT NULL, workHistory LONGTEXT DEFAULT NULL, imageStandard VARCHAR(255) DEFAULT NULL, imageWide VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB': SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'doc_xml_consultant_new' already exists in /Applications/MAMP/bin/php/php5.3.14/lib/php/Doctrine/DBAL/DBALException.php on line 47 Call Stack: 0.0178 766208 1. {main} () /PATH/TO/jobs/import.php:0 Doctrine\ORM\Tools\ToolsException: Schema-Tool failed with Error 'An exception occurred while executing 'CREATE TABLE doc_xml_consultant_new (id INT NOT NULL, name VARCHAR(255) DEFAULT NULL, email VARCHAR(255) DEFAULT NULL, lastCommaFirstName VARCHAR(255) DEFAULT NULL, education LONGTEXT DEFAULT NULL, workHistory LONGTEXT DEFAULT NULL, imageStandard VARCHAR(255) DEFAULT NULL, imageWide VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB': SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'doc_xml_consultant_new' already exists' while executing DDL: CREATE TABLE doc_xml_consultant_new (id INT NOT NULL, name VARCHAR(255) DEFAULT NULL, email VARCHAR(255) DEFAULT NULL, lastCommaFirstName VARCHAR(255) DEFAULT NULL, education LONGTEXT DEFAULT NULL, workHistory LONGTEXT DEFAULT NULL, imageStandard VARCHAR(255) DEFAULT NULL, imageWide VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB in /Applications/MAMP/bin/php/php5.3.14/lib/php/Doctrine/ORM/Tools/ToolsException.php on line 33 Call Stack: () /PATH/TO/jobs/import.php:0 |
| Comments |
| Comment by Manuel [ 07/Nov/12 ] |
|
now i find a way to rename the table and then rename. else this would be a good feature |
[DBAL-474] SchemaManager / Connection on PostgreSQL platform does not respect filterExpression for sequences Created: 27/Mar/13 Updated: 24/Apr/13 |
|
| Status: | Awaiting Feedback |
| Project: | Doctrine DBAL |
| Component/s: | Schema Managers |
| Affects Version/s: | 2.2.2 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | jos de witte | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | postgresql, schematool | ||
| Environment: |
Windows & Linux |
||
| Description |
|
Dear Symfony team, the filterExpression on AbstractSchemaManager seems not to work for sequences. This only happens under postgres. It seems the way the sequences are handled are the culprit: It tries to get min_value etc of sequences without matching sequence names to the filter expression in advance. If for example access to the sequences is denied, (Different schema without permissions for the current entity manager), any higher-level ORM operations like generating migration versions fail. --------------------- UPDATE the context is when using migrations. Positive regexp expressions do not limit the migration to a single schema. eg ^schemaname.$ |
| Comments |
| Comment by Benjamin Eberlei [ 14/Apr/13 ] |
|
Can you paste an exception trace? I see that filtering is applied to sequences, but your description seems to indicate this happens due to an SQL query much earlier? |
| Comment by jos de witte [ 24/Apr/13 ] |
|
Dear Benjamin, the context is when using migrations. Positive regexp expressions do not limit the migration to a single schema. eg ^schemaname.$ |
[DBAL-264] Support for UIDs in PostgreSQL Created: 30/Apr/12 Updated: 29/Apr/13 |
|
| Status: | Awaiting Feedback |
| Project: | Doctrine DBAL |
| Component/s: | Platforms |
| Affects Version/s: | 2.3 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | New Feature | Priority: | Major |
| Reporter: | ross neacoders | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Please add support for uuid datatype in PostgreSQL |
| Comments |
| Comment by Darrell Hamilton [ 12/Oct/12 ] |
|
It seems the only missing piece is the implementation of the getGuidExpression method in the PostgreSqlPlatform class. Details on generating UUIDs from postgres can be found here: http://www.postgresql.org/docs/current/static/uuid-ossp.html Things that would need to be addressed: 1) It requires the uuid-ossp module to be installed in the database. Solve with documentation or ...? 2) There isn't just one function. Just pick one or make it configurable with a sane default? |
| Comment by Ross Cousens [ 10/Dec/12 ] |
|
I have implemented this for my own project, using what I think is a sane default: public function getGuidExpression() { return 'uuid_generate_v4()'; }The other issue I think that needs addressing is that the extension must be loaded into the current database upon creation. Either this is a deal-breaker right here (relying on a PGSQL plugin that's not available by default) OR If not, maybe schema:update/create needs to check for whether postgresql is being used, whether there is a guid type/generator being used in an entity, and then either execute CREATE EXTENSION uuid-ossp;, and failing that return an exception that informs the user that uuid-ossp must be available as an extension before GUID generation can be used in entities. Can someone explain to me please the position on this currently? Is it not ok to rely on non-core/standard functionality? |
| Comment by Mark Badolato [ 25/Apr/13 ] |
|
Is there any sort of decision on this item? I was trying to use UUID with Postgres and finally got it to work by adding public function getGuidExpression() { return 'UUID_GENERATE_V4()'; }and went to submit a patch, then found this ticket and see that it's the exact same solution that Ross Cousens submitted above. I'd really like to not maintain my own fork of the repository just to have this change in place, and it seems like a reasonable fix (barring the uuid-ossp extension not being a Postgres default extension). Can we get this in there so it's available, and worry about the issue of informing the user about the extension at a later point? Or is there an easy way that anyone knows that I can add the function to my own class (in a Symfony2 project) that would extend PostgreSqlPlatform.php and add the function, without the need for me to fork Doctrine and add it on my own? Thanks, |
| Comment by Mark Badolato [ 25/Apr/13 ] |
|
Pull request submitted |
| Comment by Ross Cousens [ 26/Apr/13 ] |
|
I hope this gets accepted but I fear it won't. The original complaint against implementing GUID for the PostgreSQL platform driver was because a) it required a separate extension to be enabled on the server itself b) and there were a number of GUID generation functions available. To use anything but v4 would be asinine unless some external constraint was forcing you to use the older generation algorithms, so I think argument b is mostly moot. Argument a can easily be solved with documentation, programmatically as well (would require more work) or just left as is because the error back from postgresql is very verbose. Cannot find function uuid_generate_v4. Google it, see that extension is required, see that it's available in PostgreSQL contrib packages, enable it, and voila it works. |
| Comment by Mark Badolato [ 26/Apr/13 ] |
|
Agreed, and I think that having SOMETHING that is usable (and has a very clear message that you need to install an extension) is better than nothing. The implementation can be expanded later to cover the extension not existing, or using something other than v4, etc. But this should be good enough for most people and it seems silly not to have, or at least not have a way to override and provide it. I was looking at the Symfony configs to see if there was a way to define my own platform class that could then just extend the current PostgreSqlPlatform class and add a the function, but that doesn't seem to be doable (or I just missed it) |
| Comment by Mark Badolato [ 27/Apr/13 ] |
|
I just saw that this got merged into master. As soon as this hits 2.3* I can do away with the manual UUID generation for id's that we're currently doing Thanks much Benjamin! |
| Comment by Ross Cousens [ 29/Apr/13 ] |
|
Yay, I am happy that this has been accepted and will make it through to next release. Thank you Mark/Benjamin! |
[DBAL-504] DBAL Enum fields migration issue / PostgreSQL Created: 24/Apr/13 Updated: 06/May/13 |
|
| Status: | Awaiting Feedback |
| Project: | Doctrine DBAL |
| Component/s: | Drivers, Schema Managers |
| Affects Version/s: | 2.3.3 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | jos de witte | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Environment: |
postgresql |
||
| Issue Links: |
|
||||||||
| Description |
|
When using Custom Doctrine DBAL Enums the migration created using diff works fine the first time. However the next time it generates a SQL statement trying to change to field type to INT from integer; (Redundant) "ALTER schemaname.fieldname SET" .. And that's it. |
| Comments |
| Comment by Tom Vogt [ 01/May/13 ] |
|
Doesn't only happen on Enums. I don't use any enums and I have this problem. I use a couple of geo (postGIS) fields (point, linestring, polygon) as well as array fields, so either or all of those might be causing it, too. |
| Comment by Benjamin Eberlei [ 04/May/13 ] |
|
We did some changes for PostgreSQL column diffs lately, can you verify this bug still exists on the 2.3 Branch of DBAL? |
| Comment by Tom Vogt [ 06/May/13 ] |
|
I'm running this on Symfony2 with this composer.json config: "doctrine/orm": "2.3.*", and I'm still getting this issue today. |
[DBAL-292] Multiple use of named parameter doesn't work Created: 12/Jun/12 Updated: 23/Jan/13 |
|
| Status: | Awaiting Feedback |
| Project: | Doctrine DBAL |
| Component/s: | None |
| Affects Version/s: | 2.2.2 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Minor |
| Reporter: | Jürgen | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
IIS 7.5, MS-SQL-Server 2005, PHP 5.4.0 |
||
| Description |
|
In the example in the documentation http://doctrine-dbal.readthedocs.org/en/2.0.x/reference/data-retrieval-and-manipulation.html#dynamic-parameters-and-prepared-statements there is the following example:
When I try this example using pdo_sqlsrv I get the following error: When I use instead the parameters name1 and name2 the query works as expected. |
| Comments |
| Comment by Alexander [ 07/Jul/12 ] |
|
Are you sure you were using the 2.2.2 version of the ORM? Can you try to reproduce this with the latest master? |
[DBAL-373] Indexes and uniqueConstraints has been ignored Created: 26/Oct/12 Updated: 20/Apr/13 |
|
| Status: | Awaiting Feedback |
| Project: | Doctrine DBAL |
| Component/s: | Schema Managers |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Minor |
| Reporter: | Diego Oliveira | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Ubuntu 12.04 with MySQL 5.5 and PHP 5.4 |
||
| Attachments: |
|
| Description |
|
I using the Doctrine Migrations and when I declared my entity with the indexes section, the index name has been ignored. It's like this: indexes: but, the diff tools ignore it and give me this code: and it should be: Notice: I open the same bug on the migrations repository in github and @kimhemsoe told me to open here, since this is generated by DBAL component. |
| Comments |
| Comment by Padraig O'Sullivan [ 11/Dec/12 ] |
|
Did you specify an index name in the indexes property for your entity in your PHP file? In this case, you should have something like:
indexes={@Index(name="IDX_ADDRESS_CITY", columns={"city_id"})}
That should result in the correct SQL being generated. If I modify the above to:
indexes={@Index(columns={"city_id"})}
I also get a migration that has SQL with an auto-generated index name. |
| Comment by Diego Oliveira [ 02/Feb/13 ] |
|
Yes I did specify a name, as you can see: uniqueConstraints:
UNIQUE_STATE_SLUG:
columns: slug
indexes:
IDX_USER_ADDRESS:
columns: address_id
I don't try do to it using annotations because I choose do use yaml to describe my entities. I will take a look on the source code to see if I can fix it and send a PR. |
| Comment by Diego Oliveira [ 02/Apr/13 ] |
|
I already sent this patch to Guilherme Blanco, but I guess he doesn't have time to take a look on it. I guess my solution it's not ideal, but it solve the problem and can be a base to make a better solution. |
| Comment by Benjamin Eberlei [ 20/Apr/13 ] |
|
Diego Oliveira the fix doesn't seem too nice with the additional boolean flag. I would rather like to fix the root cause instead of adding this solution. |
| Comment by Benjamin Eberlei [ 20/Apr/13 ] |
|
The issue is tricky, because we cannot just move the index definitions above, they will need the columns, however that directly generates the index in the schema tool. Maybe if the gather join column methods would check if they can add an index already it would work. |