engine
engine copied to clipboard
Views execute before fields migrations.
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: '
}
]