-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Fix column removal in MSSQL #3638
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3638 +/- ##
==========================================
- Coverage 35.92% 35.89% -0.04%
==========================================
Files 286 286
Lines 41257 41286 +29
==========================================
- Hits 14823 14820 -3
- Misses 24255 24286 +31
- Partials 2179 2180 +1
Continue to review full report at Codecov.
|
models/migrations/migrations.go
Outdated
return fmt.Errorf("Find constraints: %v", err) | ||
} | ||
for _, constraint := range constraints { | ||
if _, err := x.Exec(fmt.Sprintf("ALTER TABLE `%s` DROP CONSTRAINT `%s`", tableName, constraint)); err != nil { |
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.
How about use a transaction here?
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.
Alter table is not transactional but I can add it
@lunny done |
5ffd16f
to
8d92ba4
Compare
MSSQL alter table is actually transaction so I added transaction as well |
* Fix column removal in MSSQL * Use xorm session in MSSQL drop column operations * Add transaction as MSSQL alter table is transactional
Fix go-gitea#3638 This is a manual Forgejo-specific version of the Gitea PR go-gitea#30862. The weekly Forgejo PR go-gitea#3772 could not cherry-pick this commit due to conflicts (eg subsequent CodeSpell changes). Only occurs with Webkit in Safari over eg `http://192..`. (not localhost). See https://webkit.org/blog/10855/async-clipboard-api/ --- **Before**  **After**  Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3805 Reviewed-by: Otto <[email protected]> Co-authored-by: David Davies-Payne <[email protected]> Co-committed-by: David Davies-Payne <[email protected]> (cherry picked from commit e4c3c03)
Fixes #3624