d4x1 commented on code in PR #6505:
URL:
https://github.com/apache/incubator-devlake/pull/6505#discussion_r1403144616
##########
backend/server/services/locking.go:
##########
@@ -44,11 +44,12 @@ func lockDatabase() {
}
errors.Must(db.Create(lockingHistory))
// 2. obtain the lock: using a never released transaction
- // This prevent multiple devlake instances from sharing the same
database by locking the migration history table
+ // This prevents multiple devlake instances from sharing the same
database by locking the migration history table
// However, it would not work if any older devlake instances were
already using the database.
lockingTx = db.Begin()
c := make(chan bool, 1)
go func() {
+
errors.Must(lockingTx.DropTables(models.LockingStub{}.TableName()))
Review Comment:
Because primary keys cannot be `AutoMigrate` if old table exists.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]