You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: 0036_external_job_id.go
    path of file: ./repos/chainlink/core/store/migrate/migrations
    
    the code of the file until where you have to start completion: package migrations

import (
	"context"
	"database/
    
func Up36(ctx context.Context, tx *sql.Tx) error {
	// Add the external ID column and remove type specific ones.
	if _, err := tx.ExecContext(ctx, up36_1); err != nil {
		return err
	}

	// Update all jobs to have an external_job_id.
	// We do this to avoid using the uuid postgres extension.
	var jobIDs []int32
	txx := sqlx.Tx{Tx: tx}
	if err := txx.SelectContext(ctx, &jobIDs, "SELECT id FROM jobs"); err != nil {
		return err
	}
	if len(jobIDs) != 0 {
		stmt := `UPDATE jobs AS j SET external_job_id = vals.external_job_id FROM (values `
		for i := range jobIDs {
			if i == len(jobIDs)-1 {
				stmt += fmt.Sprintf("(uuid('%s'), %d))", uuid.New(), jobIDs[i])
			} else {
				stmt += fmt.Sprintf("(uuid('%s'), %d),", uuid.New(), jobIDs[i])
			}
		}
		stmt += ` AS vals(external_job_id, id) WHERE vals.id = j.id`
		if _, err := tx.ExecContext(ctx, stmt); err != nil {
			return err

		}
	}

	// Add constraints on the external_job_id.
	if _, err := tx.ExecContext(ctx, up36_2); err != nil {
		return err
	}
	return nil
}