Suppose I have a database sitedb
and in that I have 20 tables and a primary key(say uid
) for one table is used in other tables as dependencies.
uid
is of type int
with length 10
. Lets say that the number of entries in the table is full and I need to increase the capacity of the uid
to the length 11
.
Is it right to do so? What will happen to the related tables and how will it affect the relation?
What if I change the value of uid
in all the tables to length 11
. Is there a tool which will allow me to check and change the value of every related uid
in all the tables in the database? Updates?
Mysql – Change the same field from all the tables from a particular database
MySQLphpmyadmin
Related Question
- Mysql – Index use and column type
- Mysql – Will a change from MyISAM to InnoDB require SQL query changes in MySQL
- Mysql – Moving data from an old table into a newly created table with different field names / number of fields
- Mysql – What’s the best design for a logical structure that contains different properties of various types for different entity categories? (MySQL or NoSQL)
- Mysql – How to create a join on three tables, each from a different database
- Mysql – Deleting from multiple tables with foreign constraints in thesql
- Mysql – how to use the same timestamp along several tables
Best Answer
Modify column by name(s): you can also use any SQL
Where
, such as column_name in (...) or using other columns ininformation_schema.columns
table.use group_concat or similar and just copy/paste.