Files
threshold/internal/db/schema/migrations/oss/oss.go
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
948 B
Go
Raw Normal View History

// Copyright (c) HashiCorp, Inc.
2023-02-02 17:15:17 -08:00
// SPDX-License-Identifier: BUSL-1.1
// Package oss is used to embed the sql statements for the oss edition and
// registering the edition for the schema.Manager.
package oss
import (
"embed"
"github.com/hashicorp/boundary/internal/db/schema"
"github.com/hashicorp/boundary/internal/db/schema/internal/edition"
"github.com/hashicorp/boundary/internal/db/schema/migration"
2022-07-20 16:24:46 -07:00
"github.com/hashicorp/boundary/internal/db/schema/migrations/oss/internal/hook46001"
)
// postgres contains the migrations sql files for postgres oss edition
2022-08-25 09:12:24 -07:00
//
//go:embed postgres
var postgres embed.FS
2022-07-20 16:24:46 -07:00
var prehooks = map[int]*migration.Hook{
46001: {
CheckFunc: hook46001.FindIllegalAssociations,
RepairFunc: hook46001.RepairIllegalAssociations,
RepairDescription: hook46001.RepairDescription,
},
}
func init() {
schema.RegisterEdition("oss", schema.Postgres, postgres, 0, edition.WithPreHooks(prehooks))
}