Clarify comment on golang-migrate connection (#19104)

The old comment wasn't exactly clear on
why is it needed to spawn a new connection.

```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2021-12-03 18:45:43 +05:30
коммит произвёл GitHub
родитель 8a62bfaa65
Коммит 6a7067e4b6

Просмотреть файл

@@ -1429,8 +1429,11 @@ func (ss *SqlStore) migrate(direction migrationDirection) error {
var driver database.Driver
var err error
// When WithInstance is used in golang-migrate, the underlying driver connections are not tracked.
// So we will have to open a fresh connection for migrations and explicitly close it when all is done.
// golang-migrate doesn't have a way to reuse an existing connection in a migration.
// The current API will always close the current connection _as well as_ the *sql.DB
// instance along with it. Which means that we cannot pass an existing DB instance,
// because it will be closed. Therefore, we always have to create a new instance,
// and therefore a new connection.
dataSource, err := ss.appendMultipleStatementsFlag(*ss.settings.DataSource)
if err != nil {
return err