Skip to content

Database migration lost when upgrade to Bolt 5.2 #3540

@macintoshplus

Description

@macintoshplus

On a project with Bolt 5.1, when the upgrade to Bolr 5.2 is done, this error occurd:

An exception occurred while executing 'SELECT COUNT(*) AS dctrn_count FROM (SELECT DISTINCT id_0 FROM (SELECT b0_.id AS id_0, b0_.content_type AS content_type_1, b0_.status AS status_2, b0_.created_at AS created_at_3, b0_.modified_at AS modified_at_4, b0_.published_at AS published_at_5, b0_.depublished_at AS depublished_at_6, b0_.title AS title_7, b0_.list_format AS list_format_8 FROM bolt_content b0_ WHERE (b0_.content_type = ? OR b0_.content_type = ? OR b0_.content_type = ? OR b0_.content_type = ? OR b0_.content_type = ? OR b0_.content_type = ?) AND b0_.status <> ? ORDER BY b0_.modified_at DESC) dctrn_result) dctrn_table' with params ["homepage", "pages", "entries", "people", "blocks", "products", "unknown"]:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'b0_.title' in 'field list'

Details

Question Answer
Relevant Bolt Version 5.2
Install type Composer install
BC Break no
PHP version 8.1
Web server All
For UX/UI issues All

Reproduction

Steps to reproduce

  1. install a new Bolt 5.1 project with this command: composer create-project bolt/project myprojectname "2.3.20"
  2. Configure MySQL/MariaDb server and execute bin/console bolt:setup
  3. Check if the web site work.
  4. Change in composer.json from "bolt/core": "^5.1" to "bolt/core": "^5.2"
  5. Execute composer update
  6. Execute bin/console doctrine:migrations:migrate -n
  7. Try to access home page.

Expected result

No error on access to the homepage.

Actual result

Error:

An exception occurred while executing 'SELECT COUNT(*) AS dctrn_count FROM (SELECT DISTINCT id_0 FROM (SELECT b0_.id AS id_0, b0_.content_type AS content_type_1, b0_.status AS status_2, b0_.created_at AS created_at_3, b0_.modified_at AS modified_at_4, b0_.published_at AS published_at_5, b0_.depublished_at AS depublished_at_6, b0_.title AS title_7, b0_.list_format AS list_format_8 FROM bolt_content b0_ WHERE (b0_.content_type = ? OR b0_.content_type = ? OR b0_.content_type = ? OR b0_.content_type = ? OR b0_.content_type = ? OR b0_.content_type = ?) AND b0_.status <> ? ORDER BY b0_.modified_at DESC) dctrn_result) dctrn_table' with params ["homepage", "pages", "entries", "people", "blocks", "products", "unknown"]:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'b0_.title' in 'field list'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions