Mysql table alias or clone

Asked

Viewed 49 times

0

I have a table on MySQL that is with a wrong name, this table is already used by many applications, so it would not be very simple to rename it.

Is there any way to create a alias for that table or a clone so that everything done in one is done in the other?

With this the new applications would already use the correct name and gradually I can update the old applications.

  • I don’t know if you could create a clone, but you could create a new table with all the attributes and create a trigger (Trigger) that by inserting in the table of Mysql that is with wrong name, automatically inserts in the new table.

1 answer

3

The best solution would be to create a second table with identical structure to the first one and work with Rigger. Whenever there is insertion, update or deletion in Table 1, it will update in Table 2. The reverse also needs to occur, after all the new applications will only work with Table 2, so your precision modifications will be reflected in Table 1.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.