```
psql (14.10 (Ubuntu 14.10-0ubuntu0.22.04.1))
Type "help" for help.
maasdb=# \d maasserver_bootresourcefile; Table "public.maasserver_bootresourcefile"
Column | Type | Collation | Nullable | Default
-----------------+--------------------------+-----------+----------+---------------------------------------------------------
id | integer | | not null | nextval('maasserver_bootresourcefile_id_seq'::regclass)
created | timestamp with time zone | | not null |
updated | timestamp with time zone | | not null |
resource_set_id | integer | | not null |
largefile_id | integer | | not null |
filename | character varying(255) | | not null |
filetype | character varying(20) | | not null | 'tgz'::character varying
extra | text | | not null | '""'::text
Indexes:
"maasserver_bootresourcefile_pkey" PRIMARY KEY, btree (id)
"maasserver_bootresourcefi_resource_set_id_1bdfd52f7cc6de80_uniq" UNIQUE CONSTRAINT, btree (resource_set_id, filename)
"maasserver_bootresourcefile_largefile_id" btree (largefile_id)
"maasserver_bootresourcefile_resource_set_id" btree (resource_set_id)
Foreign-key constraints:
"largefile_id_refs_id_6192daf196cc0427" FOREIGN KEY (largefile_id) REFERENCES maasserver_largefile(id) DEFERRABLE INITIALLY DEFERRED
"resource_set_id_refs_id_5740a0afd6adefa0" FOREIGN KEY (resource_set_id) REFERENCES maasserver_bootresourceset(id) DEFERRABLE INITIALLY DEFERRED
I'd say that the migration fails to cast the extra column to jsonb due to its default value '""'::text. The fix would be to specify how this column should be migrated - i.e. should should not just cast the column to jsonb.
```
However, from a plain 3.2/stable installation I could not manage to get the same default value for the column
```
ubuntu@maas-testmigration:~$ sudo maas-test-db.psql
psql (12.4)
Type "help" for help.
maasdb=# select * from ^C
maasdb=# \d maasserver_bootresourcefile; Table "public.maasserver_bootresourcefile"
Column | Type | Collation | Nullable | Default
-----------------+--------------------------+-----------+----------+---------------------------------------------------------
id | integer | | not null | nextval('maasserver_bootresourcefile_id_seq'::regclass)
created | timestamp with time zone | | not null |
updated | timestamp with time zone | | not null |
filename | character varying(255) | | not null |
filetype | character varying(20) | | not null |
extra | text | | not null |
largefile_id | integer | | not null |
resource_set_id | integer | | not null |
```
I need to retry the following
I could not reproduce this with the following steps on ubuntu 20.04
- install postgresql-12
- install maas snap 3.2/stable
- upgrade postgresql-12 to postgresql-14
- upgrade to 3.3/stable
- upgrade to 3.4/stable
From the user's database
``` 22.04.1) )
psql (14.10 (Ubuntu 14.10-0ubuntu0.
Type "help" for help.
maasdb=# \d maasserver_ bootresourcefil e;
Table "public. maasserver_ bootresourcefil e" ------- ---+--- ------- ------- ------- --+---- ------- +------ ----+-- ------- ------- ------- ------- ------- ------- ------- ------ 'maasserver_ bootresourcefil e_id_seq' ::regclass) _bootresourcefi le_pkey" PRIMARY KEY, btree (id) _bootresourcefi _resource_ set_id_ 1bdfd52f7cc6de8 0_uniq" UNIQUE CONSTRAINT, btree (resource_set_id, filename) _bootresourcefi le_largefile_ id" btree (largefile_id) _bootresourcefi le_resource_ set_id" btree (resource_set_id) id_refs_ id_6192daf196cc 0427" FOREIGN KEY (largefile_id) REFERENCES maasserver_ largefile( id) DEFERRABLE INITIALLY DEFERRED set_id_ refs_id_ 5740a0afd6adefa 0" FOREIGN KEY (resource_set_id) REFERENCES maasserver_ bootresourceset (id) DEFERRABLE INITIALLY DEFERRED
Column | Type | Collation | Nullable | Default
-------
id | integer | | not null | nextval(
created | timestamp with time zone | | not null |
updated | timestamp with time zone | | not null |
resource_set_id | integer | | not null |
largefile_id | integer | | not null |
filename | character varying(255) | | not null |
filetype | character varying(20) | | not null | 'tgz'::character varying
extra | text | | not null | '""'::text
Indexes:
"maasserver
"maasserver
"maasserver
"maasserver
Foreign-key constraints:
"largefile_
"resource_
I'd say that the migration fails to cast the extra column to jsonb due to its default value '""'::text. The fix would be to specify how this column should be migrated - i.e. should should not just cast the column to jsonb.
```
However, from a plain 3.2/stable installation I could not manage to get the same default value for the column
``` maas-testmigrat ion:~$ sudo maas-test-db.psql
ubuntu@
psql (12.4)
Type "help" for help.
maasdb=# select * from ^C bootresourcefil e;
Table "public. maasserver_ bootresourcefil e" ------- ---+--- ------- ------- ------- --+---- ------- +------ ----+-- ------- ------- ------- ------- ------- ------- ------- ------ 'maasserver_ bootresourcefil e_id_seq' ::regclass)
maasdb=# \d maasserver_
Column | Type | Collation | Nullable | Default
-------
id | integer | | not null | nextval(
created | timestamp with time zone | | not null |
updated | timestamp with time zone | | not null |
filename | character varying(255) | | not null |
filetype | character varying(20) | | not null |
extra | text | | not null |
largefile_id | integer | | not null |
resource_set_id | integer | | not null |
```
I need to retry the following
I could not reproduce this with the following steps on ubuntu 20.04
- install postgresql-12
- install maas snap 3.2/stable
- upgrade postgresql-12 to postgresql-14
- upgrade to 3.3/stable
- upgrade to 3.4/stable
keep you posted