-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add level column to audits #372
Conversation
Will break old surveys using audits. |
Why, which "old surveys"? The pre-audits v2, or break actual v2? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you decided to do the "long" refactoring after all? ;-)
|
||
export async function up(knex: Knex): Promise<unknown> { | ||
return knex.schema.alterTable(tableName, (table: Knex.TableBuilder) => { | ||
table.enu(columnName, ['error', 'warning', 'info']).defaultTo('error').notNullable().index(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before dropping the is_warning column, you should set the level column to 'warning' if is_warning is true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed since only one survey uses audits v2 (od_mtl_2023) and audits needs to be reset anyway since they are not yet complete.
ignore: true, | ||
objectType: 'interview', | ||
objectUuid: arbitraryUuid | ||
}, { | ||
version: 1, | ||
errorCode: 'test-error-2', | ||
message: 'Test error message', | ||
isWarning: false, | ||
level: 'error' as ('error' | 'warning' | 'info' | undefined), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
simply as const
will compile properly, no need to cast to the whole enum
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
309a367
to
e16ed06
Compare
No description provided.