Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

In phpMyAdmin, while renaming a column/table which is referenced by some foreign key, I get an error. I can not rename a column until I remove all its relations.

There should be facilitated integrity of schema, just like referential integrity i.e. cascading on delete and update column/table name.

User should be allowed to rename a column/table only if user has also permissions to the related tables/columns. Then, cascade this change throughout schema i.e. (foreign keys,triggers etc.)

I have tried to post above request on mysql here Link but get error This form is invalid or has expired, please try again shortly

Please guide me Is this a good request . No? then why? Yes? then where should I and how can i submit it?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Referential integrity is one, and is an attribute of the table data, but it is not an attribute of the table's schema. A table's schema shouldn't be changed in a cascading style, because it can break existing working code. A table's column is not used only in foreign keys, triggers, etc. It's used in scripts, maintenance plans, jobs, applications, dlls, even web pages etc. If you change an object's name you can create a mess, that's why it shouldn't be done automatically. This is something you want to control.

This is where refactoring tools can enter the scene. Eg for MS SQL Server there's Visual Studio db projects that can help here, but not by much. There may be tools that aid in refactoring the db objects and fix anything automatically, but they are not part of any standard db package.

share|improve this answer
    
Thanks @Marian. I could be more happy if had been told about mysql refactoring tool :) –  Sami Nov 21 '12 at 18:03
    
@Sami: Sorry, mate. I'm not familiar with tools for MySQL. Maybe this question on StackOverflow can help. I'm sure that our friend Rolando can help here, he's well into MySQL :-). –  Marian Nov 21 '12 at 18:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.