-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Ensure --force-reset drops previous tables #10506
Conversation
🦋 Changeset detectedLatest commit: 6ba223a The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
// When doing a reset, first create DROP TABLE statements, then treat everything | ||
// else as creation. | ||
if(reset) { | ||
const curSnapshot = oldSnapshot; |
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.
nit current
> cur
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.
actually, this name is a bit confusing, since it's not really the current snapshot right? Maybe like originalOldSnapshot
?
}): Promise<{ queries: string[]; confirmations: string[] }> { | ||
const queries: string[] = []; | ||
let queries: string[] = []; |
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.
nit: can we keep this as a const, and instead of overwriting the array do queries.push(...getDropTableQueriesForSnapshot(curSnapshot))
? My fear is that future devs blow away existing queries accidentally by re-assigning
]); | ||
}); | ||
|
||
it('should not drop table when previous snapshot did not have it', async () => { |
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.
good test 👍
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.
overall strong +1 !!! Left a few nit comments but resolve them at will
Changes
--force-reset
did not include DROP TABLE statementsTesting
Docs
N/A, bug fix