I’m creating an application that needs to run under multiple databases. I currently have some code in a migration that I only want run under specific databases (postgresql and mysql). Any way of setting this up? Thanks.
I’m creating an application that needs to run under multiple databases. I currently have
Share
Your migration has access to a database connection in
connectionand the connection has anadapter_namemethod so you can just ask it what sort of connection it is:I’m not sure if I have the MySQL adapter name right but the technique is sound and you can easily check the MySQL adapter name yourself.