0

I have a table named "meetings" for historic reasons, and a lot of code that references that table name.

I want to rename it to "jobs" to match what we've been calling it for the last 8 years.

renaming the table will break the code.

Is there a way to create a database-wide alias so I can rename the table to "jobs", but code that references "meetings" will still work?

the code is for inserts and reads.

Kae Verens
  • 4,076
  • 3
  • 21
  • 41
  • 1
    Create a view from the table and call it meetings if you do not need to modify it – Thallius Aug 24 '21 at 11:02
  • possible duplicate of [https://stackoverflow.com/questions/1890155/how-do-i-create-a-table-alias-in-mysql](https://stackoverflow.com/questions/1890155/how-do-i-create-a-table-alias-in-mysql) – Kagiso Marvin Molekwa Aug 24 '21 at 11:03
  • note that I *specifically* stated that the code is for *inserts and reads*. obviously updates and deletes as well. a view is not the answer – Kae Verens Aug 24 '21 at 11:23
  • Would using something like ProxySQL be an option or would it not be viable? – wchiquito Aug 24 '21 at 15:53
  • I may be wrong about views. my knowledge of them is about 20 years old and I don't remember being able to edit them. a proxy server might be a possible answer, yes. so would a versioned API (more work). I was really just hoping for a way to say "table A is also called B" – Kae Verens Aug 24 '21 at 18:24

0 Answers0