Skip to main content

add_integrations.go

007_add_integrations.go - Overview

  1. Overview This file defines a SQL migration to add tables related to integrations. It includes creating tables for integrations_installed, cloud_integrations_accounts, and cloud_integrations_service_configs.

  2. Detailed Documentation

addIntegrations

  • Purpose: Struct representing the SQL migration to add integration tables.

NewAddIntegrationsFactory

  • Purpose: Creates a new factory for addIntegrations SQL migrations.
  • Returns: A factory.ProviderFactory[SQLMigration, Config] for add_integrations.

newAddIntegrations

  • Purpose: Creates a new addIntegrations instance.
  • Parameters:
    • _: context.Context - Context (not used).
    • _: factory.ProviderSettings - Provider settings (not used).
    • _: Config - Configuration (not used).
  • Returns: A SQLMigration and an error.

(*addIntegrations) Register

  • Purpose: Registers the Up and Down migration functions.
  • Parameters:
    • migrations: *migrate.Migrations - The migrations to register with.
  • Returns: An error, if any.

(*addIntegrations) Up

  • Purpose: Defines the "up" migration, which creates the integrations_installed, cloud_integrations_accounts, and cloud_integrations_service_configs tables if they do not already exist.
  • Parameters:
    • ctx: context.Context - The context for the operation.
    • db: *bun.DB - The database connection.
  • Returns: An error, if any.

(*addIntegrations) Down

  • Purpose: Defines the "down" migration, which currently does nothing (no rollback).
  • Parameters:
    • ctx: context.Context - The context for the operation.
    • db: *bun.DB - The database connection.
  • Returns: An error, if any.

Include in Getting Started: NO