Closed lolautruche closed 2 years ago
Thanks so much! Please attach your .platform (zipball) and .platform.app.
@rfay I added them to the description
Shoot, your mariadb looks like this ("db"):
db:
type: mariadb:10.4
disk: 2048
whereas the one I was mostly working with was "dbmysql":
dbmysql:
type: oracle-mysql:8.0
disk: 2048
I see that postgres also has "db":
db:
type: "postgresql:13"
disk: 2048
It seems that in .platform.app the name of the database header is given in the name of the relationship:
relationships:
database: 'dbmysql:mysql'
Completely useless behavior :(
I see that the key "dbmysql" is the key to what we're going to find in resources. I have no idea what the value "mysql" means. I guess we talked about this and maybe it means the name of the service. Seems that both mysql and mariadb have the value "mysql" and postgres has the value "postgresql".
The righthand side of the :
is the "endpoint name", which can be ignored in our case AFAICT
This endpoint name is arbitrarily defined
Using the latest HEAD version of DDEV, running
ddev get platformsh/ddev-platformsh
fails:Error Details
template: processAction:10:84: executing "processAction" at <.services.dbmysql.type>: invalid value; expected string
Click to see the full error
``` could not process pre-install action '#ddev-nodisplay #todo: This simplistic approach doesn't work for postgres; volume name is different #and the database type file is different too if docker volume ls | grep ${DDEV_PROJECT}-mariadb; then export current_db_version="$(docker run --rm -w /db -v ${DDEV_PROJECT}-mariadb:/db busybox cat db_mariadb_version.txt)" if [ -z "${current_db_version}" ]; then echo "something went wrong, current_db_version is empty" && false fi export upstream_db="{{ regexReplaceAll "oracle-" (regexReplaceAll ":.*$" .services.dbmysql.type "") "" }}:{{ regexReplaceAll "^.*:" .services.dbmysql.type "" }}" echo "Current db is ${current_db_version/_/:} (${current_db_version})" echo "New db is ${upstream_db}" if [ "${current_db_version/_/:}" != "${upstream_db}" ]; then printf "There is an existing database in this project that doesn\'t match the upstream database type.\nPlease back up this database and then \"ddev delete\" so the new database can be created.\n" false else echo "database versions match: ${current_db_version/_/:}=${upstream_db}" fi fi ': could not parse/execute action 'set -eu -o pipefail #ddev-nodisplay #todo: This simplistic approach doesn't work for postgres; volume name is different #and the database type file is different too if docker volume ls | grep ${DDEV_PROJECT}-mariadb; then export current_db_version="$(docker run --rm -w /db -v ${DDEV_PROJECT}-mariadb:/db busybox cat db_mariadb_version.txt)" if [ -z "${current_db_version}" ]; then echo "something went wrong, current_db_version is empty" && false fi export upstream_db="{{ regexReplaceAll "oracle-" (regexReplaceAll ":.*$" .services.dbmysql.type "") "" }}:{{ regexReplaceAll "^.*:" .services.dbmysql.type "" }}" echo "Current db is ${current_db_version/_/:} (${current_db_version})" echo "New db is ${upstream_db}" if [ "${current_db_version/_/:}" != "${upstream_db}" ]; then printf "There is an existing database in this project that doesn\'t match the upstream database type.\nPlease back up this database and then \"ddev delete\" so the new database can be created.\n" false else echo "database versions match: ${current_db_version/_/:}=${upstream_db}" fi fi ': template: processAction:10:84: executing "processAction" at <.services.dbmysql.type>: invalid value; expected string ```DDEV version info
Platform files
platform_files.zip