2022-07-26 20:19:09 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
2023-02-02 17:15:17 -08:00
|
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
|
|
2021-09-10 09:31:27 -04:00
|
|
|
// 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"
|
2022-07-26 20:19:09 +00:00
|
|
|
"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"
|
2021-09-10 09:31:27 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// postgres contains the migrations sql files for postgres oss edition
|
2022-08-25 09:12:24 -07:00
|
|
|
//
|
2021-09-10 09:31:27 -04: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,
|
|
|
|
|
},
|
|
|
|
|
}
|
2022-07-26 20:19:09 +00:00
|
|
|
|
2021-09-10 09:31:27 -04:00
|
|
|
func init() {
|
2022-07-26 20:19:09 +00:00
|
|
|
schema.RegisterEdition("oss", schema.Postgres, postgres, 0, edition.WithPreHooks(prehooks))
|
2021-09-10 09:31:27 -04:00
|
|
|
}
|