Created
September 5, 2013 11:07
-
-
Save Webklex/6448771 to your computer and use it in GitHub Desktop.
Fremdschlüssel eintragen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ALTER TABLE my_table ADD CONSTRAINT my_key FOREIGN KEY ('some_id') | |
REFERENCES some_new_table ('some_other_id') ON UPDATE CASCADE ON DELETE CASCADE | |
#Die entsprechenden Spalten müssen exakt gleich sein. Zudem muss auf den entsprechenden | |
#Spalten ein Index initialisiert werden. Desweiteren muss es sich bei den | |
#Tabellen Engines um InnoDB handeln. | |
#http://stackoverflow.com/questions/11073706/how-to-alter-a-mysql-tables-foreign-key-using-the-command-line | |
#http://stackoverflow.com/questions/4061293/mysql-cant-create-table-errno-150 | |
#Beispiele in der Schweizer Version vorhanden: | |
#https://gist.github.com/Webklex/6448771 | |
ALTER TABLE my_table ADD CONSTRAINT my_key FOREIGN KEY ('some_id') | |
REFERENCES some_new_table ('some_other_id') ON UPDATE CASCADE ON DELETE CASCADE | |
#Die entsprechenden Spalten müssen exakt gleich sein. Zudem muss auf den entsprechenden | |
#Spalten ein Index initialisiert werden. Desweiteren muss es sich bei den | |
#Tabellen Engines um InnoDB handeln. | |
#http://stackoverflow.com/questions/11073706/how-to-alter-a-mysql-tables-foreign-key-using-the-command-line | |
#http://stackoverflow.com/questions/4061293/mysql-cant-create-table-errno-150 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment