Skip to content

Commit

Permalink
WIP: Update DBs and clients for ingest and storage
Browse files Browse the repository at this point in the history
  • Loading branch information
jraddaoui committed Feb 10, 2025
1 parent be57611 commit dd6d7dc
Show file tree
Hide file tree
Showing 77 changed files with 5,022 additions and 4,847 deletions.
16 changes: 13 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ else
endif

include hack/make/bootstrap.mk
include hack/make/dep_atlas.mk
include hack/make/dep_ent.mk
include hack/make/dep_go_enums.mk
include hack/make/dep_goa.mk
Expand All @@ -30,7 +31,8 @@ include hack/make/dep_tparse.mk
include hack/make/dep_workflowcheck.mk

# Lazy-evaluated list of tools.
TOOLS = $(ENT) \
TOOLS = $(ATLAS) \
$(ENT) \
$(GO_ENUM) \
$(GOA) \
$(GOLANGCI_LINT) \
Expand Down Expand Up @@ -68,6 +70,14 @@ TEST_IGNORED_PACKAGES = $(filter $(IGNORED_PACKAGES),$(PACKAGES))

export PATH:=$(GOBIN):$(PATH)

atlas-hash: $(ATLAS) # @HELP Recalculate the migration hashes.
atlas migrate hash \
--dir="file://internal/db/migrations" \
--dir-format="atlas"
atlas migrate hash \
--dir="file://internal/storage/persistence/migrations" \
--dir-format="atlas"

db: # @HELP Opens the MySQL shell connected to the enduro development database.
db:
mysql -h127.0.0.1 -P3306 -uroot -proot123 enduro
Expand Down Expand Up @@ -106,8 +116,8 @@ gen-enums: # @HELP Generate go-enum assets.
gen-enums: ENUM_FLAGS = --names --template=$(CURDIR)/hack/make/enums.tmpl
gen-enums: $(GO_ENUM)
go-enum $(ENUM_FLAGS) \
-f internal/enums/package_type.go \
-f internal/enums/pkg_status.go \
-f internal/enums/sip_type.go \
-f internal/enums/sip_status.go \
-f internal/enums/preprocessing_task_outcome.go \
-f internal/enums/pres_action_status.go \
-f internal/enums/pres_action_type.go \
Expand Down
71 changes: 43 additions & 28 deletions cmd/migrate/main.go
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
// Example:
// Example (ingest):
//
// 1. Make changes to schema files (internal/persistence/ent/schema),
// 2. Re-generate (make gen-ent),
// 3. Use an empty MySQL database,
// 4. Run:
// $ go run ./cmd/migrate/ \
// --db="ingest" \
// --dsn="mysql://root:root123@tcp(localhost:3306)/enduro_migrate" \
// --path="./internal/db/migrations" \
// --name="changes"
//
// Example (storage):
//
// 1. Make changes to schema files (internal/storage/persistence/ent/schema),
// 2. Re-generate (make gen-ent),
// 3. Drop any existing database tables or delete and re-create the database,
// 3. Use an empty MySQL database,
// 4. Run:
// $ go run ./cmd/migrate/ \
// --config="./enduro.toml" \
// --dsn="mysql://enduro:enduro123@tcp(localhost:3306)/enduro_storage" \
// --name="init" \
// --path="./internal/storage/persistence/migrations"
// --db="storage" \
// --dsn="mysql://root:root123@tcp(localhost:3306)/enduro_migrate" \
// --path="./internal/storage/persistence/migrations" \
// --name="changes"
package main

import (
"context"
"fmt"
"log"
"os"
"path/filepath"
"strings"

"ariga.io/atlas/sql/sqltool"
Expand All @@ -25,40 +36,38 @@ import (
"github.com/go-sql-driver/mysql"
"github.com/spf13/pflag"

"github.com/artefactual-sdps/enduro/internal/config"
"github.com/artefactual-sdps/enduro/internal/storage/persistence/ent/db/migrate"
ingest_migrate "github.com/artefactual-sdps/enduro/internal/persistence/ent/db/migrate"
storage_migrate "github.com/artefactual-sdps/enduro/internal/storage/persistence/ent/db/migrate"
)

func main() {
p := pflag.NewFlagSet("migrate", pflag.ExitOnError)
p.String("config", "", "Configuration file")
p.String("db", "", "Enduro database ('ingest' or 'storage')")

Check warning on line 45 in cmd/migrate/main.go

View check run for this annotation

Codecov / codecov/patch

cmd/migrate/main.go#L45

Added line #L45 was not covered by tests
p.String("dsn", "", "MySQL DSN")
p.String("path", "", "Migration directory")
p.String("name", "changes", "Migration name")
_ = p.Parse(os.Args[1:])

path, _ := p.GetString("path")
if path == "" {
wd, err := os.Getwd()
if err != nil {
os.Exit(1)
}
// Guessing that running it from the root folder.
path = filepath.Join(wd, "internal/storage/persistence/migrations")
db, _ := p.GetString("db")
if db == "" {
fmt.Printf("--db flag is missing")
os.Exit(1)
}
if db != "ingest" && db != "storage" {
fmt.Printf("--db flag has an unexpected value (use 'ingest' or 'storage')")
os.Exit(1)

Check warning on line 58 in cmd/migrate/main.go

View check run for this annotation

Codecov / codecov/patch

cmd/migrate/main.go#L51-L58

Added lines #L51 - L58 were not covered by tests
}

var cfg config.Configuration
configFile, _ := p.GetString("config")
_, _, err := config.Read(&cfg, configFile)
if err != nil {
fmt.Printf("Failed to read configuration: %v\n", err)
DSN, _ := p.GetString("dsn")
if DSN == "" {
fmt.Printf("--dsn flag is missing")

Check warning on line 63 in cmd/migrate/main.go

View check run for this annotation

Codecov / codecov/patch

cmd/migrate/main.go#L61-L63

Added lines #L61 - L63 were not covered by tests
os.Exit(1)
}

DSN := cfg.Storage.Database.DSN
flagDSN, _ := p.GetString("dsn")
if flagDSN != "" {
DSN = flagDSN
path, _ := p.GetString("path")
if path == "" {
fmt.Printf("--path flag is missing")
os.Exit(1)

Check warning on line 70 in cmd/migrate/main.go

View check run for this annotation

Codecov / codecov/patch

cmd/migrate/main.go#L67-L70

Added lines #L67 - L70 were not covered by tests
}

// MySQL's DSN format is not accepted by Ent, convert as needed (remove Net).
Expand Down Expand Up @@ -89,11 +98,17 @@ func main() {
schema.WithDir(dir), // provide migration directory
schema.WithMigrationMode(schema.ModeReplay), // provide migration mode
schema.WithDialect(dialect.MySQL), // Ent dialect to use
schema.WithDropIndex(true),
schema.WithDropColumn(true),

Check warning on line 102 in cmd/migrate/main.go

View check run for this annotation

Codecov / codecov/patch

cmd/migrate/main.go#L101-L102

Added lines #L101 - L102 were not covered by tests
}

// Generate migrations using Atlas support for TiDB (note the Ent dialect option passed above).
name, _ := p.GetString("name")
err = migrate.NamedDiff(ctx, entDSN, name, opts...)
if db == "ingest" {
err = ingest_migrate.NamedDiff(ctx, entDSN, name, opts...)
} else {
err = storage_migrate.NamedDiff(ctx, entDSN, name, opts...)
}

Check warning on line 111 in cmd/migrate/main.go

View check run for this annotation

Codecov / codecov/patch

cmd/migrate/main.go#L107-L111

Added lines #L107 - L111 were not covered by tests
if err != nil {
log.Fatalf("failed generating migration file: %v", err)
}
Expand Down
6 changes: 4 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/artefactual-sdps/enduro
go 1.23.2

require (
ariga.io/atlas v0.19.2
ariga.io/atlas v0.31.0
ariga.io/sqlcomment v0.1.0
buf.build/gen/go/artefactual/a3m/grpc/go v1.3.0-20230508184533-2e9432075630.2
buf.build/gen/go/artefactual/a3m/protocolbuffers/go v1.31.0-20230508184533-2e9432075630.2
Expand Down Expand Up @@ -95,6 +95,7 @@ require (
github.com/aws/aws-sdk-go-v2/service/sts v1.30.3 // indirect
github.com/aws/smithy-go v1.20.3 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bmatcuk/doublestar v1.3.4 // indirect
github.com/bodgit/plumbing v1.2.0 // indirect
github.com/bodgit/sevenzip v1.3.0 // indirect
github.com/bodgit/windows v1.0.0 // indirect
Expand Down Expand Up @@ -157,7 +158,8 @@ require (
github.com/therootcompany/xz v1.0.1 // indirect
github.com/ulikunitz/xz v0.5.11 // indirect
github.com/yuin/gopher-lua v1.1.1 // indirect
github.com/zclconf/go-cty v1.14.1 // indirect
github.com/zclconf/go-cty v1.14.4 // indirect
github.com/zclconf/go-cty-yaml v1.1.0 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0 // indirect
go.opentelemetry.io/otel/metric v1.29.0 // indirect
Expand Down
12 changes: 8 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ariga.io/atlas v0.19.2 h1:ulK06d4joEaMP06HNNPxdpD8dFgZGzjzjk+Mb5VfF08=
ariga.io/atlas v0.19.2/go.mod h1:VPlcXdd4w2KqKnH54yEZcry79UAhpaWaxEsmn5JRNoE=
ariga.io/atlas v0.31.0 h1:Nw6/Jdc7OpZfiy6oh/dJAYPp5XxGYvMTWLOUutwWjeY=
ariga.io/atlas v0.31.0/go.mod h1:J3chwsQAgjDF6Ostz7JmJJRTCbtqIupUbVR/gqZrMiA=
ariga.io/sqlcomment v0.1.0 h1:8kQPlVe3sXpTloEFlpX5dhFAXB28i6rwq9ktqqnPx70=
ariga.io/sqlcomment v0.1.0/go.mod h1:NT1IZMfBTQl1MUU5wgVONmnDqFRqtZrdDRgAXfc1g5k=
buf.build/gen/go/artefactual/a3m/grpc/go v1.3.0-20230508184533-2e9432075630.2 h1:+AADIVDD4GabjtfMHO/M9WIQBc/0IXN7ddYuN8VU8tc=
Expand Down Expand Up @@ -487,6 +487,8 @@ github.com/aws/smithy-go v1.20.3/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bmatcuk/doublestar v1.3.4 h1:gPypJ5xD31uhX6Tf54sDPUOBXTqKH4c9aPY66CyQrS0=
github.com/bmatcuk/doublestar v1.3.4/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE=
github.com/bodgit/plumbing v1.2.0 h1:gg4haxoKphLjml+tgnecR4yLBV5zo4HAZGCtAh3xCzM=
github.com/bodgit/plumbing v1.2.0/go.mod h1:b9TeRi7Hvc6Y05rjm8VML3+47n4XTZPtQ/5ghqic2n8=
github.com/bodgit/sevenzip v1.3.0 h1:1ljgELgtHqvgIp8W8kgeEGHIWP4ch3xGI8uOBZgLVKY=
Expand Down Expand Up @@ -940,8 +942,10 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M=
github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw=
github.com/zclconf/go-cty v1.14.1 h1:t9fyA35fwjjUMcmL5hLER+e/rEPqrbCK1/OSE4SI9KA=
github.com/zclconf/go-cty v1.14.1/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE=
github.com/zclconf/go-cty v1.14.4 h1:uXXczd9QDGsgu0i/QFR/hzI5NYCHLf6NQw/atrbnhq8=
github.com/zclconf/go-cty v1.14.4/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE=
github.com/zclconf/go-cty-yaml v1.1.0 h1:nP+jp0qPHv2IhUVqmQSzjvqAWcObN0KBkUl2rWBdig0=
github.com/zclconf/go-cty-yaml v1.1.0/go.mod h1:9YLUH4g7lOhVWqUbctnVlZ5KLpg7JAprQNgxSZ1Gyxs=
go.artefactual.dev/amclient v0.4.1-0.20240705155055-0c5abef5207c h1:kMgKuV9yx0LTQpkWdPxPC4GHAKMS9pDQ0x3CD8SmLfI=
go.artefactual.dev/amclient v0.4.1-0.20240705155055-0c5abef5207c/go.mod h1:oAOlZHC78IWjWDCqRM1/8K1x/WYmRUL3peujKCdoXaA=
go.artefactual.dev/tools v0.14.0 h1:ESLbemsnkdIPmYXtz0uZTcPqVnTUXIEZd9DSTRyTZqY=
Expand Down
22 changes: 22 additions & 0 deletions hack/make/dep_atlas.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
$(call _assert_var,MAKEDIR)
$(call _conditional_include,$(MAKEDIR)/base.mk)
$(call _assert_var,UNAME_OS)
$(call _assert_var,UNAME_ARCH2)
$(call _assert_var,CACHE_VERSIONS)
$(call _assert_var,CACHE_BIN)

ATLAS_VERSION ?= 0.31.0

ATLAS := $(CACHE_VERSIONS)/atlas/$(ATLAS_VERSION)
$(ATLAS):
rm -f $(CACHE_BIN)/atlas
mkdir -p $(CACHE_BIN)
$(eval TMP := $(shell mktemp -d))
$(eval OS := $(shell echo $(UNAME_OS) | tr A-Z a-z))
curl -sSL \
https://release.ariga.io/atlas/atlas-$(OS)-$(UNAME_ARCH2)-v$(ATLAS_VERSION) \
> $(CACHE_BIN)/atlas
chmod +x $(CACHE_BIN)/atlas
rm -rf $(dir $(ATLAS))
mkdir -p $(dir $(ATLAS))
touch $(ATLAS)
4 changes: 2 additions & 2 deletions internal/am/job_tracker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func TestConvertJobToPreservationTask(t *testing.T) {
want: datatypes.PreservationTask{
TaskID: "f60018ac-da79-4769-9509-c6c41d5efe7e",
Name: "Move to processing directory",
Status: enums.PreservationTaskStatus(enums.PackageStatusDone),
Status: enums.PreservationTaskStatus(enums.SIPStatusDone),
StartedAt: sql.NullTime{
Time: time.Date(2024, time.January, 18, 1, 27, 49, 0, time.UTC),
Valid: true,
Expand Down Expand Up @@ -251,7 +251,7 @@ func TestConvertJobToPreservationTask(t *testing.T) {
want: datatypes.PreservationTask{
TaskID: "c2128d39-2ace-47c5-8cac-39ded8d9c9ef",
Name: "Verify SIP compliance",
Status: enums.PreservationTaskStatus(enums.PackageStatusInProgress),
Status: enums.PreservationTaskStatus(enums.SIPStatusInProgress),
StartedAt: sql.NullTime{
Time: time.Date(2024, time.January, 18, 1, 27, 49, 0, time.UTC),
Valid: true,
Expand Down
4 changes: 2 additions & 2 deletions internal/api/design/package_.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ var _ = Service("package", func() {
})

var EnumPackageStatus = func() {
Enum(enums.PackageStatusInterfaces()...)
Enum(enums.SIPStatusInterfaces()...)
}

var Package_ = Type("Package", func() {
Expand All @@ -275,7 +275,7 @@ var Package_ = Type("Package", func() {
TypedAttributeUUID("location_id", "Identifier of storage location")
Attribute("status", String, "Status of the package", func() {
EnumPackageStatus()
Default(enums.PackageStatusNew.String())
Default(enums.SIPStatusNew.String())
})
AttributeUUID("workflow_id", "Identifier of processing workflow")
AttributeUUID("run_id", "Identifier of latest processing workflow run")
Expand Down
2 changes: 1 addition & 1 deletion internal/datatypes/preservation_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ type PreservationAction struct {
Status enums.PreservationActionStatus `db:"status"`
StartedAt sql.NullTime `db:"started_at"`
CompletedAt sql.NullTime `db:"completed_at"`
PackageID int `db:"package_id"`
SIPID int `db:"sip_id"`
}
20 changes: 10 additions & 10 deletions internal/datatypes/package_.go → internal/datatypes/sip.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ import (
"github.com/artefactual-sdps/enduro/internal/enums"
)

// Package represents a package in the package table.
type Package struct {
ID int `db:"id"`
Name string `db:"name"`
WorkflowID string `db:"workflow_id"`
RunID string `db:"run_id"`
AIPID uuid.NullUUID `db:"aip_id"` // Nullable.
LocationID uuid.NullUUID `db:"location_id"` // Nullable.
Status enums.PackageStatus `db:"status"`
// SIP represents a SIP in the sip table.
type SIP struct {
ID int `db:"id"`
Name string `db:"name"`
WorkflowID string `db:"workflow_id"`
RunID string `db:"run_id"`
AIPID uuid.NullUUID `db:"aip_id"` // Nullable.
LocationID uuid.NullUUID `db:"location_id"` // Nullable.
Status enums.SIPStatus `db:"status"`

// It defaults to CURRENT_TIMESTAMP(6) so populated as soon as possible.
CreatedAt time.Time `db:"created_at"`
Expand All @@ -33,7 +33,7 @@ type Package struct {
}

// Goa returns the API representation of the package.
func (p *Package) Goa() *goapackage.EnduroStoredPackage {
func (p *SIP) Goa() *goapackage.EnduroStoredPackage {
if p == nil {
return nil
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-- drop foreign key constraint from "preservation_action" table
ALTER TABLE `preservation_action` DROP FOREIGN KEY `preservation_action_ibfk_1`;
-- rename column from "sip_id" to "package_id"
ALTER TABLE `preservation_action` CHANGE COLUMN `sip_id` `package_id` INT UNSIGNED NOT NULL;
-- rename table from "sip" to "package"
RENAME TABLE `sip` TO `package`;
-- recreate foreign key constraint
ALTER TABLE `preservation_action` ADD CONSTRAINT `preservation_action_ibfk_1` FOREIGN KEY (`package_id`) REFERENCES `package` (`id`) ON DELETE CASCADE;
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-- drop foreign key constraint from "preservation_action" table
ALTER TABLE `preservation_action` DROP FOREIGN KEY `preservation_action_ibfk_1`;
-- rename column from "package_id" to "sip_id"
ALTER TABLE `preservation_action` CHANGE COLUMN `package_id` `sip_id` INT UNSIGNED NOT NULL;
-- rename table from "package" to "sip"
RENAME TABLE `package` TO `sip`;
-- recreate foreign key constraint
ALTER TABLE `preservation_action` ADD CONSTRAINT `preservation_action_ibfk_1` FOREIGN KEY (`sip_id`) REFERENCES `sip` (`id`) ON DELETE CASCADE;
49 changes: 49 additions & 0 deletions internal/db/migrations/20250210184720_use_atlas.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
-- drop foreign key constraint from "preservation_action" table
ALTER TABLE `preservation_action` DROP FOREIGN KEY `preservation_action_sip_preservation_actions`;
-- modify "sip" table
ALTER TABLE `sip` COLLATE utf8mb4_0900_ai_ci,
MODIFY COLUMN `id` int unsigned NOT NULL AUTO_INCREMENT,
MODIFY COLUMN `name` varchar(2048) NOT NULL COLLATE utf8mb4_0900_ai_ci,
MODIFY COLUMN `workflow_id` varchar(255) NOT NULL COLLATE utf8mb4_0900_ai_ci,
MODIFY COLUMN `run_id` varchar(36) NOT NULL COLLATE utf8mb4_0900_ai_ci,
MODIFY COLUMN `aip_id` varchar(36) NULL COLLATE utf8mb4_0900_ai_ci,
MODIFY COLUMN `location_id` varchar(36) NULL COLLATE utf8mb4_0900_ai_ci,
MODIFY COLUMN `created_at` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
MODIFY COLUMN `started_at` timestamp(6) NULL,
MODIFY COLUMN `completed_at` timestamp(6) NULL,
DROP INDEX `sip_aip_id_idx`,
DROP INDEX `sip_created_at_idx`,
DROP INDEX `sip_location_id_idx`,
DROP INDEX `sip_name_idx`,
DROP INDEX `sip_started_at_idx`,
DROP INDEX `sip_status_idx`,
ADD INDEX `package_aip_id_idx` (`aip_id`),
ADD INDEX `package_created_at_idx` (`created_at`),
ADD INDEX `package_location_id_idx` (`location_id`),
ADD INDEX `package_name_idx` (`name` (50)),
ADD INDEX `package_started_at_idx` (`started_at`),
ADD INDEX `package_status_idx` (`status`);
-- drop foreign key constraint from "preservation_task" table
ALTER TABLE `preservation_task` DROP FOREIGN KEY `preservation_task_preservation_action_tasks`;
-- modify "preservation_action" table
ALTER TABLE `preservation_action` COLLATE utf8mb4_0900_ai_ci,
MODIFY COLUMN `id` int unsigned NOT NULL AUTO_INCREMENT,
MODIFY COLUMN `workflow_id` varchar(255) NOT NULL COLLATE utf8mb4_0900_ai_ci,
MODIFY COLUMN `started_at` timestamp(6) NULL,
MODIFY COLUMN `completed_at` timestamp(6) NULL,
MODIFY COLUMN `sip_id` int unsigned NOT NULL,
DROP INDEX `preservation_action_sip_preservation_actions`,
ADD CONSTRAINT `preservation_action_ibfk_1`
FOREIGN KEY (`sip_id`) REFERENCES `sip` (`id`) ON UPDATE NO ACTION ON DELETE CASCADE;
-- modify "preservation_task" table
ALTER TABLE `preservation_task` COLLATE utf8mb4_0900_ai_ci,
MODIFY COLUMN `id` int unsigned NOT NULL AUTO_INCREMENT,
MODIFY COLUMN `task_id` varchar(36) NOT NULL COLLATE utf8mb4_0900_ai_ci,
MODIFY COLUMN `name` varchar(2048) NOT NULL COLLATE utf8mb4_0900_ai_ci,
MODIFY COLUMN `started_at` timestamp(6) NULL,
MODIFY COLUMN `completed_at` timestamp(6) NULL,
MODIFY COLUMN `note` longtext NOT NULL COLLATE utf8mb4_0900_ai_ci,
MODIFY COLUMN `preservation_action_id` int unsigned NOT NULL,
DROP INDEX `preservation_task_preservation_action_tasks`,
ADD CONSTRAINT `preservation_task_ibfk_1`
FOREIGN KEY (`preservation_action_id`) REFERENCES `preservation_action` (`id`) ON UPDATE NO ACTION ON DELETE CASCADE;
Loading

0 comments on commit dd6d7dc

Please sign in to comment.