Comments (8)
Comment created by @beberlei:
which database version do yo uuse? can you paste an example schema?
from dbal.
Comment created by obrys:
This is example script with 2 testing entities.
from dbal.
Comment created by obrys:
I have attached script with two entities.
I have this database version:
$ mysql --version
mysql Ver 14.14 Distrib 5.1.41, for debian-linux-gnu (i486) using readline 6.1
Check line 44. There is CASCADE.
Updating schema by: $ doctrine orm:schema-tool:update
Change CASCADE to NO ACTION
$ doctrine orm:schema-tool:update --dump-sql
ALTER TABLE ArticleItem DROP FOREIGN KEY ArticleItem_ibfk_1;
ALTER TABLE ArticleItem ADD FOREIGN KEY (articleGroupId) REFERENCES ArticleGroup(id) ON DELETE NO ACTION
everything ok, so: $ doctrine orm:schema-tool:update
Change NO ACTION to RESTRICT
$ doctrine orm:schema-tool:update --dump-sql
// no output!!
Change RESTRICT to CASCADE
$ doctrine orm:schema-tool:update --dump-sql
ALTER TABLE ArticleItem DROP FOREIGN KEY ArticleItem_ibfk_1;
ALTER TABLE ArticleItem ADD FOREIGN KEY (articleGroupId) REFERENCES ArticleGroup(id) ON DELETE CASCADE
everything ok, so: $ doctrine orm:schema-tool:update
Change CASCADE to RESTRICT
$ doctrine orm:schema-tool:update --dump-sql
ALTER TABLE ArticleItem DROP FOREIGN KEY ArticleItem_ibfk_1;
ALTER TABLE ArticleItem ADD FOREIGN KEY (articleGroupId) REFERENCES ArticleGroup(id) ON DELETE RESTRICT
everything ok, do: $ doctrine orm:schema-tool:update
Change RESTRICT to NO ACTION
$ doctrine orm:schema-tool:update --dump-sql
// no output!!
So there is no way to update database schema from RESTRICT to NO ACTION and reverse!
from dbal.
Comment created by @beberlei:
Hm you are right, however for MySQL NO ACTION is the same as RESTRICT as stated by http://dev.mysql.com/doc/refman/5.1/en/innodb-foreign-key-constraints.html
from dbal.
Comment created by @deeky666:
[~obrys] As there internally is no difference between NO ACTION AND RESTRICT in MySQL I am closing this now. Doctrine generates the correct statements here when necessary.
from dbal.
Issue was closed with resolution "Invalid"
from dbal.
Imported 1 attachments from Jira into https://gist.github.com/479549bb5a53125657cc
from dbal.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
from dbal.
Related Issues (20)
- sql rename table :old_table to :new_table not working parameterised HOT 2
- Foreign key name change not picked up by schema comperator HOT 3
- Exception thrown when creating migration HOT 1
- sqlite id bigint HOT 4
- Incorrect PostgreSQL escaping for schema name exclusion in query HOT 1
- Validation schema failure after disabling DC2Type generation in Doctrine HOT 17
- Why some places you use throw new Exception and other static method? HOT 4
- Validation Error in doctrine:schema:validate After Merging PR #6418 HOT 17
- Unable to detect real driver for proper query type inference in phpstan-doctrine HOT 3
- `Connection::connect` triggers deprecation when `connect` is called from protected scope HOT 2
- BC: Extract EnumType from comment hint is broken ! HOT 2
- Unable to setup 'platform' in wrapper `Connection`, but still documented in 4.x HOT 5
- Cannot connect with mariaDB and SSL with pdo_mysql HOT 7
- Add ENUM type into DBAL 4 HOT 10
- Type Mapping Discrepancies Between DBAL3 and DBAL4 HOT 11
- Column precision is not specified 2 HOT 5
- Oracle `datetimetz` incorrectly parsed due to disagreement between `OraclePlatform`->`getDateTimeTzFormatString()` and Oracle driver's `InitializeSession`
- Transaction not failing on update on unique key constraint
- Unknown column type "uuid" requested. HOT 8
- [MySql][MariaDB] Adding a new column `period` fails (column name not quoted)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dbal.