Database Error after Container Update

I tried to update my open balena container. After the upgrade to that version:

OPENBALENA_API_VERSION_TAG=v0.31.0
OPENBALENA_DB_VERSION_TAG=v3.0.1
OPENBALENA_REGISTRY_VERSION_TAG=v2.11.3
OPENBALENA_S3_VERSION_TAG=v2.8.5
OPENBALENA_VPN_VERSION_TAG=v9.2.0
OPENBALENA_MDNS_PUBLISHER_VERSION_TAG=v1.6.2

i get this error:

db_1_4311d5a08a74 | 2019-09-11 12:21:38.455 UTC [31] ERROR:      column device.device type does not exist at character 172
    db_1_4311d5a08a74 | 2019-09-11 12:21:38.455 UTC [31] HINT:  Perhaps you meant to reference the column "device.device name" or the column "device.is-device type".
    db_1_4311d5a08a74 | 2019-09-11 12:21:38.455 UTC [31] STATEMENT:  SELECT "device"."id"
    db_1_4311d5a08a74 | 	FROM (
    db_1_4311d5a08a74 | 		SELECT "device"."created at", "device"."id", "device"."actor", "device"."uuid", "device"."local id", "device"."device name", "device"."note", "device"."device type", "device"."is of-device type table", "device"."belongs to-application", "device"."is online", "device"."last connectivity event", "device"."is connected to vpn", "device"."last vpn event", "device"."is locked until-date", "device"."logs channel", "device"."public address", "device"."vpn address", "device"."ip address", "device"."is on-commit", "device"."download progress", "device"."status", "device"."os version", "device"."os variant", "device"."supervisor version", "device"."provisioning progress", "device"."provisioning state", "device"."api port", "device"."api secret", "device"."is managed by-service instance", "device"."should be running-release", "device"."is managed by-device"
    db_1_4311d5a08a74 | 		FROM "device"
    db_1_4311d5a08a74 | 		WHERE ("device"."actor" = $1
    db_1_4311d5a08a74 | 		OR EXISTS (
    db_1_4311d5a08a74 | 			SELECT 1
    db_1_4311d5a08a74 | 			FROM "application" AS "device.belongs to-application"
    db_1_4311d5a08a74 | 			WHERE "device"."belongs to-application" = "device.belongs to-application"."id"
    db_1_4311d5a08a74 | 			AND EXISTS (
    db_1_4311d5a08a74 | 				SELECT 1
    db_1_4311d5a08a74 | 				FROM "application" AS "device.belongs to-application.depends on-application"
    db_1_4311d5a08a74 | 				WHERE "device.belongs to-application"."depends on-application" = "device.belongs to-application.depends on-application"."id"
    db_1_4311d5a08a74 | 				AND EXISTS (
    db_1_4311d5a08a74 | 					SELECT 1
    db_1_4311d5a08a74 | 					FROM "device" AS "dev.belongs to-application.depends on-application.owns-device"
    db_1_4311d5a08a74 | 					WHERE "device.belongs to-application.depends on-application"."id" = "dev.belongs to-application.depends on-application.owns-device"."belongs to-application"
    db_1_4311d5a08a74 | 					AND "dev.belongs to-application.depends on-application.owns-device"."actor" = $1
    db_1_4311d5a08a74 | 				)
    db_1_4311d5a08a74 | 			)
    db_1_4311d5a08a74 | 		))
    db_1_4311d5a08a74 | 	) AS "device"
    db_1_4311d5a08a74 | 	WHERE "device"."uuid" = $2

Can somebody help?

Hello,
You get this error because this migration hasn’t been run.
The migrations are run automatically but manually updating the versions as you did isn’t supported.
Versions will be bumped once we’ve tested them.

Ok. Thank you for the explanation. I have a backup so I think everything should be fine. Is there documentation of the preferred way to update open-balena?

I think git fetch, git pull origin master then ./scripts/compose up -d should work fine for updating open-balena.

Ok, i will make the next try with the bumped versions. Thank you for the help.