engine icon indicating copy to clipboard operation
engine copied to clipboard

Views execute before fields migrations.

Open jonasnobile opened this issue 3 years ago • 0 comments

Case

Executing migration where adding field and working with this field in view.

Error code

[
    {
      code: 'MIGRATION_FAILED',
      migration: '2022-04-14-112839',
      message: '2022-04-14-112839: Database query error: column response.form_id does not exist\n' +
        'SQL: CREATE VIEW "form_details" AS \n' +
        '\tSELECT\n' +
        '\t\tgen_random_uuid() AS id,\n' +
        '\t\tform.id AS form_id,\n' +
        '\t\t(SELECT COUNT(*) FROM response WHERE response.form_id = form.id) AS responses_count \n' +
        '\tFROM form\n' +
        ';\n' +
        '\n' +
        'parameters: '
    }
  ]

jonasnobile avatar Apr 14 '22 11:04 jonasnobile