As with any database server, changing the server while keeping the same data may often not work out. For example, if you have a working database on MariaDB 10.3, and you change the server type to MySQL 8.0, it will choke on the way up. And DDEV currently has no easy way to know the type of the existing data, in /var/lib/mysql even though the type is in there in a file that DDEV adds, but it can't be seen without starting a container with that volume mounted.
People stumble on this regularly and the docs cover it, and it makes sense.
But it would be a much better user experience if we could:
Detect the version of the database in the volume mount.
Detect if there is actually data there
If a downgrade or a type change, warn people or... if the 'db' database is actually empty, rebuild the whole thing silently.
This issue should probably be moved to drud/ddev, but dropping it here because it has significant impact on this project, where most people will probably have an existing mariadb:10.3 database (but possibly empty) before pulling this add-on, making it hard to give them the type they have in the upstream hosting (if it's different).
I've temporarily addressed this for mysql/mariadb only by adding a test inside the add-on to see if they're changing types or versions. It's a bit fragile, but better than not checking.
As with any database server, changing the server while keeping the same data may often not work out. For example, if you have a working database on MariaDB 10.3, and you change the server type to MySQL 8.0, it will choke on the way up. And DDEV currently has no easy way to know the type of the existing data, in /var/lib/mysql even though the type is in there in a file that DDEV adds, but it can't be seen without starting a container with that volume mounted.
People stumble on this regularly and the docs cover it, and it makes sense.
But it would be a much better user experience if we could:
Discussion in https://platformsh.slack.com/archives/C03GRG19L2E/p1654616860043129
This issue should probably be moved to drud/ddev, but dropping it here because it has significant impact on this project, where most people will probably have an existing mariadb:10.3 database (but possibly empty) before pulling this add-on, making it hard to give them the type they have in the upstream hosting (if it's different).