add_integrations.go
007_add_integrations.go - Overview
-
Overview This file defines a SQL migration to add tables related to integrations. It includes creating tables for
integrations_installed
,cloud_integrations_accounts
, andcloud_integrations_service_configs
. -
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]
foradd_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
, andcloud_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