Skip to content

Commit

Permalink
indexer-agent: Fix subgraph identifier migration of existing rules
Browse files Browse the repository at this point in the history
  • Loading branch information
fordN committed Feb 23, 2022
1 parent 3e4678c commit e1c9546
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,16 @@ export async function up({ context }: Context): Promise<void> {
await queryInterface.addColumn('IndexingRules', 'identifierType', {
type: DataTypes.ENUM('deployment', 'subgraph', 'group'),
primaryKey: true,
defaultValue: 'group',
defaultValue: 'deployment',
})

logger.info(`Rename 'deployment' column to 'identifier'`)
await queryInterface.renameColumn('IndexingRules', 'deployment', 'identifier')

logger.info(`Update identifierType value for existing rules`)
await queryInterface.sequelize.query(
`update "IndexingRules" set "identifierType" = 'group' where "identifier" = 'global'`,
)
}

export async function down({ context }: Context): Promise<void> {
Expand Down

0 comments on commit e1c9546

Please # to comment.