***

title: "MigrateProductOptionGroupData"
generated: true
---------------

<GenerationInfo sourceFile="packages/core/src/migration-utils/v3_6_shared_option_groups.ts" sourceLine="43" packageName="@vendure/core" since="3.6.0" />

Populates the new join tables for shared, channel-aware ProductOptionGroups
using data from the existing `productId` FK column on `product_option_group`.

Call this from your migration's `up()` method **after** the new join tables
have been created and **before** the `productId` column is dropped.

```ts
import { MigrationInterface, QueryRunner } from 'typeorm';
import { migrateProductOptionGroupData } from '@vendure/core';

export class SharedOptionGroups1234567890 implements MigrationInterface {
    public async up(queryRunner: QueryRunner): Promise<any> {
        // --- Auto-generated DDL starts here ---
        // (Create new join tables and FK constraints)
        // ...

        // --- Populate new tables with existing data ---
        await migrateProductOptionGroupData(queryRunner);

        // --- Auto-generated DDL continues ---
        // (Drop old productId FK and column)
        // ...
    }

    public async down(queryRunner: QueryRunner): Promise<any> {
        // Auto-generated reverse DDL
    }
}
```

```ts title="Signature"
function migrateProductOptionGroupData(queryRunner: QueryRunner): Promise<void>
```

Parameters

### queryRunner

\<MemberInfo kind="parameter" type={`QueryRunner`} />
