From 0855e3bc72ff00004fa32a5f0baffb9e35184a23 Mon Sep 17 00:00:00 2001 From: Matt Spilchen Date: Fri, 17 Jan 2025 08:44:06 -0400 Subject: [PATCH] schemachanger: Lock in dependency rules for 25.1 With the 25.1 branch cut this week, we can begin creating separate dependency rules for the declarative schema changer (DSC) in 25.2. The previous rules have been copied into a release_25_1 folder. This copy was taken directly from the release_25_1 branch, as a recent change to the current rules was introduced after the 25.1 branch cut. Epic: None Informs: #136696 Release note: None --- pkg/BUILD.bazel | 3 + .../declarative-rules/invalid_version | 1 + pkg/sql/schemachanger/scplan/BUILD.bazel | 1 + .../scplan/internal/rules/current/helpers.go | 3 +- .../internal/rules/current/testdata/deprules | 900 +- .../internal/rules/release_25_1/BUILD.bazel | 65 + .../rules/release_25_1/assertions_test.go | 227 + .../rules/release_25_1/dep_add_column.go | 240 + .../rules/release_25_1/dep_add_constraint.go | 79 + .../rules/release_25_1/dep_add_index.go | 240 + .../release_25_1/dep_add_index_and_column.go | 120 + .../dep_add_index_and_constraint.go | 37 + .../rules/release_25_1/dep_add_trigger.go | 29 + .../release_25_1/dep_alter_column_type.go | 72 + .../internal/rules/release_25_1/dep_create.go | 59 + .../rules/release_25_1/dep_create_function.go | 31 + .../rules/release_25_1/dep_create_policy.go | 29 + .../rules/release_25_1/dep_drop_column.go | 307 + .../rules/release_25_1/dep_drop_constraint.go | 96 + .../rules/release_25_1/dep_drop_index.go | 205 + .../release_25_1/dep_drop_index_and_column.go | 82 + .../rules/release_25_1/dep_drop_object.go | 295 + .../rules/release_25_1/dep_drop_policy.go | 29 + .../rules/release_25_1/dep_drop_trigger.go | 31 + .../release_25_1/dep_garbage_collection.go | 153 + .../rules/release_25_1/dep_swap_index.go | 146 + .../rules/release_25_1/dep_two_version.go | 122 + .../internal/rules/release_25_1/helpers.go | 353 + .../internal/rules/release_25_1/registry.go | 47 + .../internal/rules/release_25_1/rules_test.go | 57 + .../rules/release_25_1/testdata/deprules | 9311 +++++++++++++++++ pkg/sql/schemachanger/scplan/plan.go | 2 + pkg/sql/schemachanger/screl/scalars.go | 5 +- 33 files changed, 12925 insertions(+), 452 deletions(-) create mode 100644 pkg/sql/schemachanger/scplan/internal/rules/release_25_1/BUILD.bazel create mode 100644 pkg/sql/schemachanger/scplan/internal/rules/release_25_1/assertions_test.go create mode 100644 pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_add_column.go create mode 100644 pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_add_constraint.go create mode 100644 pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_add_index.go create mode 100644 pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_add_index_and_column.go create mode 100644 pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_add_index_and_constraint.go create mode 100644 pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_add_trigger.go create mode 100644 pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_alter_column_type.go create mode 100644 pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_create.go create mode 100644 pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_create_function.go create mode 100644 pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_create_policy.go create mode 100644 pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_drop_column.go create mode 100644 pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_drop_constraint.go create mode 100644 pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_drop_index.go create mode 100644 pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_drop_index_and_column.go create mode 100644 pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_drop_object.go create mode 100644 pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_drop_policy.go create mode 100644 pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_drop_trigger.go create mode 100644 pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_garbage_collection.go create mode 100644 pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_swap_index.go create mode 100644 pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_two_version.go create mode 100644 pkg/sql/schemachanger/scplan/internal/rules/release_25_1/helpers.go create mode 100644 pkg/sql/schemachanger/scplan/internal/rules/release_25_1/registry.go create mode 100644 pkg/sql/schemachanger/scplan/internal/rules/release_25_1/rules_test.go create mode 100644 pkg/sql/schemachanger/scplan/internal/rules/release_25_1/testdata/deprules diff --git a/pkg/BUILD.bazel b/pkg/BUILD.bazel index d42f5a1ae3e6..9f95e75787c2 100644 --- a/pkg/BUILD.bazel +++ b/pkg/BUILD.bazel @@ -578,6 +578,7 @@ ALL_TESTS = [ "//pkg/sql/schemachanger/scplan/internal/opgen:opgen_test", "//pkg/sql/schemachanger/scplan/internal/rules/current:current_test", "//pkg/sql/schemachanger/scplan/internal/rules/release_24_3:release_24_3_test", + "//pkg/sql/schemachanger/scplan/internal/rules/release_25_1:release_25_1_test", "//pkg/sql/schemachanger/scplan/internal/scgraph:scgraph_test", "//pkg/sql/schemachanger/scplan:scplan_test", "//pkg/sql/schemachanger/screl:screl_test", @@ -2172,6 +2173,8 @@ GO_TARGETS = [ "//pkg/sql/schemachanger/scplan/internal/rules/current:current_test", "//pkg/sql/schemachanger/scplan/internal/rules/release_24_3:release_24_3", "//pkg/sql/schemachanger/scplan/internal/rules/release_24_3:release_24_3_test", + "//pkg/sql/schemachanger/scplan/internal/rules/release_25_1:release_25_1", + "//pkg/sql/schemachanger/scplan/internal/rules/release_25_1:release_25_1_test", "//pkg/sql/schemachanger/scplan/internal/rules:rules", "//pkg/sql/schemachanger/scplan/internal/scgraph:scgraph", "//pkg/sql/schemachanger/scplan/internal/scgraph:scgraph_test", diff --git a/pkg/cli/testdata/declarative-rules/invalid_version b/pkg/cli/testdata/declarative-rules/invalid_version index 684f175170a9..d6cf5ab49d3c 100644 --- a/pkg/cli/testdata/declarative-rules/invalid_version +++ b/pkg/cli/testdata/declarative-rules/invalid_version @@ -3,5 +3,6 @@ invalid_version ---- debug declarative-print-rules 1.1 op unsupported version number, the supported versions are: + latest latest 1000024.3 diff --git a/pkg/sql/schemachanger/scplan/BUILD.bazel b/pkg/sql/schemachanger/scplan/BUILD.bazel index ba8f4bd7f9ff..a556791196bd 100644 --- a/pkg/sql/schemachanger/scplan/BUILD.bazel +++ b/pkg/sql/schemachanger/scplan/BUILD.bazel @@ -18,6 +18,7 @@ go_library( "//pkg/sql/schemachanger/scplan/internal/rules", "//pkg/sql/schemachanger/scplan/internal/rules/current", "//pkg/sql/schemachanger/scplan/internal/rules/release_24_3", + "//pkg/sql/schemachanger/scplan/internal/rules/release_25_1", "//pkg/sql/schemachanger/scplan/internal/scgraph", "//pkg/sql/schemachanger/scplan/internal/scgraphviz", "//pkg/sql/schemachanger/scplan/internal/scstage", diff --git a/pkg/sql/schemachanger/scplan/internal/rules/current/helpers.go b/pkg/sql/schemachanger/scplan/internal/rules/current/helpers.go index 6e689d2fddaf..6a831b7a2ef3 100644 --- a/pkg/sql/schemachanger/scplan/internal/rules/current/helpers.go +++ b/pkg/sql/schemachanger/scplan/internal/rules/current/helpers.go @@ -16,10 +16,11 @@ import ( const ( // rulesVersion version of elements that can be appended to rel rule names. - rulesVersion = "-25.1" + rulesVersion = "-25.2" ) // rulesVersionKey version of elements used by this rule set. +// TODO(spilchen): Need to update this to V25_2 when it is available. var rulesVersionKey = clusterversion.V25_1 // descriptorIsNotBeingDropped creates a clause which leads to the outer clause diff --git a/pkg/sql/schemachanger/scplan/internal/rules/current/testdata/deprules b/pkg/sql/schemachanger/scplan/internal/rules/current/testdata/deprules index 2d103c9426fb..335399796592 100644 --- a/pkg/sql/schemachanger/scplan/internal/rules/current/testdata/deprules +++ b/pkg/sql/schemachanger/scplan/internal/rules/current/testdata/deprules @@ -13,12 +13,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = PUBLIC - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'CheckConstraint transitions to ABSENT uphold 2-version invariant: TRANSIENT_ABSENT->ABSENT' @@ -34,12 +34,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_ABSENT - $next-Node[CurrentStatus] = ABSENT - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'CheckConstraint transitions to ABSENT uphold 2-version invariant: TRANSIENT_VALIDATED->VALIDATED' @@ -55,12 +55,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_VALIDATED - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'CheckConstraint transitions to ABSENT uphold 2-version invariant: TRANSIENT_WRITE_ONLY->VALIDATED' @@ -76,12 +76,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'CheckConstraint transitions to ABSENT uphold 2-version invariant: VALIDATED->ABSENT' @@ -97,12 +97,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = VALIDATED - $next-Node[CurrentStatus] = ABSENT - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - nodeNotExistsWithStatusIn_TRANSIENT_VALIDATED_WRITE_ONLY_TRANSIENT_WRITE_ONLY($prev-Target) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) @@ -119,12 +119,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = WRITE_ONLY - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'CheckConstraint transitions to PUBLIC uphold 2-version invariant: ABSENT->WRITE_ONLY' @@ -140,12 +140,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = ABSENT - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'CheckConstraint transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC' @@ -161,12 +161,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = VALIDATED - $next-Node[CurrentStatus] = PUBLIC - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'CheckConstraint transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED' @@ -182,12 +182,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = WRITE_ONLY - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'CheckConstraint transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->WRITE_ONLY' @@ -203,12 +203,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = ABSENT - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'CheckConstraint transitions to TRANSIENT_ABSENT uphold 2-version invariant: PUBLIC->TRANSIENT_VALIDATED' @@ -224,12 +224,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = PUBLIC - $next-Node[CurrentStatus] = TRANSIENT_VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'CheckConstraint transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_VALIDATED->TRANSIENT_ABSENT' @@ -245,12 +245,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_VALIDATED - $next-Node[CurrentStatus] = TRANSIENT_ABSENT - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - nodeNotExistsWithStatusIn_TRANSIENT_WRITE_ONLY($prev-Target) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) @@ -267,12 +267,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY - $next-Node[CurrentStatus] = TRANSIENT_VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'CheckConstraint transitions to TRANSIENT_ABSENT uphold 2-version invariant: VALIDATED->PUBLIC' @@ -288,12 +288,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = VALIDATED - $next-Node[CurrentStatus] = PUBLIC - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'CheckConstraint transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->VALIDATED' @@ -309,12 +309,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = WRITE_ONLY - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT' @@ -330,12 +330,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = DELETE_ONLY - $next-Node[CurrentStatus] = ABSENT - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'Column transitions to ABSENT uphold 2-version invariant: PUBLIC->WRITE_ONLY' @@ -351,12 +351,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = PUBLIC - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY' @@ -372,12 +372,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = WRITE_ONLY - $next-Node[CurrentStatus] = DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'Column transitions to PUBLIC uphold 2-version invariant: ABSENT->DELETE_ONLY' @@ -393,12 +393,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = ABSENT - $next-Node[CurrentStatus] = DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'Column transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY' @@ -414,12 +414,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = DELETE_ONLY - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC' @@ -435,12 +435,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = WRITE_ONLY - $next-Node[CurrentStatus] = PUBLIC - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'ColumnNotNull transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED' @@ -456,12 +456,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = PUBLIC - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'ColumnNotNull transitions to ABSENT uphold 2-version invariant: VALIDATED->ABSENT' @@ -477,12 +477,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = VALIDATED - $next-Node[CurrentStatus] = ABSENT - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - nodeNotExistsWithStatusIn_WRITE_ONLY($prev-Target) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) @@ -499,12 +499,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = WRITE_ONLY - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'ColumnNotNull transitions to PUBLIC uphold 2-version invariant: ABSENT->WRITE_ONLY' @@ -520,12 +520,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = ABSENT - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'ColumnNotNull transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC' @@ -541,12 +541,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = VALIDATED - $next-Node[CurrentStatus] = PUBLIC - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'ColumnNotNull transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED' @@ -562,12 +562,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = WRITE_ONLY - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: Computed column expression is dropped before the column it depends on @@ -791,12 +791,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = PUBLIC - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'ForeignKeyConstraint transitions to ABSENT uphold 2-version invariant: VALIDATED->ABSENT' @@ -812,12 +812,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = VALIDATED - $next-Node[CurrentStatus] = ABSENT - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - nodeNotExistsWithStatusIn_WRITE_ONLY($prev-Target) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) @@ -834,12 +834,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = WRITE_ONLY - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'ForeignKeyConstraint transitions to PUBLIC uphold 2-version invariant: ABSENT->WRITE_ONLY' @@ -855,12 +855,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = ABSENT - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'ForeignKeyConstraint transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC' @@ -876,12 +876,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = VALIDATED - $next-Node[CurrentStatus] = PUBLIC - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'ForeignKeyConstraint transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED' @@ -897,12 +897,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = WRITE_ONLY - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: New primary index for alter column type should go public in the same stage as dropped column @@ -961,12 +961,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = BACKFILLED - $next-Node[CurrentStatus] = DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY' @@ -982,12 +982,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = BACKFILL_ONLY - $next-Node[CurrentStatus] = DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT' @@ -1003,12 +1003,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = DELETE_ONLY - $next-Node[CurrentStatus] = ABSENT - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - nodeNotExistsWithStatusIn_TRANSIENT_DELETE_ONLY_BACKFILLED_TRANSIENT_BACKFILLED_BACKFILL_ONLY_TRANSIENT_BACKFILL_ONLY($prev-Target) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) @@ -1025,12 +1025,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = MERGED - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY' @@ -1046,12 +1046,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = MERGE_ONLY - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED' @@ -1067,12 +1067,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = PUBLIC - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_ABSENT->ABSENT' @@ -1088,12 +1088,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_ABSENT - $next-Node[CurrentStatus] = ABSENT - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_BACKFILLED->DELETE_ONLY' @@ -1109,12 +1109,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_BACKFILLED - $next-Node[CurrentStatus] = DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_BACKFILL_ONLY->DELETE_ONLY' @@ -1130,12 +1130,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_BACKFILL_ONLY - $next-Node[CurrentStatus] = DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->DELETE_ONLY' @@ -1151,12 +1151,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY - $next-Node[CurrentStatus] = DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_MERGED->WRITE_ONLY' @@ -1172,12 +1172,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_MERGED - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_MERGE_ONLY->WRITE_ONLY' @@ -1193,12 +1193,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_MERGE_ONLY - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_VALIDATED->VALIDATED' @@ -1214,12 +1214,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_VALIDATED - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_WRITE_ONLY->WRITE_ONLY' @@ -1235,12 +1235,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY' @@ -1256,12 +1256,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = VALIDATED - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - nodeNotExistsWithStatusIn_TRANSIENT_VALIDATED($prev-Target) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) @@ -1278,12 +1278,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = WRITE_ONLY - $next-Node[CurrentStatus] = DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - nodeNotExistsWithStatusIn_VALIDATED_TRANSIENT_WRITE_ONLY_MERGE_ONLY_TRANSIENT_MERGE_ONLY_MERGED_TRANSIENT_MERGED($prev-Target) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) @@ -1300,12 +1300,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = ABSENT - $next-Node[CurrentStatus] = BACKFILL_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILLED->DELETE_ONLY' @@ -1321,12 +1321,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = BACKFILLED - $next-Node[CurrentStatus] = DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED' @@ -1342,12 +1342,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = BACKFILL_ONLY - $next-Node[CurrentStatus] = BACKFILLED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY' @@ -1363,12 +1363,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = DELETE_ONLY - $next-Node[CurrentStatus] = MERGE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGED->WRITE_ONLY' @@ -1384,12 +1384,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = MERGED - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGE_ONLY->MERGED' @@ -1405,12 +1405,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = MERGE_ONLY - $next-Node[CurrentStatus] = MERGED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC' @@ -1426,12 +1426,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = VALIDATED - $next-Node[CurrentStatus] = PUBLIC - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED' @@ -1447,12 +1447,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = WRITE_ONLY - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->BACKFILL_ONLY' @@ -1468,12 +1468,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = ABSENT - $next-Node[CurrentStatus] = BACKFILL_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: BACKFILLED->DELETE_ONLY' @@ -1489,12 +1489,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = BACKFILLED - $next-Node[CurrentStatus] = DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED' @@ -1510,12 +1510,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = BACKFILL_ONLY - $next-Node[CurrentStatus] = BACKFILLED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY' @@ -1531,12 +1531,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = DELETE_ONLY - $next-Node[CurrentStatus] = MERGE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: MERGED->WRITE_ONLY' @@ -1552,12 +1552,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = MERGED - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: MERGE_ONLY->MERGED' @@ -1573,12 +1573,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = MERGE_ONLY - $next-Node[CurrentStatus] = MERGED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: PUBLIC->TRANSIENT_VALIDATED' @@ -1594,12 +1594,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = PUBLIC - $next-Node[CurrentStatus] = TRANSIENT_VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_BACKFILLED->TRANSIENT_DELETE_ONLY' @@ -1615,12 +1615,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_BACKFILLED - $next-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_BACKFILL_ONLY->TRANSIENT_DELETE_ONLY' @@ -1636,12 +1636,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_BACKFILL_ONLY - $next-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT' @@ -1657,12 +1657,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY - $next-Node[CurrentStatus] = TRANSIENT_ABSENT - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - nodeNotExistsWithStatusIn_TRANSIENT_BACKFILLED_TRANSIENT_BACKFILL_ONLY($prev-Target) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) @@ -1679,12 +1679,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_MERGED - $next-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_MERGE_ONLY->TRANSIENT_WRITE_ONLY' @@ -1700,12 +1700,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_MERGE_ONLY - $next-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_VALIDATED->TRANSIENT_WRITE_ONLY' @@ -1721,12 +1721,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_VALIDATED - $next-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_WRITE_ONLY->TRANSIENT_DELETE_ONLY' @@ -1742,12 +1742,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY - $next-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - nodeNotExistsWithStatusIn_TRANSIENT_VALIDATED_TRANSIENT_MERGE_ONLY_TRANSIENT_MERGED($prev-Target) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) @@ -1764,12 +1764,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = VALIDATED - $next-Node[CurrentStatus] = PUBLIC - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->VALIDATED' @@ -1785,12 +1785,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = WRITE_ONLY - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILLED->DELETE_ONLY' @@ -1806,12 +1806,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = BACKFILLED - $next-Node[CurrentStatus] = DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY' @@ -1827,12 +1827,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = BACKFILL_ONLY - $next-Node[CurrentStatus] = DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT' @@ -1848,12 +1848,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = DELETE_ONLY - $next-Node[CurrentStatus] = ABSENT - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - nodeNotExistsWithStatusIn_BACKFILLED_BACKFILL_ONLY($prev-Target) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) @@ -1870,12 +1870,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = MERGED - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY' @@ -1891,12 +1891,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = MERGE_ONLY - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED' @@ -1912,12 +1912,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = PUBLIC - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY' @@ -1933,12 +1933,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = VALIDATED - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY' @@ -1954,12 +1954,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = WRITE_ONLY - $next-Node[CurrentStatus] = DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - nodeNotExistsWithStatusIn_VALIDATED_MERGE_ONLY_MERGED($prev-Target) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) @@ -1976,12 +1976,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = ABSENT - $next-Node[CurrentStatus] = BACKFILL_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILLED->DELETE_ONLY' @@ -1997,12 +1997,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = BACKFILLED - $next-Node[CurrentStatus] = DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED' @@ -2018,12 +2018,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = BACKFILL_ONLY - $next-Node[CurrentStatus] = BACKFILLED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY' @@ -2039,12 +2039,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = DELETE_ONLY - $next-Node[CurrentStatus] = MERGE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: MERGED->WRITE_ONLY' @@ -2060,12 +2060,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = MERGED - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: MERGE_ONLY->MERGED' @@ -2081,12 +2081,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = MERGE_ONLY - $next-Node[CurrentStatus] = MERGED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC' @@ -2102,12 +2102,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = VALIDATED - $next-Node[CurrentStatus] = PUBLIC - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED' @@ -2123,12 +2123,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = WRITE_ONLY - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT' @@ -2144,12 +2144,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = DELETE_ONLY - $next-Node[CurrentStatus] = ABSENT - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - nodeNotExistsWithStatusIn_TRANSIENT_DELETE_ONLY($prev-Target) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) @@ -2166,12 +2166,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_ABSENT - $next-Node[CurrentStatus] = ABSENT - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'TemporaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->DELETE_ONLY' @@ -2187,12 +2187,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY - $next-Node[CurrentStatus] = DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY' @@ -2208,12 +2208,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = WRITE_ONLY - $next-Node[CurrentStatus] = DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->DELETE_ONLY' @@ -2229,12 +2229,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = ABSENT - $next-Node[CurrentStatus] = DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY' @@ -2250,12 +2250,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = DELETE_ONLY - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT' @@ -2271,12 +2271,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY - $next-Node[CurrentStatus] = TRANSIENT_ABSENT - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->TRANSIENT_DELETE_ONLY' @@ -2292,12 +2292,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = WRITE_ONLY - $next-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'UniqueWithoutIndexConstraint transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED' @@ -2313,12 +2313,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = PUBLIC - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'UniqueWithoutIndexConstraint transitions to ABSENT uphold 2-version invariant: VALIDATED->ABSENT' @@ -2334,12 +2334,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = VALIDATED - $next-Node[CurrentStatus] = ABSENT - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - nodeNotExistsWithStatusIn_WRITE_ONLY($prev-Target) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) @@ -2356,12 +2356,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = WRITE_ONLY - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'UniqueWithoutIndexConstraint transitions to PUBLIC uphold 2-version invariant: ABSENT->WRITE_ONLY' @@ -2377,12 +2377,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = ABSENT - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'UniqueWithoutIndexConstraint transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC' @@ -2398,12 +2398,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = VALIDATED - $next-Node[CurrentStatus] = PUBLIC - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'UniqueWithoutIndexConstraint transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED' @@ -2419,12 +2419,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = WRITE_ONLY - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: adding a transient column compute expression moves to 'absent' after PK validation to ensures it's there for the backfill @@ -2743,7 +2743,7 @@ deprules to: column-Node query: - $column-type[Type] = '*scpb.ColumnType' - - descriptorIsNotBeingDropped-25.1($column-type) + - descriptorIsNotBeingDropped-25.2($column-type) - $column[Type] = '*scpb.Column' - joinOnColumnID($column-type, $column, $table-id, $col-id) - toAbsent($column-type-Target, $column-Target) @@ -3351,7 +3351,7 @@ deprules - $referenced-descriptor[Type] IN ['*scpb.AliasType', '*scpb.CompositeType', '*scpb.EnumType'] - $referenced-descriptor[DescID] = $fromDescID - $referencing-via-type[ReferencedTypeIDs] CONTAINS $fromDescID - - descriptorIsNotBeingDropped-25.1($referencing-via-type) + - descriptorIsNotBeingDropped-25.2($referencing-via-type) - $referencing-via-type[Type] IN ['*scpb.CheckConstraintUnvalidated', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.SecondaryIndexPartial'] - toAbsent($referenced-descriptor-Target, $referencing-via-type-Target) - $referenced-descriptor-Node[CurrentStatus] = DROPPED @@ -3813,7 +3813,7 @@ deprules - $column[Type] = '*scpb.Column' - ColumnInIndex($index-column, $index, $table-id, $column-id, $index-id) - joinOnColumnID($index-column, $column, $table-id, $column-id) - - descriptorIsNotBeingDropped-25.1($index-column) + - descriptorIsNotBeingDropped-25.2($index-column) - toAbsent($index-Target, $column-Target) - $index-Node[CurrentStatus] = ABSENT - $column-Node[CurrentStatus] = ABSENT @@ -3828,7 +3828,7 @@ deprules - $column[Type] = '*scpb.Column' - ColumnInIndex($index-column, $index, $table-id, $column-id, $index-id) - joinOnColumnID($index-column, $column, $table-id, $column-id) - - descriptorIsNotBeingDropped-25.1($index-column) + - descriptorIsNotBeingDropped-25.2($index-column) - transient($index-Target, $column-Target) - $index-Node[CurrentStatus] = TRANSIENT_ABSENT - $column-Node[CurrentStatus] = TRANSIENT_ABSENT @@ -3843,7 +3843,7 @@ deprules - $column[Type] = '*scpb.Column' - ColumnInIndex($index-column, $index, $table-id, $column-id, $index-id) - joinOnColumnID($index-column, $column, $table-id, $column-id) - - descriptorIsNotBeingDropped-25.1($index-column) + - descriptorIsNotBeingDropped-25.2($index-column) - $index-Target[TargetStatus] = TRANSIENT_ABSENT - $index-Node[CurrentStatus] = TRANSIENT_ABSENT - $column-Target[TargetStatus] = ABSENT @@ -3859,7 +3859,7 @@ deprules - $column[Type] = '*scpb.Column' - ColumnInIndex($index-column, $index, $table-id, $column-id, $index-id) - joinOnColumnID($index-column, $column, $table-id, $column-id) - - descriptorIsNotBeingDropped-25.1($index-column) + - descriptorIsNotBeingDropped-25.2($index-column) - $index-Target[TargetStatus] = ABSENT - $index-Node[CurrentStatus] = ABSENT - $column-Target[TargetStatus] = TRANSIENT_ABSENT @@ -3918,7 +3918,7 @@ deprules to: index-Node query: - $partial-predicate[Type] = '*scpb.SecondaryIndexPartial' - - descriptorIsNotBeingDropped-25.1($partial-predicate) + - descriptorIsNotBeingDropped-25.2($partial-predicate) - $index[Type] = '*scpb.SecondaryIndex' - joinOnIndexID($partial-predicate, $index, $table-id, $index-id) - toAbsent($partial-predicate-Target, $index-Target) @@ -3932,7 +3932,7 @@ deprules to: index-Node query: - $partial-predicate[Type] = '*scpb.SecondaryIndexPartial' - - descriptorIsNotBeingDropped-25.1($partial-predicate) + - descriptorIsNotBeingDropped-25.2($partial-predicate) - $index[Type] = '*scpb.SecondaryIndex' - joinOnIndexID($partial-predicate, $index, $table-id, $index-id) - transient($partial-predicate-Target, $index-Target) @@ -3946,7 +3946,7 @@ deprules to: index-Node query: - $partial-predicate[Type] = '*scpb.SecondaryIndexPartial' - - descriptorIsNotBeingDropped-25.1($partial-predicate) + - descriptorIsNotBeingDropped-25.2($partial-predicate) - $index[Type] = '*scpb.SecondaryIndex' - joinOnIndexID($partial-predicate, $index, $table-id, $index-id) - $partial-predicate-Target[TargetStatus] = TRANSIENT_ABSENT @@ -3961,7 +3961,7 @@ deprules to: index-Node query: - $partial-predicate[Type] = '*scpb.SecondaryIndexPartial' - - descriptorIsNotBeingDropped-25.1($partial-predicate) + - descriptorIsNotBeingDropped-25.2($partial-predicate) - $index[Type] = '*scpb.SecondaryIndex' - joinOnIndexID($partial-predicate, $index, $table-id, $index-id) - $partial-predicate-Target[TargetStatus] = ABSENT @@ -4276,7 +4276,7 @@ deprules - $secondary-partial-index[Type] = '*scpb.SecondaryIndex' - $column[Type] = '*scpb.Column' - joinOnDescID($secondary-partial-index, $column, $table-id) - - descriptorIsNotBeingDropped-25.1($secondary-partial-index) + - descriptorIsNotBeingDropped-25.2($secondary-partial-index) - secondaryIndexReferencesColumn(*scpb.SecondaryIndex, *scpb.Column)($secondary-partial-index, $column) - toAbsent($secondary-partial-index-Target, $column-Target) - $secondary-partial-index-Node[CurrentStatus] = DELETE_ONLY @@ -4291,7 +4291,7 @@ deprules - $secondary-partial-index[Type] = '*scpb.SecondaryIndex' - $column[Type] = '*scpb.Column' - joinOnDescID($secondary-partial-index, $column, $table-id) - - descriptorIsNotBeingDropped-25.1($secondary-partial-index) + - descriptorIsNotBeingDropped-25.2($secondary-partial-index) - secondaryIndexReferencesColumn(*scpb.SecondaryIndex, *scpb.Column)($secondary-partial-index, $column) - transient($secondary-partial-index-Target, $column-Target) - $secondary-partial-index-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY @@ -4306,7 +4306,7 @@ deprules - $secondary-partial-index[Type] = '*scpb.SecondaryIndex' - $column[Type] = '*scpb.Column' - joinOnDescID($secondary-partial-index, $column, $table-id) - - descriptorIsNotBeingDropped-25.1($secondary-partial-index) + - descriptorIsNotBeingDropped-25.2($secondary-partial-index) - secondaryIndexReferencesColumn(*scpb.SecondaryIndex, *scpb.Column)($secondary-partial-index, $column) - $secondary-partial-index-Target[TargetStatus] = TRANSIENT_ABSENT - $secondary-partial-index-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY @@ -4322,7 +4322,7 @@ deprules - $secondary-partial-index[Type] = '*scpb.SecondaryIndex' - $column[Type] = '*scpb.Column' - joinOnDescID($secondary-partial-index, $column, $table-id) - - descriptorIsNotBeingDropped-25.1($secondary-partial-index) + - descriptorIsNotBeingDropped-25.2($secondary-partial-index) - secondaryIndexReferencesColumn(*scpb.SecondaryIndex, *scpb.Column)($secondary-partial-index, $column) - $secondary-partial-index-Target[TargetStatus] = ABSENT - $secondary-partial-index-Node[CurrentStatus] = DELETE_ONLY @@ -4338,7 +4338,7 @@ deprules - $secondary-partial-index[Type] = '*scpb.SecondaryIndexPartial' - $column[Type] = '*scpb.Column' - joinOnDescID($secondary-partial-index, $column, $table-id) - - descriptorIsNotBeingDropped-25.1($secondary-partial-index) + - descriptorIsNotBeingDropped-25.2($secondary-partial-index) - secondaryIndexReferencesColumn(*scpb.SecondaryIndexPartial, *scpb.Column)($secondary-partial-index, $column) - toAbsent($secondary-partial-index-Target, $column-Target) - $secondary-partial-index-Node[CurrentStatus] = ABSENT @@ -4353,7 +4353,7 @@ deprules - $secondary-partial-index[Type] = '*scpb.SecondaryIndexPartial' - $column[Type] = '*scpb.Column' - joinOnDescID($secondary-partial-index, $column, $table-id) - - descriptorIsNotBeingDropped-25.1($secondary-partial-index) + - descriptorIsNotBeingDropped-25.2($secondary-partial-index) - secondaryIndexReferencesColumn(*scpb.SecondaryIndexPartial, *scpb.Column)($secondary-partial-index, $column) - transient($secondary-partial-index-Target, $column-Target) - $secondary-partial-index-Node[CurrentStatus] = TRANSIENT_ABSENT @@ -4368,7 +4368,7 @@ deprules - $secondary-partial-index[Type] = '*scpb.SecondaryIndexPartial' - $column[Type] = '*scpb.Column' - joinOnDescID($secondary-partial-index, $column, $table-id) - - descriptorIsNotBeingDropped-25.1($secondary-partial-index) + - descriptorIsNotBeingDropped-25.2($secondary-partial-index) - secondaryIndexReferencesColumn(*scpb.SecondaryIndexPartial, *scpb.Column)($secondary-partial-index, $column) - $secondary-partial-index-Target[TargetStatus] = TRANSIENT_ABSENT - $secondary-partial-index-Node[CurrentStatus] = TRANSIENT_ABSENT @@ -4384,7 +4384,7 @@ deprules - $secondary-partial-index[Type] = '*scpb.SecondaryIndexPartial' - $column[Type] = '*scpb.Column' - joinOnDescID($secondary-partial-index, $column, $table-id) - - descriptorIsNotBeingDropped-25.1($secondary-partial-index) + - descriptorIsNotBeingDropped-25.2($secondary-partial-index) - secondaryIndexReferencesColumn(*scpb.SecondaryIndexPartial, *scpb.Column)($secondary-partial-index, $column) - $secondary-partial-index-Target[TargetStatus] = ABSENT - $secondary-partial-index-Node[CurrentStatus] = ABSENT @@ -4458,7 +4458,7 @@ deprules - toAbsent($index-Target, $column-Target) - $index-Node[CurrentStatus] = VALIDATED - $column-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($index-column) + - descriptorIsNotBeingDropped-25.2($index-column) - isIndexKeyColumnKey(*scpb.IndexColumn)($index-column) - joinTargetNode($index, $index-Target, $index-Node) - joinTargetNode($column, $column-Target, $column-Node) @@ -4669,12 +4669,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = PUBLIC - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'CheckConstraint transitions to ABSENT uphold 2-version invariant: TRANSIENT_ABSENT->ABSENT' @@ -4690,12 +4690,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_ABSENT - $next-Node[CurrentStatus] = ABSENT - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'CheckConstraint transitions to ABSENT uphold 2-version invariant: TRANSIENT_VALIDATED->VALIDATED' @@ -4711,12 +4711,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_VALIDATED - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'CheckConstraint transitions to ABSENT uphold 2-version invariant: TRANSIENT_WRITE_ONLY->VALIDATED' @@ -4732,12 +4732,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'CheckConstraint transitions to ABSENT uphold 2-version invariant: VALIDATED->ABSENT' @@ -4753,12 +4753,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = VALIDATED - $next-Node[CurrentStatus] = ABSENT - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - nodeNotExistsWithStatusIn_TRANSIENT_VALIDATED_WRITE_ONLY_TRANSIENT_WRITE_ONLY($prev-Target) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) @@ -4775,12 +4775,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = WRITE_ONLY - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'CheckConstraint transitions to PUBLIC uphold 2-version invariant: ABSENT->WRITE_ONLY' @@ -4796,12 +4796,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = ABSENT - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'CheckConstraint transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC' @@ -4817,12 +4817,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = VALIDATED - $next-Node[CurrentStatus] = PUBLIC - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'CheckConstraint transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED' @@ -4838,12 +4838,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = WRITE_ONLY - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'CheckConstraint transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->WRITE_ONLY' @@ -4859,12 +4859,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = ABSENT - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'CheckConstraint transitions to TRANSIENT_ABSENT uphold 2-version invariant: PUBLIC->TRANSIENT_VALIDATED' @@ -4880,12 +4880,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = PUBLIC - $next-Node[CurrentStatus] = TRANSIENT_VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'CheckConstraint transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_VALIDATED->TRANSIENT_ABSENT' @@ -4901,12 +4901,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_VALIDATED - $next-Node[CurrentStatus] = TRANSIENT_ABSENT - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - nodeNotExistsWithStatusIn_TRANSIENT_WRITE_ONLY($prev-Target) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) @@ -4923,12 +4923,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY - $next-Node[CurrentStatus] = TRANSIENT_VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'CheckConstraint transitions to TRANSIENT_ABSENT uphold 2-version invariant: VALIDATED->PUBLIC' @@ -4944,12 +4944,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = VALIDATED - $next-Node[CurrentStatus] = PUBLIC - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'CheckConstraint transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->VALIDATED' @@ -4965,12 +4965,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = WRITE_ONLY - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT' @@ -4986,12 +4986,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = DELETE_ONLY - $next-Node[CurrentStatus] = ABSENT - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'Column transitions to ABSENT uphold 2-version invariant: PUBLIC->WRITE_ONLY' @@ -5007,12 +5007,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = PUBLIC - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY' @@ -5028,12 +5028,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = WRITE_ONLY - $next-Node[CurrentStatus] = DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'Column transitions to PUBLIC uphold 2-version invariant: ABSENT->DELETE_ONLY' @@ -5049,12 +5049,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = ABSENT - $next-Node[CurrentStatus] = DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'Column transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY' @@ -5070,12 +5070,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = DELETE_ONLY - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC' @@ -5091,12 +5091,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = WRITE_ONLY - $next-Node[CurrentStatus] = PUBLIC - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'ColumnNotNull transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED' @@ -5112,12 +5112,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = PUBLIC - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'ColumnNotNull transitions to ABSENT uphold 2-version invariant: VALIDATED->ABSENT' @@ -5133,12 +5133,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = VALIDATED - $next-Node[CurrentStatus] = ABSENT - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - nodeNotExistsWithStatusIn_WRITE_ONLY($prev-Target) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) @@ -5155,12 +5155,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = WRITE_ONLY - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'ColumnNotNull transitions to PUBLIC uphold 2-version invariant: ABSENT->WRITE_ONLY' @@ -5176,12 +5176,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = ABSENT - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'ColumnNotNull transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC' @@ -5197,12 +5197,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = VALIDATED - $next-Node[CurrentStatus] = PUBLIC - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'ColumnNotNull transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED' @@ -5218,12 +5218,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = WRITE_ONLY - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: Computed column expression is dropped before the column it depends on @@ -5447,12 +5447,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = PUBLIC - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'ForeignKeyConstraint transitions to ABSENT uphold 2-version invariant: VALIDATED->ABSENT' @@ -5468,12 +5468,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = VALIDATED - $next-Node[CurrentStatus] = ABSENT - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - nodeNotExistsWithStatusIn_WRITE_ONLY($prev-Target) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) @@ -5490,12 +5490,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = WRITE_ONLY - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'ForeignKeyConstraint transitions to PUBLIC uphold 2-version invariant: ABSENT->WRITE_ONLY' @@ -5511,12 +5511,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = ABSENT - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'ForeignKeyConstraint transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC' @@ -5532,12 +5532,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = VALIDATED - $next-Node[CurrentStatus] = PUBLIC - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'ForeignKeyConstraint transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED' @@ -5553,12 +5553,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = WRITE_ONLY - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: New primary index for alter column type should go public in the same stage as dropped column @@ -5617,12 +5617,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = BACKFILLED - $next-Node[CurrentStatus] = DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY' @@ -5638,12 +5638,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = BACKFILL_ONLY - $next-Node[CurrentStatus] = DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT' @@ -5659,12 +5659,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = DELETE_ONLY - $next-Node[CurrentStatus] = ABSENT - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - nodeNotExistsWithStatusIn_TRANSIENT_DELETE_ONLY_BACKFILLED_TRANSIENT_BACKFILLED_BACKFILL_ONLY_TRANSIENT_BACKFILL_ONLY($prev-Target) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) @@ -5681,12 +5681,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = MERGED - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY' @@ -5702,12 +5702,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = MERGE_ONLY - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED' @@ -5723,12 +5723,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = PUBLIC - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_ABSENT->ABSENT' @@ -5744,12 +5744,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_ABSENT - $next-Node[CurrentStatus] = ABSENT - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_BACKFILLED->DELETE_ONLY' @@ -5765,12 +5765,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_BACKFILLED - $next-Node[CurrentStatus] = DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_BACKFILL_ONLY->DELETE_ONLY' @@ -5786,12 +5786,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_BACKFILL_ONLY - $next-Node[CurrentStatus] = DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->DELETE_ONLY' @@ -5807,12 +5807,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY - $next-Node[CurrentStatus] = DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_MERGED->WRITE_ONLY' @@ -5828,12 +5828,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_MERGED - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_MERGE_ONLY->WRITE_ONLY' @@ -5849,12 +5849,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_MERGE_ONLY - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_VALIDATED->VALIDATED' @@ -5870,12 +5870,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_VALIDATED - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_WRITE_ONLY->WRITE_ONLY' @@ -5891,12 +5891,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY' @@ -5912,12 +5912,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = VALIDATED - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - nodeNotExistsWithStatusIn_TRANSIENT_VALIDATED($prev-Target) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) @@ -5934,12 +5934,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = WRITE_ONLY - $next-Node[CurrentStatus] = DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - nodeNotExistsWithStatusIn_VALIDATED_TRANSIENT_WRITE_ONLY_MERGE_ONLY_TRANSIENT_MERGE_ONLY_MERGED_TRANSIENT_MERGED($prev-Target) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) @@ -5956,12 +5956,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = ABSENT - $next-Node[CurrentStatus] = BACKFILL_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILLED->DELETE_ONLY' @@ -5977,12 +5977,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = BACKFILLED - $next-Node[CurrentStatus] = DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED' @@ -5998,12 +5998,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = BACKFILL_ONLY - $next-Node[CurrentStatus] = BACKFILLED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY' @@ -6019,12 +6019,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = DELETE_ONLY - $next-Node[CurrentStatus] = MERGE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGED->WRITE_ONLY' @@ -6040,12 +6040,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = MERGED - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGE_ONLY->MERGED' @@ -6061,12 +6061,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = MERGE_ONLY - $next-Node[CurrentStatus] = MERGED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC' @@ -6082,12 +6082,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = VALIDATED - $next-Node[CurrentStatus] = PUBLIC - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED' @@ -6103,12 +6103,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = WRITE_ONLY - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->BACKFILL_ONLY' @@ -6124,12 +6124,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = ABSENT - $next-Node[CurrentStatus] = BACKFILL_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: BACKFILLED->DELETE_ONLY' @@ -6145,12 +6145,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = BACKFILLED - $next-Node[CurrentStatus] = DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED' @@ -6166,12 +6166,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = BACKFILL_ONLY - $next-Node[CurrentStatus] = BACKFILLED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY' @@ -6187,12 +6187,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = DELETE_ONLY - $next-Node[CurrentStatus] = MERGE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: MERGED->WRITE_ONLY' @@ -6208,12 +6208,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = MERGED - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: MERGE_ONLY->MERGED' @@ -6229,12 +6229,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = MERGE_ONLY - $next-Node[CurrentStatus] = MERGED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: PUBLIC->TRANSIENT_VALIDATED' @@ -6250,12 +6250,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = PUBLIC - $next-Node[CurrentStatus] = TRANSIENT_VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_BACKFILLED->TRANSIENT_DELETE_ONLY' @@ -6271,12 +6271,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_BACKFILLED - $next-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_BACKFILL_ONLY->TRANSIENT_DELETE_ONLY' @@ -6292,12 +6292,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_BACKFILL_ONLY - $next-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT' @@ -6313,12 +6313,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY - $next-Node[CurrentStatus] = TRANSIENT_ABSENT - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - nodeNotExistsWithStatusIn_TRANSIENT_BACKFILLED_TRANSIENT_BACKFILL_ONLY($prev-Target) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) @@ -6335,12 +6335,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_MERGED - $next-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_MERGE_ONLY->TRANSIENT_WRITE_ONLY' @@ -6356,12 +6356,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_MERGE_ONLY - $next-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_VALIDATED->TRANSIENT_WRITE_ONLY' @@ -6377,12 +6377,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_VALIDATED - $next-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_WRITE_ONLY->TRANSIENT_DELETE_ONLY' @@ -6398,12 +6398,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY - $next-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - nodeNotExistsWithStatusIn_TRANSIENT_VALIDATED_TRANSIENT_MERGE_ONLY_TRANSIENT_MERGED($prev-Target) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) @@ -6420,12 +6420,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = VALIDATED - $next-Node[CurrentStatus] = PUBLIC - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->VALIDATED' @@ -6441,12 +6441,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = WRITE_ONLY - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILLED->DELETE_ONLY' @@ -6462,12 +6462,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = BACKFILLED - $next-Node[CurrentStatus] = DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY' @@ -6483,12 +6483,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = BACKFILL_ONLY - $next-Node[CurrentStatus] = DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT' @@ -6504,12 +6504,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = DELETE_ONLY - $next-Node[CurrentStatus] = ABSENT - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - nodeNotExistsWithStatusIn_BACKFILLED_BACKFILL_ONLY($prev-Target) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) @@ -6526,12 +6526,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = MERGED - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY' @@ -6547,12 +6547,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = MERGE_ONLY - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED' @@ -6568,12 +6568,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = PUBLIC - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY' @@ -6589,12 +6589,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = VALIDATED - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY' @@ -6610,12 +6610,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = WRITE_ONLY - $next-Node[CurrentStatus] = DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - nodeNotExistsWithStatusIn_VALIDATED_MERGE_ONLY_MERGED($prev-Target) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) @@ -6632,12 +6632,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = ABSENT - $next-Node[CurrentStatus] = BACKFILL_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILLED->DELETE_ONLY' @@ -6653,12 +6653,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = BACKFILLED - $next-Node[CurrentStatus] = DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED' @@ -6674,12 +6674,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = BACKFILL_ONLY - $next-Node[CurrentStatus] = BACKFILLED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY' @@ -6695,12 +6695,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = DELETE_ONLY - $next-Node[CurrentStatus] = MERGE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: MERGED->WRITE_ONLY' @@ -6716,12 +6716,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = MERGED - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: MERGE_ONLY->MERGED' @@ -6737,12 +6737,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = MERGE_ONLY - $next-Node[CurrentStatus] = MERGED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC' @@ -6758,12 +6758,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = VALIDATED - $next-Node[CurrentStatus] = PUBLIC - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED' @@ -6779,12 +6779,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = WRITE_ONLY - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT' @@ -6800,12 +6800,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = DELETE_ONLY - $next-Node[CurrentStatus] = ABSENT - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - nodeNotExistsWithStatusIn_TRANSIENT_DELETE_ONLY($prev-Target) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) @@ -6822,12 +6822,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_ABSENT - $next-Node[CurrentStatus] = ABSENT - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'TemporaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->DELETE_ONLY' @@ -6843,12 +6843,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY - $next-Node[CurrentStatus] = DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY' @@ -6864,12 +6864,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = WRITE_ONLY - $next-Node[CurrentStatus] = DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->DELETE_ONLY' @@ -6885,12 +6885,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = ABSENT - $next-Node[CurrentStatus] = DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY' @@ -6906,12 +6906,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = DELETE_ONLY - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT' @@ -6927,12 +6927,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY - $next-Node[CurrentStatus] = TRANSIENT_ABSENT - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->TRANSIENT_DELETE_ONLY' @@ -6948,12 +6948,12 @@ deprules - $prev-Target[TargetStatus] = TRANSIENT_ABSENT - $prev-Node[CurrentStatus] = WRITE_ONLY - $next-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'UniqueWithoutIndexConstraint transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED' @@ -6969,12 +6969,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = PUBLIC - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'UniqueWithoutIndexConstraint transitions to ABSENT uphold 2-version invariant: VALIDATED->ABSENT' @@ -6990,12 +6990,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = VALIDATED - $next-Node[CurrentStatus] = ABSENT - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - nodeNotExistsWithStatusIn_WRITE_ONLY($prev-Target) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) @@ -7012,12 +7012,12 @@ deprules - $prev-Target[TargetStatus] = ABSENT - $prev-Node[CurrentStatus] = WRITE_ONLY - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'UniqueWithoutIndexConstraint transitions to PUBLIC uphold 2-version invariant: ABSENT->WRITE_ONLY' @@ -7033,12 +7033,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = ABSENT - $next-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'UniqueWithoutIndexConstraint transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC' @@ -7054,12 +7054,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = VALIDATED - $next-Node[CurrentStatus] = PUBLIC - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: 'UniqueWithoutIndexConstraint transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED' @@ -7075,12 +7075,12 @@ deprules - $prev-Target[TargetStatus] = PUBLIC - $prev-Node[CurrentStatus] = WRITE_ONLY - $next-Node[CurrentStatus] = VALIDATED - - descriptorIsNotBeingDropped-25.1($prev) + - descriptorIsNotBeingDropped-25.2($prev) - $descriptor-data[Type] = '*scpb.TableData' - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) - $descriptor-data-Node[CurrentStatus] = PUBLIC - $descriptor-data[DescID] = $descID - - descriptorIsDataNotBeingAdded-25.1($descID) + - descriptorIsDataNotBeingAdded-25.2($descID) - joinTargetNode($prev, $prev-Target, $prev-Node) - joinTargetNode($next, $next-Target, $next-Node) - name: adding a transient column compute expression moves to 'absent' after PK validation to ensures it's there for the backfill @@ -7399,7 +7399,7 @@ deprules to: column-Node query: - $column-type[Type] = '*scpb.ColumnType' - - descriptorIsNotBeingDropped-25.1($column-type) + - descriptorIsNotBeingDropped-25.2($column-type) - $column[Type] = '*scpb.Column' - joinOnColumnID($column-type, $column, $table-id, $col-id) - toAbsent($column-type-Target, $column-Target) @@ -8007,7 +8007,7 @@ deprules - $referenced-descriptor[Type] IN ['*scpb.AliasType', '*scpb.CompositeType', '*scpb.EnumType'] - $referenced-descriptor[DescID] = $fromDescID - $referencing-via-type[ReferencedTypeIDs] CONTAINS $fromDescID - - descriptorIsNotBeingDropped-25.1($referencing-via-type) + - descriptorIsNotBeingDropped-25.2($referencing-via-type) - $referencing-via-type[Type] IN ['*scpb.CheckConstraintUnvalidated', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.SecondaryIndexPartial'] - toAbsent($referenced-descriptor-Target, $referencing-via-type-Target) - $referenced-descriptor-Node[CurrentStatus] = DROPPED @@ -8469,7 +8469,7 @@ deprules - $column[Type] = '*scpb.Column' - ColumnInIndex($index-column, $index, $table-id, $column-id, $index-id) - joinOnColumnID($index-column, $column, $table-id, $column-id) - - descriptorIsNotBeingDropped-25.1($index-column) + - descriptorIsNotBeingDropped-25.2($index-column) - toAbsent($index-Target, $column-Target) - $index-Node[CurrentStatus] = ABSENT - $column-Node[CurrentStatus] = ABSENT @@ -8484,7 +8484,7 @@ deprules - $column[Type] = '*scpb.Column' - ColumnInIndex($index-column, $index, $table-id, $column-id, $index-id) - joinOnColumnID($index-column, $column, $table-id, $column-id) - - descriptorIsNotBeingDropped-25.1($index-column) + - descriptorIsNotBeingDropped-25.2($index-column) - transient($index-Target, $column-Target) - $index-Node[CurrentStatus] = TRANSIENT_ABSENT - $column-Node[CurrentStatus] = TRANSIENT_ABSENT @@ -8499,7 +8499,7 @@ deprules - $column[Type] = '*scpb.Column' - ColumnInIndex($index-column, $index, $table-id, $column-id, $index-id) - joinOnColumnID($index-column, $column, $table-id, $column-id) - - descriptorIsNotBeingDropped-25.1($index-column) + - descriptorIsNotBeingDropped-25.2($index-column) - $index-Target[TargetStatus] = TRANSIENT_ABSENT - $index-Node[CurrentStatus] = TRANSIENT_ABSENT - $column-Target[TargetStatus] = ABSENT @@ -8515,7 +8515,7 @@ deprules - $column[Type] = '*scpb.Column' - ColumnInIndex($index-column, $index, $table-id, $column-id, $index-id) - joinOnColumnID($index-column, $column, $table-id, $column-id) - - descriptorIsNotBeingDropped-25.1($index-column) + - descriptorIsNotBeingDropped-25.2($index-column) - $index-Target[TargetStatus] = ABSENT - $index-Node[CurrentStatus] = ABSENT - $column-Target[TargetStatus] = TRANSIENT_ABSENT @@ -8574,7 +8574,7 @@ deprules to: index-Node query: - $partial-predicate[Type] = '*scpb.SecondaryIndexPartial' - - descriptorIsNotBeingDropped-25.1($partial-predicate) + - descriptorIsNotBeingDropped-25.2($partial-predicate) - $index[Type] = '*scpb.SecondaryIndex' - joinOnIndexID($partial-predicate, $index, $table-id, $index-id) - toAbsent($partial-predicate-Target, $index-Target) @@ -8588,7 +8588,7 @@ deprules to: index-Node query: - $partial-predicate[Type] = '*scpb.SecondaryIndexPartial' - - descriptorIsNotBeingDropped-25.1($partial-predicate) + - descriptorIsNotBeingDropped-25.2($partial-predicate) - $index[Type] = '*scpb.SecondaryIndex' - joinOnIndexID($partial-predicate, $index, $table-id, $index-id) - transient($partial-predicate-Target, $index-Target) @@ -8602,7 +8602,7 @@ deprules to: index-Node query: - $partial-predicate[Type] = '*scpb.SecondaryIndexPartial' - - descriptorIsNotBeingDropped-25.1($partial-predicate) + - descriptorIsNotBeingDropped-25.2($partial-predicate) - $index[Type] = '*scpb.SecondaryIndex' - joinOnIndexID($partial-predicate, $index, $table-id, $index-id) - $partial-predicate-Target[TargetStatus] = TRANSIENT_ABSENT @@ -8617,7 +8617,7 @@ deprules to: index-Node query: - $partial-predicate[Type] = '*scpb.SecondaryIndexPartial' - - descriptorIsNotBeingDropped-25.1($partial-predicate) + - descriptorIsNotBeingDropped-25.2($partial-predicate) - $index[Type] = '*scpb.SecondaryIndex' - joinOnIndexID($partial-predicate, $index, $table-id, $index-id) - $partial-predicate-Target[TargetStatus] = ABSENT @@ -8932,7 +8932,7 @@ deprules - $secondary-partial-index[Type] = '*scpb.SecondaryIndex' - $column[Type] = '*scpb.Column' - joinOnDescID($secondary-partial-index, $column, $table-id) - - descriptorIsNotBeingDropped-25.1($secondary-partial-index) + - descriptorIsNotBeingDropped-25.2($secondary-partial-index) - secondaryIndexReferencesColumn(*scpb.SecondaryIndex, *scpb.Column)($secondary-partial-index, $column) - toAbsent($secondary-partial-index-Target, $column-Target) - $secondary-partial-index-Node[CurrentStatus] = DELETE_ONLY @@ -8947,7 +8947,7 @@ deprules - $secondary-partial-index[Type] = '*scpb.SecondaryIndex' - $column[Type] = '*scpb.Column' - joinOnDescID($secondary-partial-index, $column, $table-id) - - descriptorIsNotBeingDropped-25.1($secondary-partial-index) + - descriptorIsNotBeingDropped-25.2($secondary-partial-index) - secondaryIndexReferencesColumn(*scpb.SecondaryIndex, *scpb.Column)($secondary-partial-index, $column) - transient($secondary-partial-index-Target, $column-Target) - $secondary-partial-index-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY @@ -8962,7 +8962,7 @@ deprules - $secondary-partial-index[Type] = '*scpb.SecondaryIndex' - $column[Type] = '*scpb.Column' - joinOnDescID($secondary-partial-index, $column, $table-id) - - descriptorIsNotBeingDropped-25.1($secondary-partial-index) + - descriptorIsNotBeingDropped-25.2($secondary-partial-index) - secondaryIndexReferencesColumn(*scpb.SecondaryIndex, *scpb.Column)($secondary-partial-index, $column) - $secondary-partial-index-Target[TargetStatus] = TRANSIENT_ABSENT - $secondary-partial-index-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY @@ -8978,7 +8978,7 @@ deprules - $secondary-partial-index[Type] = '*scpb.SecondaryIndex' - $column[Type] = '*scpb.Column' - joinOnDescID($secondary-partial-index, $column, $table-id) - - descriptorIsNotBeingDropped-25.1($secondary-partial-index) + - descriptorIsNotBeingDropped-25.2($secondary-partial-index) - secondaryIndexReferencesColumn(*scpb.SecondaryIndex, *scpb.Column)($secondary-partial-index, $column) - $secondary-partial-index-Target[TargetStatus] = ABSENT - $secondary-partial-index-Node[CurrentStatus] = DELETE_ONLY @@ -8994,7 +8994,7 @@ deprules - $secondary-partial-index[Type] = '*scpb.SecondaryIndexPartial' - $column[Type] = '*scpb.Column' - joinOnDescID($secondary-partial-index, $column, $table-id) - - descriptorIsNotBeingDropped-25.1($secondary-partial-index) + - descriptorIsNotBeingDropped-25.2($secondary-partial-index) - secondaryIndexReferencesColumn(*scpb.SecondaryIndexPartial, *scpb.Column)($secondary-partial-index, $column) - toAbsent($secondary-partial-index-Target, $column-Target) - $secondary-partial-index-Node[CurrentStatus] = ABSENT @@ -9009,7 +9009,7 @@ deprules - $secondary-partial-index[Type] = '*scpb.SecondaryIndexPartial' - $column[Type] = '*scpb.Column' - joinOnDescID($secondary-partial-index, $column, $table-id) - - descriptorIsNotBeingDropped-25.1($secondary-partial-index) + - descriptorIsNotBeingDropped-25.2($secondary-partial-index) - secondaryIndexReferencesColumn(*scpb.SecondaryIndexPartial, *scpb.Column)($secondary-partial-index, $column) - transient($secondary-partial-index-Target, $column-Target) - $secondary-partial-index-Node[CurrentStatus] = TRANSIENT_ABSENT @@ -9024,7 +9024,7 @@ deprules - $secondary-partial-index[Type] = '*scpb.SecondaryIndexPartial' - $column[Type] = '*scpb.Column' - joinOnDescID($secondary-partial-index, $column, $table-id) - - descriptorIsNotBeingDropped-25.1($secondary-partial-index) + - descriptorIsNotBeingDropped-25.2($secondary-partial-index) - secondaryIndexReferencesColumn(*scpb.SecondaryIndexPartial, *scpb.Column)($secondary-partial-index, $column) - $secondary-partial-index-Target[TargetStatus] = TRANSIENT_ABSENT - $secondary-partial-index-Node[CurrentStatus] = TRANSIENT_ABSENT @@ -9040,7 +9040,7 @@ deprules - $secondary-partial-index[Type] = '*scpb.SecondaryIndexPartial' - $column[Type] = '*scpb.Column' - joinOnDescID($secondary-partial-index, $column, $table-id) - - descriptorIsNotBeingDropped-25.1($secondary-partial-index) + - descriptorIsNotBeingDropped-25.2($secondary-partial-index) - secondaryIndexReferencesColumn(*scpb.SecondaryIndexPartial, *scpb.Column)($secondary-partial-index, $column) - $secondary-partial-index-Target[TargetStatus] = ABSENT - $secondary-partial-index-Node[CurrentStatus] = ABSENT @@ -9114,7 +9114,7 @@ deprules - toAbsent($index-Target, $column-Target) - $index-Node[CurrentStatus] = VALIDATED - $column-Node[CurrentStatus] = WRITE_ONLY - - descriptorIsNotBeingDropped-25.1($index-column) + - descriptorIsNotBeingDropped-25.2($index-column) - isIndexKeyColumnKey(*scpb.IndexColumn)($index-column) - joinTargetNode($index, $index-Target, $index-Node) - joinTargetNode($column, $column-Target, $column-Node) diff --git a/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/BUILD.bazel b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/BUILD.bazel new file mode 100644 index 000000000000..3c7ebd6f1bf5 --- /dev/null +++ b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/BUILD.bazel @@ -0,0 +1,65 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "release_25_1", + srcs = [ + "dep_add_column.go", + "dep_add_constraint.go", + "dep_add_index.go", + "dep_add_index_and_column.go", + "dep_add_index_and_constraint.go", + "dep_add_trigger.go", + "dep_alter_column_type.go", + "dep_create.go", + "dep_create_function.go", + "dep_create_policy.go", + "dep_drop_column.go", + "dep_drop_constraint.go", + "dep_drop_index.go", + "dep_drop_index_and_column.go", + "dep_drop_object.go", + "dep_drop_policy.go", + "dep_drop_trigger.go", + "dep_garbage_collection.go", + "dep_swap_index.go", + "dep_two_version.go", + "helpers.go", + "registry.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/rules/release_25_1", + visibility = ["//pkg/sql/schemachanger/scplan:__subpackages__"], + deps = [ + "//pkg/clusterversion", + "//pkg/sql/schemachanger/rel", + "//pkg/sql/schemachanger/scpb", + "//pkg/sql/schemachanger/scplan/internal/opgen", + "//pkg/sql/schemachanger/scplan/internal/rules", + "//pkg/sql/schemachanger/scplan/internal/scgraph", + "//pkg/sql/schemachanger/screl", + "//pkg/sql/sem/catid", + "@com_github_cockroachdb_errors//:errors", + ], +) + +go_test( + name = "release_25_1_test", + srcs = [ + "assertions_test.go", + "rules_test.go", + ], + data = glob(["testdata/**"]), + embed = [":release_25_1"], + deps = [ + "//pkg/sql/catalog/catpb", + "//pkg/sql/schemachanger/rel", + "//pkg/sql/schemachanger/scpb", + "//pkg/sql/schemachanger/scplan/internal/opgen", + "//pkg/sql/schemachanger/screl", + "//pkg/sql/types", + "//pkg/testutils/datapathutils", + "@com_github_cockroachdb_datadriven//:datadriven", + "@com_github_cockroachdb_errors//:errors", + "@com_github_stretchr_testify//require", + "@in_gopkg_yaml_v3//:yaml_v3", + ], +) diff --git a/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/assertions_test.go b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/assertions_test.go new file mode 100644 index 000000000000..34a6ff0c0fd0 --- /dev/null +++ b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/assertions_test.go @@ -0,0 +1,227 @@ +// Copyright 2022 The Cockroach Authors. +// +// Use of this software is governed by the CockroachDB Software License +// included in the /LICENSE file. + +package release_25_1 + +import ( + "reflect" + "runtime" + "strings" + "testing" + + "github.com/cockroachdb/cockroach/pkg/sql/catalog/catpb" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/opgen" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/screl" + "github.com/cockroachdb/cockroach/pkg/sql/types" + "github.com/cockroachdb/errors" +) + +// TestRuleAssertions verifies that important helper functions verify certain +// properties that the rule definitions rely on. +func TestRuleAssertions(t *testing.T) { + for _, fn := range []func(e scpb.Element) error{ + checkSimpleDependentsReferenceDescID, + checkToAbsentCategories, + checkIsWithTypeT, + checkIsWithExpression, + checkIsColumnDependent, + checkIsIndexDependent, + checkIsConstraintDependent, + checkConstraintPartitions, + checkIsTriggerDependent, + } { + var fni interface{} = fn + fullName := runtime.FuncForPC(reflect.ValueOf(fni).Pointer()).Name() + nameParts := strings.Split(fullName, "rules.") + shortName := nameParts[len(nameParts)-1] + t.Run(shortName, func(t *testing.T) { + _ = scpb.ForEachElementType(func(e scpb.Element) error { + e = nonNilElement(e) + if err := fn(e); err != nil { + t.Errorf("%T: %+v", e, err) + } + return nil + }) + }) + } +} + +func nonNilElement(element scpb.Element) scpb.Element { + return reflect.New(reflect.ValueOf(element).Type().Elem()).Interface().(scpb.Element) +} + +// Assert that only simple dependents (non-descriptor, non-index, non-column) +// and data elements have screl.ReferencedDescID attributes. +// One exception is foreign key constraint, which is not simple dependent nor data +// element but it has a screl.ReferencedDescID attribute. +func checkSimpleDependentsReferenceDescID(e scpb.Element) error { + if isSimpleDependent(e) || isData(e) { + return nil + } + if _, ok := e.(*scpb.ForeignKeyConstraint); ok { + return nil + } + if _, err := screl.Schema.GetAttribute(screl.ReferencedDescID, e); err == nil { + return errors.New("unexpected screl.ReferencedDescID attr") + } + return nil +} + +// Assert that elements can be grouped into three categories when transitioning +// from PUBLIC to ABSENT: +// - go via DROPPED iff they're descriptor or data elements; +// - go via a non-read status iff they're indexes or columns, which are +// subject to the two-version invariant; +// - go direct to ABSENT in all other cases. +func checkToAbsentCategories(e scpb.Element) error { + s0 := opgen.InitialStatus(e, scpb.Status_ABSENT) + s1 := opgen.NextStatus(e, scpb.Status_ABSENT, s0) + switch s1 { + case scpb.Status_DROPPED: + if isDescriptor(e) || isData(e) { + return nil + } + case scpb.Status_VALIDATED, scpb.Status_WRITE_ONLY, scpb.Status_DELETE_ONLY: + if isSubjectTo2VersionInvariant(e) { + return nil + } + case scpb.Status_ABSENT: + if isSimpleDependent(e) { + return nil + } + } + return errors.Newf("unexpected transition %s -> %s in direction ABSENT", s0, s1) +} + +// Assert that isWithTypeT covers all elements with embedded TypeTs. +func checkIsWithTypeT(e scpb.Element) error { + return screl.WalkTypes(e, func(t *types.T) error { + if isWithTypeT(e) { + return nil + } + return errors.New("should verify isWithTypeT but doesn't") + }) +} + +// Assert that isWithExpression covers all elements with embedded +// expressions. +func checkIsWithExpression(e scpb.Element) error { + return screl.WalkExpressions(e, func(t *catpb.Expression) error { + switch e.(type) { + // Ignore elements which have catpb.Expression fields but which don't + // have them within an scpb.Expression for valid reasons. + case *scpb.RowLevelTTL: + return nil + } + if isWithExpression(e) { + return nil + } + return errors.New("should verify isWithExpression but doesn't") + }) +} + +// Assert that isColumnDependent covers all dependent elements of a column +// element. +func checkIsColumnDependent(e scpb.Element) error { + // Exclude columns themselves. + if isColumn(e) { + return nil + } + // A column dependent should have a ColumnID attribute. + _, err := screl.Schema.GetAttribute(screl.ColumnID, e) + if isColumnDependent(e) { + if err != nil { + return errors.New("verifies isColumnDependent but doesn't have ColumnID attr") + } + } else if err == nil { + return errors.New("has ColumnID attr but doesn't verify isColumnDependent") + } + return nil +} + +// Assert that isIndexDependent covers all dependent elements of an index +// element. +func checkIsIndexDependent(e scpb.Element) error { + // Exclude indexes themselves and their data. + if isIndex(e) || isData(e) || isNonIndexBackedConstraint(e) { + return nil + } + // An index dependent should have an IndexID attribute. + _, err := screl.Schema.GetAttribute(screl.IndexID, e) + if isIndexDependent(e) { + if err != nil { + return errors.New("verifies isIndexDependent but doesn't have IndexID attr") + } + } else if err == nil { + return errors.New("has IndexID attr but doesn't verify isIndexDependent") + } + return nil +} + +// Assert that checkIsConstraintDependent covers all elements of a constraint +// element. +func checkIsConstraintDependent(e scpb.Element) error { + // Exclude constraints themselves. + if isConstraint(e) { + return nil + } + // A constraint dependent should have a ConstraintID attribute. + _, err := screl.Schema.GetAttribute(screl.ConstraintID, e) + if isConstraintDependent(e) { + if err != nil { + return errors.New("verifies isConstraintDependent but doesn't have ConstraintID attr") + } + } else if err == nil { + return errors.New("has ConstraintID attr but doesn't verify isConstraintDependent") + } + return nil +} + +// Assert the following partitions about constraints: +// 1. An element `e` with ConstraintID attr is either a constraint +// or a constraint dependent. +// 2. A constraint is either index-backed or non-index-backed. +// +// TODO (xiang): Add test for cross-descriptor partition. We currently +// cannot have them until we added referenced.*ID attr for +// UniqueWithoutIndex[NotValid] element, which is required to support +// partial unique without index constraint with a predicate that references +// other descriptors. +func checkConstraintPartitions(e scpb.Element) error { + _, err := screl.Schema.GetAttribute(screl.ConstraintID, e) + if err != nil { + return nil //nolint:returnerrcheck + } + if !isConstraint(e) && !isConstraintDependent(e) { + return errors.New("has ConstraintID attr but is not a constraint nor a constraint dependent") + } + if isConstraintDependent(e) { + return nil + } + if !isNonIndexBackedConstraint(e) && !isIndex(e) { + return errors.New("verifies isConstraint but does not verify isNonIndexBackedConstraint nor isIndex") + } + return nil +} + +// Assert that checkIsTriggerDependent covers all elements of a trigger element. +func checkIsTriggerDependent(e scpb.Element) error { + // Exclude triggers themselves. + switch e.(type) { + case *scpb.Trigger: + return nil + } + // A trigger dependent should have a TriggerID attribute. + _, err := screl.Schema.GetAttribute(screl.TriggerID, e) + if isTriggerDependent(e) { + if err != nil { + return errors.New("verifies isTriggerDependent but doesn't have TriggerID attr") + } + } else if err == nil { + return errors.New("has TriggerID attr but doesn't verify isTriggerDependent") + } + return nil +} diff --git a/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_add_column.go b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_add_column.go new file mode 100644 index 000000000000..5d95a9964128 --- /dev/null +++ b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_add_column.go @@ -0,0 +1,240 @@ +// Copyright 2022 The Cockroach Authors. +// +// Use of this software is governed by the CockroachDB Software License +// included in the /LICENSE file. + +package release_25_1 + +import ( + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/rel" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" + . "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/rules" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/scgraph" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/screl" +) + +// These rules ensure that column-dependent elements, like a column's name, its +// DEFAULT expression, etc. appear once the column reaches a suitable state. +func init() { + + registerDepRule( + "column existence precedes column dependents", + scgraph.Precedence, + "column", "dependent", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.Column)(nil)), + to.TypeFilter(rulesVersionKey, isColumnDependent), + JoinOnColumnID(from, to, "table-id", "col-id"), + StatusesToPublicOrTransient(from, scpb.Status_DELETE_ONLY, to, scpb.Status_PUBLIC), + IsNotAlterColumnTypeOp("table-id", "col-id"), + } + }, + ) + + // This rule is similar to the one above but omits the column name. This is specific + // to ALTER COLUMN ... TYPE, which replaces a column with the same name. The column + // name is assigned during the swap, as it replaces the old column. + registerDepRule( + "column existence precedes column dependents during an alter column type", + scgraph.Precedence, + "column", "dependent", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.Column)(nil)), + to.TypeFilter(rulesVersionKey, isColumnDependentExceptColumnName), + JoinOnColumnID(from, to, "table-id", "col-id"), + StatusesToPublicOrTransient(from, scpb.Status_DELETE_ONLY, to, scpb.Status_PUBLIC), + rel.And(IsAlterColumnTypeOp("table-id", "col-id")...), + } + }, + ) + + registerDepRule( + "column dependents exist before column becomes public", + scgraph.Precedence, + "dependent", "column", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.TypeFilter(rulesVersionKey, isColumnDependent), + to.Type((*scpb.Column)(nil)), + JoinOnColumnID(from, to, "table-id", "col-id"), + StatusesToPublicOrTransient(from, scpb.Status_PUBLIC, to, scpb.Status_PUBLIC), + } + }, + ) +} + +// Special cases of the above. +func init() { + registerDepRule( + "column type set right after column existence", + scgraph.SameStagePrecedence, + "column", "column-type", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.Column)(nil)), + to.Type((*scpb.ColumnType)(nil)), + StatusesToPublicOrTransient(from, scpb.Status_DELETE_ONLY, to, scpb.Status_PUBLIC), + JoinOnColumnID(from, to, "table-id", "col-id"), + } + }, + ) + + // There are two distinct rules for transitioning the column name to public, + // depending on whether an ALTER COLUMN TYPE operation is in progress. + // This rule applies when an ALTER COLUMN TYPE is *not* occurring and is + // identical to the prior rule for ColumnType, except that it applies to ColumnName. + registerDepRule( + "column name set right after column existence, except for alter column type", + scgraph.SameStagePrecedence, + "column", "column-name-or-type", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.Column)(nil)), + to.Type((*scpb.ColumnName)(nil)), + StatusesToPublicOrTransient(from, scpb.Status_DELETE_ONLY, to, scpb.Status_PUBLIC), + JoinOnColumnID(from, to, "table-id", "col-id"), + IsNotAlterColumnTypeOp("table-id", "col-id"), + } + }, + ) + + // This rule is similar to the previous one but applies during an ALTER COLUMN TYPE operation. + // In this scenario, we are replacing one column with another, both of which share the same name. + // To prevent any period where a column with that name is not public, we ensure that the column + // names are swapped in the same stage. + registerDepRule( + "during alter column type, column names for old and new columns are swapped in the same stage", + scgraph.SameStagePrecedence, + "old-column-name", "new-column-name", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.ColumnName)(nil)), + to.Type((*scpb.ColumnName)(nil)), + from.TargetStatus(scpb.ToAbsent), + from.CurrentStatus(scpb.Status_ABSENT), + to.TargetStatus(scpb.ToPublic), + to.CurrentStatus(scpb.Status_PUBLIC), + JoinOnDescID(from, to, "table-id"), + to.El.AttrEqVar(screl.ColumnID, "new-col-id"), + rel.And(IsAlterColumnTypeOp("table-id", "new-col-id")...), + } + }, + ) + + registerDepRule( + "DEFAULT or ON UPDATE existence precedes writes to column, except if they are added as part of a alter column type", + scgraph.Precedence, + "expr", "column", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type( + (*scpb.ColumnDefaultExpression)(nil), + (*scpb.ColumnOnUpdateExpression)(nil), + ), + to.Type((*scpb.Column)(nil)), + JoinOnColumnID(from, to, "table-id", "col-id"), + IsNotAlterColumnTypeOp("table-id", "col-id"), + StatusesToPublicOrTransient(from, scpb.Status_PUBLIC, to, scpb.Status_WRITE_ONLY), + } + }, + ) + + // Column becomes writable in the same stage as column constraint is enforced. + // + // This rule exists to prevent the case that the constraint becomes enforced + // (which means writes need to honor it) when the column itself is still + // in DELETE_ONLY and thus not visible to writes. + // + // N.B. It's essentially the same rule as "column constraint removed right + // before column reaches delete only" but on the adding path. + // N.B. SameStage is enough; which transition happens first won't matter. + registerDepRule( + "column writable right before column constraint is enforced.", + scgraph.SameStagePrecedence, + "column", "column-constraint", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.Column)(nil)), + to.Type((*scpb.ColumnNotNull)(nil)), + JoinOnColumnID(from, to, "table-id", "col-id"), + StatusesToPublicOrTransient(from, scpb.Status_WRITE_ONLY, to, scpb.Status_WRITE_ONLY), + } + }, + ) + + // A computed expression cannot have a DEFAULT or ON UPDATE expression. + // However, if the computed expression is temporary (e.g., for an ALTER COLUMN + // TYPE requiring a backfill), these expressions can be added once the + // computed expression is dropped. + registerDepRule( + "DEFAULT or ON UPDATE expressions is public after transient compute expression transitions to absent", + scgraph.SameStagePrecedence, + "transient-compute-expression", "column-expr", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.ColumnComputeExpression)(nil)), + to.Type( + (*scpb.ColumnDefaultExpression)(nil), + (*scpb.ColumnOnUpdateExpression)(nil), + ), + JoinOnColumnID(from, to, "table-id", "col-id"), + ToPublicOrTransient(from, to), + from.CurrentStatus(scpb.Status_TRANSIENT_ABSENT), + to.CurrentStatus(scpb.Status_PUBLIC), + } + }, + ) + + registerDepRule( + "Final compute expression is always added after transient compute expression", + scgraph.SameStagePrecedence, + "transient-compute-expression", "final-compute-expression", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.ColumnComputeExpression)(nil)), + to.Type((*scpb.ColumnComputeExpression)(nil)), + JoinOnColumnID(from, to, "table-id", "col-id"), + from.El.AttrEq(screl.Usage, scpb.ColumnComputeExpression_ALTER_TYPE_USING), + to.El.AttrEq(screl.Usage, scpb.ColumnComputeExpression_REGULAR), + ToPublicOrTransient(from, to), + from.CurrentStatus(scpb.Status_TRANSIENT_ABSENT), + to.CurrentStatus(scpb.Status_PUBLIC), + } + }, + ) +} + +// This rule ensures that columns depend on each other in increasing order. +func init() { + registerDepRule( + "ensure columns are in increasing order", + scgraph.Precedence, + "later-column", "earlier-column", + func(from, to NodeVars) rel.Clauses { + status := rel.Var("status") + return rel.Clauses{ + from.Type((*scpb.Column)(nil)), + // Join first on the target and node to only explore all columns + // which are being added as opposed to all columns. If we joined + // first on the columns, we'd be filtering the cross product of + // table columns. If a relation has a lot of columns, this can hurt. + // It's less likely that we have a very large number of columns which + // are being added. We'll want to do something else here when we start + // creating tables and all the columns are being added. + // + // The "right" answer is to push ordering predicates into rel; it also + // is maintaining sorted data structures. + from.JoinTargetNode(), + to.Type((*scpb.Column)(nil)), + JoinOnDescID(from, to, "table-id"), + ToPublicOrTransient(from, to), + status.In(scpb.Status_WRITE_ONLY, scpb.Status_PUBLIC), + status.Entities(screl.CurrentStatus, from.Node, to.Node), + FilterElements("SmallerColumnIDFirst", from, to, func(from, to *scpb.Column) bool { + return from.ColumnID < to.ColumnID + }), + } + }) +} diff --git a/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_add_constraint.go b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_add_constraint.go new file mode 100644 index 000000000000..7ff1dc117e1b --- /dev/null +++ b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_add_constraint.go @@ -0,0 +1,79 @@ +// Copyright 2022 The Cockroach Authors. +// +// Use of this software is governed by the CockroachDB Software License +// included in the /LICENSE file. + +package release_25_1 + +import ( + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/rel" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" + . "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/rules" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/scgraph" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/screl" +) + +// These rules ensure that constraint-dependent elements, like a constraint's +// name, etc. appear once the constraint reaches a suitable state. +func init() { + registerDepRule( + "constraint dependent public right before complex constraint", + scgraph.SameStagePrecedence, + "dependent", "complex-constraint", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.TypeFilter(rulesVersionKey, isConstraintDependent, Not(isConstraintWithoutIndexName)), + to.TypeFilter(rulesVersionKey, isNonIndexBackedConstraint, isSubjectTo2VersionInvariant), + JoinOnConstraintID(from, to, "table-id", "constraint-id"), + StatusesToPublicOrTransient(from, scpb.Status_PUBLIC, to, scpb.Status_PUBLIC), + } + }, + ) + + registerDepRule( + "simple constraint public right before its dependents", + scgraph.SameStagePrecedence, + "simple-constraint", "dependent", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.TypeFilter(rulesVersionKey, isNonIndexBackedConstraint, Not(isNonIndexBackedCrossDescriptorConstraint)), + to.TypeFilter(rulesVersionKey, isConstraintDependent), + JoinOnConstraintID(from, to, "table-id", "constraint-id"), + StatusesToPublicOrTransient(from, scpb.Status_PUBLIC, to, scpb.Status_PUBLIC), + } + }, + ) + + // Constraint name should be assigned right before it becomes visible, otherwise + // we won't have the correct message inside errors. + registerDepRule( + "simple constraint visible before name", + scgraph.Precedence, + "simple-constraint", "constraint-name", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.TypeFilter(rulesVersionKey, isNonIndexBackedConstraint), + to.TypeFilter(rulesVersionKey, isConstraintWithoutIndexName), + JoinOnConstraintID(from, to, "table-id", "constraint-id"), + StatusesToPublicOrTransient(from, scpb.Status_WRITE_ONLY, to, scpb.Status_PUBLIC), + } + }, + ) + + registerDepRule( + "column public before non-index-backed constraint (including hash-sharded) is created", + scgraph.Precedence, + "column", "constraint", + func(from, to NodeVars) rel.Clauses { + colID := rel.Var("columnID") + return rel.Clauses{ + from.Type((*scpb.Column)(nil)), + to.TypeFilter(rulesVersionKey, isNonIndexBackedConstraint), + from.El.AttrEqVar(screl.ColumnID, colID), + to.ReferencedColumnIDsContains(colID), + JoinOnDescID(from, to, "table-id"), + StatusesToPublicOrTransient(from, scpb.Status_PUBLIC, to, scpb.Status_WRITE_ONLY), + } + }, + ) +} diff --git a/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_add_index.go b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_add_index.go new file mode 100644 index 000000000000..268d593a488e --- /dev/null +++ b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_add_index.go @@ -0,0 +1,240 @@ +// Copyright 2022 The Cockroach Authors. +// +// Use of this software is governed by the CockroachDB Software License +// included in the /LICENSE file. + +package release_25_1 + +import ( + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/rel" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" + . "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/rules" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/scgraph" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/screl" +) + +// These rules ensure that index-dependent elements, like an index's name, its +// partitioning, etc. appear once the index reaches a suitable state. +func init() { + + registerDepRule( + "index existence precedes index dependents", + scgraph.Precedence, + "index", "dependent", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type( + (*scpb.PrimaryIndex)(nil), + (*scpb.SecondaryIndex)(nil), + ), + to.TypeFilter(rulesVersionKey, isIndexDependent), + JoinOnIndexID(from, to, "table-id", "index-id"), + StatusesToPublicOrTransient(from, scpb.Status_BACKFILL_ONLY, to, scpb.Status_PUBLIC), + } + }, + ) + + registerDepRule( + "temp index existence precedes index dependents", + scgraph.Precedence, + "index", "dependent", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.TemporaryIndex)(nil)), + to.TypeFilter(rulesVersionKey, isIndexDependent), + JoinOnIndexID(from, to, "table-id", "index-id"), + StatusesToPublicOrTransient(from, scpb.Status_DELETE_ONLY, to, scpb.Status_PUBLIC), + } + }, + ) + + registerDepRule( + "index dependents exist before index becomes public", + scgraph.Precedence, + "dependent", "index", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.TypeFilter(rulesVersionKey, isIndexDependent), + to.TypeFilter(rulesVersionKey, isIndex), + JoinOnIndexID(from, to, "table-id", "index-id"), + StatusesToPublicOrTransient(from, scpb.Status_PUBLIC, to, scpb.Status_PUBLIC), + } + }, + ) +} + +// Special cases of the above. +func init() { + + registerDepRule( + "primary index named right before index becomes public", + scgraph.SameStagePrecedence, + "index-name", "index", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.IndexName)(nil)), + to.Type( + (*scpb.PrimaryIndex)(nil), + ), + JoinOnIndexID(from, to, "table-id", "index-id"), + StatusesToPublicOrTransient(from, scpb.Status_PUBLIC, to, scpb.Status_PUBLIC), + } + }, + ) + registerDepRule( + "secondary index named before public (with index swap)", + scgraph.Precedence, + "index", "index-name", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + to.Type((*scpb.IndexName)(nil)), + from.Type( + (*scpb.SecondaryIndex)(nil), + ), + JoinOnIndexID(from, to, "table-id", "index-id"), + StatusesToPublicOrTransient(from, scpb.Status_VALIDATED, to, scpb.Status_PUBLIC), + rel.And(IsPotentialSecondaryIndexSwap("index-id", "table-id")...), + } + }, + ) + + registerDepRule( + "secondary index named before validation (without index swap)", + scgraph.Precedence, + "index-name", "index", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.IndexName)(nil)), + to.Type( + (*scpb.SecondaryIndex)(nil), + ), + JoinOnIndexID(from, to, "table-id", "index-id"), + IsNotPotentialSecondaryIndexSwap("table-id", "index-id"), + StatusesToPublicOrTransient(from, scpb.Status_PUBLIC, to, scpb.Status_VALIDATED), + } + }, + ) +} + +// This rule ensures that primary indexes and their corresponding temporary +// indexes appear in an appropriate order to correctly support index backfilling. +func init() { + + // Offline-backfilled index can begin backfilling after the corresponding + // temporary index exists in WRITE_ONLY. + registerDepRule( + "temp index is WRITE_ONLY before backfill", + scgraph.Precedence, + "temp", "index", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.TemporaryIndex)(nil)), + to.Type((*scpb.PrimaryIndex)(nil), (*scpb.SecondaryIndex)(nil)), + JoinOnDescID(from, to, "table-id"), + JoinOn( + from, screl.IndexID, + to, screl.TemporaryIndexID, + "temp-index-id", + ), + from.TargetStatus(scpb.Transient), + to.TargetStatus(scpb.ToPublic, scpb.Transient), + from.CurrentStatus(scpb.Status_WRITE_ONLY), + to.CurrentStatus(scpb.Status_BACKFILLED), + } + }, + ) + + // The following two rules together ensure that temporary index is dropped + // after its master index has merged its data (MERGED) and before its master + // index advances into the next status (WRITE_ONLY). + + // Temporary index starts to disappear after its master index has merged + // this temporary index's data. + registerDepRule( + "index is MERGED before its temp index starts to disappear", + scgraph.Precedence, + "index", "temp", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.PrimaryIndex)(nil), (*scpb.SecondaryIndex)(nil)), + to.Type((*scpb.TemporaryIndex)(nil)), + JoinOnDescID(from, to, "table-id"), + JoinOn( + from, screl.TemporaryIndexID, + to, screl.IndexID, + "temp-index-id", + ), + from.TargetStatus(scpb.ToPublic, scpb.Transient), + from.CurrentStatus(scpb.Status_MERGED), + to.TargetStatus(scpb.Transient), + to.CurrentStatus(scpb.Status_TRANSIENT_DELETE_ONLY), + } + }, + ) + + // Temporary index disappeared before its master index reaches WRITE_ONLY. + registerDepRule( + "temp index disappeared before its master index reaches WRITE_ONLY", + scgraph.Precedence, + "temp", "index", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.TemporaryIndex)(nil)), + to.Type((*scpb.PrimaryIndex)(nil), (*scpb.SecondaryIndex)(nil)), + JoinOnDescID(from, to, "table-id"), + JoinOn( + from, screl.IndexID, + to, screl.TemporaryIndexID, + "temp-index-id", + ), + from.TargetStatus(scpb.Transient), + from.CurrentStatus(scpb.Status_TRANSIENT_DELETE_ONLY), + to.TargetStatus(scpb.ToPublic, scpb.Transient), + to.CurrentStatus(scpb.Status_WRITE_ONLY), + } + }, + ) +} + +// We want to say that all columns which are part of a secondary index need +// to be in a primary index which is validated +// To do that, we want to find a secondary index which has a source which +// is a primary index which is itself new. +func init() { + + registerDepRule( + "primary index with new columns should exist before secondary indexes", + scgraph.Precedence, + "primary-index", "secondary-index", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.PrimaryIndex)(nil)), + to.Type((*scpb.SecondaryIndex)(nil)), + JoinOnDescID(from, to, "table-id"), + JoinOn( + from, screl.IndexID, + to, screl.SourceIndexID, + "primary-index-id", + ), + StatusesToPublicOrTransient(from, scpb.Status_PUBLIC, to, scpb.Status_BACKFILL_ONLY), + } + }) + + registerDepRule( + "primary index with new columns should exist before temp indexes", + scgraph.Precedence, + "primary-index", "temp-index", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.PrimaryIndex)(nil)), + to.Type((*scpb.TemporaryIndex)(nil)), + JoinOnDescID(from, to, "table-id"), + JoinOn( + from, screl.IndexID, + to, screl.SourceIndexID, + "primary-index-id", + ), + StatusesToPublicOrTransient(from, scpb.Status_PUBLIC, to, scpb.Status_DELETE_ONLY), + } + }) +} diff --git a/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_add_index_and_column.go b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_add_index_and_column.go new file mode 100644 index 000000000000..4b4e59bd48fc --- /dev/null +++ b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_add_index_and_column.go @@ -0,0 +1,120 @@ +// Copyright 2022 The Cockroach Authors. +// +// Use of this software is governed by the CockroachDB Software License +// included in the /LICENSE file. + +package release_25_1 + +import ( + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/rel" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" + . "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/rules" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/scgraph" +) + +// These rules ensure that columns and indexes containing these columns +// appear into existence in the correct order. +func init() { + + // We need to make sure that no columns are added to the index after it + // receives any data due to a backfill. + registerDepRule("index-column added to index before index is backfilled", + scgraph.Precedence, + "index-column", "index", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.IndexColumn)(nil)), + to.Type((*scpb.PrimaryIndex)(nil), (*scpb.SecondaryIndex)(nil)), + JoinOnIndexID(from, to, "table-id", "index-id"), + StatusesToPublicOrTransient(from, scpb.Status_PUBLIC, to, scpb.Status_BACKFILLED), + } + }) + + // We need to make sure that no columns are added to the temp index after it + // receives any writes. + registerDepRule("index-column added to index before temp index receives writes", + scgraph.Precedence, + "index-column", "index", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.IndexColumn)(nil)), + to.Type((*scpb.TemporaryIndex)(nil)), + JoinOnIndexID(from, to, "table-id", "index-id"), + StatusesTransient(from, scpb.Status_PUBLIC, to, scpb.Status_WRITE_ONLY), + } + }) + + registerDepRule( + "column existence precedes index existence", + scgraph.Precedence, + "column", "index", + func(from, to NodeVars) rel.Clauses { + ic := MkNodeVars("index-column") + relationID, columnID := rel.Var("table-id"), rel.Var("column-id") + return rel.Clauses{ + from.Type((*scpb.Column)(nil)), + to.Type((*scpb.PrimaryIndex)(nil), (*scpb.SecondaryIndex)(nil)), + JoinOnColumnID(from, ic, relationID, columnID), + ColumnInIndex(ic, to, relationID, columnID, "index-id"), + StatusesToPublicOrTransient(from, scpb.Status_DELETE_ONLY, to, scpb.Status_BACKFILL_ONLY), + } + }, + ) + + registerDepRule( + "column existence precedes temp index existence", + scgraph.Precedence, + "column", "index", + func(from, to NodeVars) rel.Clauses { + ic := MkNodeVars("index-column") + relationID, columnID := rel.Var("table-id"), rel.Var("column-id") + return rel.Clauses{ + from.Type((*scpb.Column)(nil)), + to.Type((*scpb.TemporaryIndex)(nil)), + JoinOnColumnID(ic, from, relationID, columnID), + ColumnInIndex(ic, to, relationID, columnID, "index-id"), + StatusesToPublicOrTransient(from, scpb.Status_DELETE_ONLY, to, scpb.Status_DELETE_ONLY), + } + }, + ) + + // We need to ensure that the temporary index has all the relevant writes + // to any columns it contains. We ensure elsewhere that any index which + // will later be merged with the temporary index is not backfilled until + // that temporary index is receiving writes. This rule ensures that those + // write operations contain data for all columns. + registerDepRule( + "column is WRITE_ONLY before temporary index is WRITE_ONLY", + scgraph.Precedence, + "column", "index", + func(from, to NodeVars) rel.Clauses { + ic := MkNodeVars("index-column") + relationID, columnID := rel.Var("table-id"), rel.Var("column-id") + return rel.Clauses{ + from.El.Type((*scpb.Column)(nil)), + to.El.Type((*scpb.TemporaryIndex)(nil)), + JoinOnColumnID(ic, from, relationID, columnID), + ColumnInIndex(ic, to, relationID, columnID, "index-id"), + StatusesToPublicOrTransient(from, scpb.Status_WRITE_ONLY, to, scpb.Status_WRITE_ONLY), + } + }, + ) + + registerDepRule( + "swapped primary index public before column", + scgraph.Precedence, + "index", "column", + func(from, to NodeVars) rel.Clauses { + ic := MkNodeVars("index-column") + relationID, columnID := rel.Var("table-id"), rel.Var("column-id") + return rel.Clauses{ + from.Type((*scpb.PrimaryIndex)(nil)), + to.Type((*scpb.Column)(nil)), + ColumnInSwappedInPrimaryIndex(ic, from, relationID, columnID, "index-id"), + JoinOnColumnID(ic, to, relationID, columnID), + StatusesToPublicOrTransient(from, scpb.Status_PUBLIC, to, scpb.Status_PUBLIC), + } + }, + ) + +} diff --git a/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_add_index_and_constraint.go b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_add_index_and_constraint.go new file mode 100644 index 000000000000..fdb3de515f27 --- /dev/null +++ b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_add_index_and_constraint.go @@ -0,0 +1,37 @@ +// Copyright 2022 The Cockroach Authors. +// +// Use of this software is governed by the CockroachDB Software License +// included in the /LICENSE file. + +package release_25_1 + +import ( + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/rel" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" + . "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/rules" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/scgraph" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/screl" +) + +// These rules ensure that indexes and constraints on those indexes come +// to existence in the appropriate order. +func init() { + registerDepRule( + "index is ready to be validated before we validate constraint on it", + scgraph.Precedence, + "index", "constraint", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.PrimaryIndex)(nil)), + to.TypeFilter(rulesVersionKey, isNonIndexBackedConstraint, isSubjectTo2VersionInvariant), + JoinOnDescID(from, to, "table-id"), + JoinOn( + from, screl.IndexID, + to, screl.IndexID, + "index-id-for-validation", + ), + StatusesToPublicOrTransient(from, scpb.Status_VALIDATED, to, scpb.Status_VALIDATED), + } + }, + ) +} diff --git a/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_add_trigger.go b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_add_trigger.go new file mode 100644 index 000000000000..0da4c89a4815 --- /dev/null +++ b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_add_trigger.go @@ -0,0 +1,29 @@ +// Copyright 2024 The Cockroach Authors. +// +// Use of this software is governed by the CockroachDB Software License +// included in the /LICENSE file. + +package release_25_1 + +import ( + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/rel" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" + . "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/rules" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/scgraph" +) + +func init() { + registerDepRule( + "trigger public before its dependents", + scgraph.Precedence, + "trigger", "dependent", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.Trigger)(nil)), + to.TypeFilter(rulesVersionKey, isTriggerDependent), + JoinOnTriggerID(from, to, "table-id", "trigger-id"), + StatusesToPublicOrTransient(from, scpb.Status_PUBLIC, to, scpb.Status_PUBLIC), + } + }, + ) +} diff --git a/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_alter_column_type.go b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_alter_column_type.go new file mode 100644 index 000000000000..00f30b6a5e65 --- /dev/null +++ b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_alter_column_type.go @@ -0,0 +1,72 @@ +// Copyright 2022 The Cockroach Authors. +// +// Use of this software is governed by the CockroachDB Software License +// included in the /LICENSE file. + +package release_25_1 + +import ( + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/rel" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" + . "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/rules" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/scgraph" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/screl" +) + +// This rule ensures that when changing the column type, that the old column +// type is dropped before the new type is added. +func init() { + registerDepRule( + "column type update is decomposed as a drop then add", + scgraph.Precedence, + "old-column-type", "new-column-type", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.ColumnType)(nil)), + to.Type((*scpb.ColumnType)(nil)), + JoinOnColumnID(from, to, "table-id", "col-id"), + from.TargetStatus(scpb.ToAbsent), + from.CurrentStatus(scpb.Status_PUBLIC), + to.TargetStatus(scpb.ToPublic), + to.CurrentStatus(scpb.Status_ABSENT), + } + }, + ) + + registerDepRule( + "column type is changed to public after doing validation of a transient check constraint", + scgraph.SameStagePrecedence, + "transient-check-constraint", "column-type", + func(from, to NodeVars) rel.Clauses { + colID := rel.Var("columnID") + return rel.Clauses{ + from.Type((*scpb.CheckConstraint)(nil)), + to.Type((*scpb.ColumnType)(nil)), + JoinOnDescID(from, to, "table-id"), + to.El.AttrEqVar(screl.ColumnID, colID), + from.ReferencedColumnIDsContains(colID), + from.TargetStatus(scpb.Transient), + to.TargetStatus(scpb.ToPublic), + from.CurrentStatus(scpb.Status_TRANSIENT_VALIDATED), + to.CurrentStatus(scpb.Status_PUBLIC), + } + }, + ) + + registerDepRule( + "adding a transient column compute expression moves to 'absent' after PK validation to ensures it's there for the backfill", + scgraph.Precedence, + "primary-index", "transient-column-compute", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.PrimaryIndex)(nil)), + to.Type((*scpb.ColumnComputeExpression)(nil)), + JoinOnDescID(from, to, "table-id"), + from.TargetStatus(scpb.ToPublic), + to.TargetStatus(scpb.Transient), + from.CurrentStatus(scpb.Status_VALIDATED), + to.CurrentStatus(scpb.Status_TRANSIENT_ABSENT), + } + }, + ) +} diff --git a/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_create.go b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_create.go new file mode 100644 index 000000000000..a5c6654c2d7d --- /dev/null +++ b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_create.go @@ -0,0 +1,59 @@ +// Copyright 2023 The Cockroach Authors. +// +// Use of this software is governed by the CockroachDB Software License +// included in the /LICENSE file. + +package release_25_1 + +import ( + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/rel" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" + . "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/rules" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/scgraph" +) + +func init() { + registerDepRule( + "descriptor existence precedes dependents", + scgraph.Precedence, + "relation", "dependent", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.TypeFilter(rulesVersionKey, isDescriptor), + to.TypeFilter(rulesVersionKey, Not(isDescriptor)), + JoinOnDescID(from, to, "relation-id"), + StatusesToPublicOrTransient(from, scpb.Status_DESCRIPTOR_ADDED, to, scpb.Status_PUBLIC), + } + }, + ) + + registerDepRule( + "dependents exist before descriptor becomes public", + scgraph.Precedence, + "dependent", "relation", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.TypeFilter(rulesVersionKey, Not(isDescriptor), Not(isData)), + to.TypeFilter(rulesVersionKey, isDescriptor), + JoinOnDescID(from, to, "relation-id"), + StatusesToPublicOrTransient(from, scpb.Status_PUBLIC, to, scpb.Status_PUBLIC), + } + }, + ) +} + +func init() { + registerDepRule( + "namespace exist before schema parent", + scgraph.Precedence, + "dependent", "relation", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.Namespace)(nil)), + to.Type((*scpb.SchemaParent)(nil)), + JoinOnDescID(from, to, "schema-id"), + StatusesToPublicOrTransient(from, scpb.Status_PUBLIC, to, scpb.Status_PUBLIC), + } + }, + ) +} diff --git a/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_create_function.go b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_create_function.go new file mode 100644 index 000000000000..87f0793c3c05 --- /dev/null +++ b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_create_function.go @@ -0,0 +1,31 @@ +// Copyright 2023 The Cockroach Authors. +// +// Use of this software is governed by the CockroachDB Software License +// included in the /LICENSE file. + +package release_25_1 + +import ( + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/rel" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" + . "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/rules" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/scgraph" +) + +func init() { + // When setting object parent ids, we need to add the function to schema, a + // function name is needed for this. + registerDepRule( + "function name should be set before parent ids", + scgraph.Precedence, + "function-name", "function-parent", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.FunctionName)(nil)), + to.Type((*scpb.SchemaChild)(nil)), + JoinOnDescID(from, to, "function-id"), + StatusesToPublicOrTransient(from, scpb.Status_PUBLIC, to, scpb.Status_PUBLIC), + } + }, + ) +} diff --git a/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_create_policy.go b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_create_policy.go new file mode 100644 index 000000000000..4f789528daaf --- /dev/null +++ b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_create_policy.go @@ -0,0 +1,29 @@ +// Copyright 2025 The Cockroach Authors. +// +// Use of this software is governed by the CockroachDB Software License +// included in the /LICENSE file. + +package release_25_1 + +import ( + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/rel" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" + . "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/rules" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/scgraph" +) + +func init() { + registerDepRule( + "dependents added after policy", + scgraph.SameStagePrecedence, + "policy", "dependent", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.Policy)(nil)), + to.TypeFilter(rulesVersionKey, isPolicyDependent), + JoinOnPolicyID(from, to, "table-id", "policy-id"), + StatusesToPublicOrTransient(from, scpb.Status_PUBLIC, to, scpb.Status_PUBLIC), + } + }, + ) +} diff --git a/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_drop_column.go b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_drop_column.go new file mode 100644 index 000000000000..00a64327c48f --- /dev/null +++ b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_drop_column.go @@ -0,0 +1,307 @@ +// Copyright 2022 The Cockroach Authors. +// +// Use of this software is governed by the CockroachDB Software License +// included in the /LICENSE file. + +package release_25_1 + +import ( + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/rel" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" + . "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/rules" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/scgraph" +) + +// These rules ensure that column-dependent elements, like a column's name, its +// DEFAULT expression, etc. disappear once the column reaches a suitable state. +func init() { + + // N.B. This rules is superseded by the "column constraint removed right before + // column reaches write only" rule below for the not null column check. + registerDepRuleForDrop( + "column no longer public before dependents", + scgraph.Precedence, + "column", "dependent", + scpb.Status_WRITE_ONLY, scpb.Status_ABSENT, + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.Column)(nil)), + to.TypeFilter(rulesVersionKey, isColumnDependent, Not(isColumnNotNull)), + JoinOnColumnID(from, to, "table-id", "col-id"), + } + }, + ) + + registerDepRuleForDrop( + "dependents removed before column", + scgraph.Precedence, + "dependent", "column", + scpb.Status_ABSENT, scpb.Status_ABSENT, + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.TypeFilter(rulesVersionKey, isColumnDependent), + to.Type((*scpb.Column)(nil)), + JoinOnColumnID(from, to, "table-id", "col-id"), + } + }, + ) + + registerDepRule( + "column type removed before column family", + scgraph.Precedence, + "column-type", "column-family", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.ColumnType)(nil)), + to.Type((*scpb.ColumnFamily)(nil)), + JoinOnColumnFamilyID(from, to, "table-id", "family-id"), + StatusesToAbsent(from, scpb.Status_ABSENT, to, scpb.Status_ABSENT), + } + }, + ) +} + +// Special cases of the above. +func init() { + + registerDepRule( + "column type dependents removed right before column type, except if part of a column type alteration ", + scgraph.SameStagePrecedence, + "dependent", "column-type", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.TypeFilter(rulesVersionKey, isColumnTypeDependent), + to.Type((*scpb.ColumnType)(nil)), + JoinOnColumnID(from, to, "table-id", "col-id"), + IsNotAlterColumnTypeOp("table-id", "col-id"), + StatusesToAbsent(from, scpb.Status_ABSENT, to, scpb.Status_ABSENT), + } + }, + ) + + // This rule is similar to the previous one but relaxes SameStagePrecedence, + // allowing for planning in case the ALTER COLUMN .. TYPE needs to roll back + // (particularly when altering columns with DEFAULT or ON UPDATE expressions). + registerDepRule( + "during a column type alterations, column type dependents removed before column type", + scgraph.Precedence, + "dependent", "column-type", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.TypeFilter(rulesVersionKey, isColumnTypeDependent), + to.Type((*scpb.ColumnType)(nil)), + JoinOnColumnID(from, to, "table-id", "col-id"), + rel.And(IsAlterColumnTypeOp("table-id", "col-id")...), + StatusesToAbsent(from, scpb.Status_ABSENT, to, scpb.Status_ABSENT), + } + }, + ) + + // Special cases for removal of column types, which hold references to other + // descriptors. + // + // When the whole table is dropped, we can (and in fact, should) remove these + // right away in-txn. However, when only the column is dropped but the table + // remains, we need to wait until the column is DELETE_ONLY, which happens + // post-commit because of the need to uphold the 2-version invariant. + // + // We distinguish the two cases using a flag in ColumnType which is set iff + // the parent relation is dropped. This is a dirty hack, ideally we should be + // able to express the _absence_ of a target element as a query clause. + // + // Note that DEFAULT and ON UPDATE expressions are column-dependent elements + // which also hold references to other descriptors. The rules prior to this one + // ensures that they transition to ABSENT before scpb.ColumnType does. + registerDepRule( + "column type removed right before column when not dropping relation", + scgraph.SameStagePrecedence, + "column-type", "column", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.ColumnType)(nil)), + descriptorIsNotBeingDropped(from.El), + to.Type((*scpb.Column)(nil)), + JoinOnColumnID(from, to, "table-id", "col-id"), + StatusesToAbsent(from, scpb.Status_ABSENT, to, scpb.Status_ABSENT), + } + }, + ) + + // This rule ensures that a column is dropped only after any computed column + // dependent on it is dropped. For example, if column B is a computed column + // using column A in its compute expression, this rule ensures that the + // compute expression of B is dropped before column A is dropped. The rules + // above ensure that column B is dropped before the expression is dropped, + // so this rule also implicitly implies that column B is dropped before column + // A. This is relevant for expression and hash indexes which create an + // internal, virtual column that computes the hash/expression key for the index. + // + // N.B. Originally, this rule was specific only to virtual, computed columns. + // The rationale was that it was needed due to an edge case within the + // optimizer. The optimizer allows the compute expression of virtual computed + // columns to be evaluated during an active schema change. Without this rule, + // the optimizer cannot read the dependent column as the dependent column + // moves to the WRITE_ONLY stage before the computed column is fully dropped. + // + // However, it is now needed for all compute expressions. When altering a + // column's type such that a backfill is required, a new version of the column + // is added, and the old version is dropped. A temporary compute expression is + // set to map the old rows to the new column type. This expression is dropped + // *before* dropping the old column, which this rule helps to enforce. + registerDepRuleForDrop( + "Computed column expression is dropped before the column it depends on", + scgraph.Precedence, + "column-expr", "column", + scpb.Status_ABSENT, scpb.Status_WRITE_ONLY, + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.ColumnComputeExpression)(nil)), + to.Type((*scpb.Column)(nil)), + JoinOnDescID(from, to, "table-id"), + FilterElements("computedColumnTypeReferencesColumn", from, to, + func(computeExpression *scpb.ColumnComputeExpression, column *scpb.Column) bool { + for _, refColumns := range computeExpression.ReferencedColumnIDs { + if refColumns == column.ColumnID { + return true + } + } + return false + }), + } + }, + ) + + // Column constraint disappears in the same stage as the column + // becomes WRITE_ONLY. + // + // Column constraint cannot disappear while the column is still publicly writable + // because we then allow incorrect writes that would violate the constraint. + // + // Column constraint cannot still be enforced when the column becomes + // non-public because an enforced constraint means writes will see and + // attempt to uphold it but the column is no longer visible to them. + // + // N.B. This rule supersedes the above "dependents removed before column" rule. + // N.B. SameStage is enough; which transition happens first won't matter. + registerDepRuleForDrop( + "column constraint removed right before column reaches write only", + scgraph.Precedence, + "column-constraint", "column", + scpb.Status_ABSENT, scpb.Status_WRITE_ONLY, + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.TypeFilter(rulesVersionKey, isNonIndexBackedConstraint, isSubjectTo2VersionInvariant), + to.Type((*scpb.Column)(nil)), + JoinOnColumnID(from, to, "table-id", "col-id"), + } + }, + ) + + // This rule enforces that a new primary index moves to the public stage only after all columns stored + // within the old primary index move to WRITE_ONLY. Without this, the new primary index is at risk of not + // storing all public columns within the table (as the column being dropped is still considered public + // before it moves to WRITE_ONLY but the new primary index does not contain it since the schema changer + // knows it is transitioning to a target status of ABSENT). + // + // This rule applies only when the operation is not ALTER COLUMN TYPE. A variant of this rule follows, + // allowing added and dropped columns to be swapped in the same stage during ALTER COLUMN TYPE. + registerDepRule( + "New primary index should go public only after columns being dropped move to WRITE_ONLY", + scgraph.Precedence, + "column", "new-primary-index", + func(from, to NodeVars) rel.Clauses { + ic := MkNodeVars("index-column") + relationID, columnID, indexID := rel.Var("table-id"), rel.Var("old-column-id"), rel.Var("index-id") + return rel.Clauses{ + from.Type((*scpb.Column)(nil)), + to.Type((*scpb.PrimaryIndex)(nil)), + ColumnInSourcePrimaryIndex(ic, to, relationID, columnID, indexID), + JoinOnColumnID(ic, from, relationID, columnID), + from.TargetStatus(scpb.ToAbsent), + from.CurrentStatus(scpb.Status_WRITE_ONLY), + to.TargetStatus(scpb.ToPublic), + to.CurrentStatus(scpb.Status_PUBLIC), + IsNotDroppedColumnPartOfAlterColumnTypeOp("table-id", "old-column-id"), + } + }, + ) + + // This rule is similar to the previous one but applies specifically to ALTER COLUMN ... TYPE operations. + // It uses SameStagePrecedence to enable the swapping of dropped and added columns within the same stage. + registerDepRule( + "New primary index for alter column type should go public in the same stage as dropped column", + scgraph.SameStagePrecedence, + "column", "new-primary-index", + func(from, to NodeVars) rel.Clauses { + ic := MkNodeVars("index-column") + relationID, columnID, indexID := rel.Var("table-id"), rel.Var("old-column-id"), rel.Var("index-id") + return rel.Clauses{ + from.Type((*scpb.Column)(nil)), + to.Type((*scpb.PrimaryIndex)(nil)), + ColumnInSourcePrimaryIndex(ic, to, relationID, columnID, indexID), + JoinOnColumnID(ic, from, relationID, columnID), + from.TargetStatus(scpb.ToAbsent), + from.CurrentStatus(scpb.Status_WRITE_ONLY), + to.TargetStatus(scpb.ToPublic), + to.CurrentStatus(scpb.Status_PUBLIC), + rel.And(IsDroppedColumnPartOfAlterColumnTypeOp("table-id", "old-column-id")...), + } + }, + ) +} + +// Special rules partial predicate expressions, which ensure that any columns +// used by them are not cleaned up before the partial index peredicate is +// removed. +func init() { + registerDepRuleForDrop( + "secondary index partial no longer public before referenced column", + scgraph.Precedence, + "secondary-partial-index", "column", + scpb.Status_DELETE_ONLY, scpb.Status_WRITE_ONLY, + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.SecondaryIndex)(nil)), + to.Type((*scpb.Column)(nil)), + JoinOnDescID(from, to, "table-id"), + descriptorIsNotBeingDropped(from.El), + FilterElements("secondaryIndexReferencesColumn", from, to, + func(index *scpb.SecondaryIndex, column *scpb.Column) bool { + if index.EmbeddedExpr == nil { + return false + } + for _, refColumns := range index.EmbeddedExpr.ReferencedColumnIDs { + if refColumns == column.ColumnID { + return true + } + } + return false + }), + } + }, + ) + + registerDepRuleForDrop( + "secondary index partial no longer public before referenced column", + scgraph.Precedence, + "secondary-partial-index", "column", + scpb.Status_ABSENT, scpb.Status_WRITE_ONLY, + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.SecondaryIndexPartial)(nil)), + to.Type((*scpb.Column)(nil)), + JoinOnDescID(from, to, "table-id"), + descriptorIsNotBeingDropped(from.El), + FilterElements("secondaryIndexReferencesColumn", from, to, + func(index *scpb.SecondaryIndexPartial, column *scpb.Column) bool { + for _, refColumns := range index.ReferencedColumnIDs { + if refColumns == column.ColumnID { + return true + } + } + return false + }), + } + }, + ) +} diff --git a/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_drop_constraint.go b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_drop_constraint.go new file mode 100644 index 000000000000..add3af60e14b --- /dev/null +++ b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_drop_constraint.go @@ -0,0 +1,96 @@ +// Copyright 2022 The Cockroach Authors. +// +// Use of this software is governed by the CockroachDB Software License +// included in the /LICENSE file. + +package release_25_1 + +import ( + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/rel" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" + . "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/rules" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/scgraph" +) + +// These rules ensure that constraint-dependent elements, like an constraint's +// name, etc. disappear once the constraint reaches a suitable state. +func init() { + + registerDepRuleForDrop( + "constraint no longer public before dependents", + scgraph.Precedence, + "constraint", "dependent", + scpb.Status_VALIDATED, scpb.Status_ABSENT, + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.TypeFilter(rulesVersionKey, isNonIndexBackedConstraint, isSubjectTo2VersionInvariant), + to.TypeFilter(rulesVersionKey, isConstraintDependent, Not(isConstraintWithoutIndexName)), + JoinOnConstraintID(from, to, "table-id", "constraint-id"), + } + }, + ) + + registerDepRuleForDrop( + "dependents removed before constraint", + scgraph.Precedence, + "dependents", "constraint", + scpb.Status_ABSENT, scpb.Status_ABSENT, + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.TypeFilter(rulesVersionKey, isConstraintDependent, Not(isConstraintWithoutIndexName)), + to.TypeFilter(rulesVersionKey, isNonIndexBackedConstraint, isSubjectTo2VersionInvariant), + JoinOnConstraintID(from, to, "table-id", "constraint-id"), + } + }, + ) +} + +// These rules apply to simple constraints and ensure that their dependents, like +// their names, comments, etc., disappear right before the simple constraint. +func init() { + + registerDepRuleForDrop( + "dependents removed right before simple constraint", + scgraph.SameStagePrecedence, + "dependents", "constraint", + scpb.Status_ABSENT, scpb.Status_ABSENT, + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.TypeFilter(rulesVersionKey, isConstraintDependent, Not(isConstraintWithoutIndexName)), + to.TypeFilter(rulesVersionKey, isNonIndexBackedConstraint, Not(isSubjectTo2VersionInvariant)), + JoinOnConstraintID(from, to, "table-id", "constraint-id"), + } + }, + ) + + // Constraint name should be cleared right before the constraint is no + // longer visible. + registerDepRuleForDrop( + "Constraint should be hidden before name", + scgraph.Precedence, + "constraint-name", "constraint", + scpb.Status_ABSENT, scpb.Status_ABSENT, + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.ConstraintWithoutIndexName)(nil)), + to.TypeFilter(rulesVersionKey, isNonIndexBackedConstraint), + JoinOnConstraintID(from, to, "table-id", "constraint-id"), + } + }, + ) + // Constraint should be validated before the constraint name is attempted + // to be cleaned. + registerDepRuleForDrop( + "Constraint should be hidden before name", + scgraph.Precedence, + "constraint", "constraint-name", + scpb.Status_VALIDATED, scpb.Status_ABSENT, + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.TypeFilter(rulesVersionKey, isNonIndexBackedConstraint), + to.Type((*scpb.ConstraintWithoutIndexName)(nil)), + JoinOnConstraintID(from, to, "table-id", "constraint-id"), + } + }, + ) +} diff --git a/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_drop_index.go b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_drop_index.go new file mode 100644 index 000000000000..8f07cd0305ae --- /dev/null +++ b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_drop_index.go @@ -0,0 +1,205 @@ +// Copyright 2022 The Cockroach Authors. +// +// Use of this software is governed by the CockroachDB Software License +// included in the /LICENSE file. + +package release_25_1 + +import ( + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/rel" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" + . "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/rules" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/scgraph" +) + +// These rules ensure that index-dependent elements, like an index's name, its +// partitioning, etc. disappear once the index reaches a suitable state. +func init() { + + // For a column to be removed from an index, the index must be validated, + // which will not happen for temporary ones. + registerDepRuleForDrop( + "index no longer public before dependents, excluding columns", + scgraph.Precedence, + "index", "dependent", + scpb.Status_VALIDATED, scpb.Status_ABSENT, + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.TypeFilter(rulesVersionKey, isIndex), + to.TypeFilter(rulesVersionKey, isIndexDependent, Not(isIndexColumn)), + JoinOnIndexID(from, to, "table-id", "index-id"), + } + }, + ) + // For temporary indexes we have to wait till DELETE_ONLY for primary index + // swaps, as the temporary index transitions into a drop state. Normally these + // get optimized out, so it should be safe to wait longer for all index types. + registerDepRuleForDrop( + "index drop mutation visible before cleaning up index columns", + scgraph.Precedence, + "index", "dependent", + scpb.Status_DELETE_ONLY, scpb.Status_ABSENT, + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.TypeFilter(rulesVersionKey, isIndex), + to.TypeFilter(rulesVersionKey, isIndexColumn), + JoinOnIndexID(from, to, "table-id", "index-id"), + } + }, + ) + registerDepRuleForDrop( + "dependents removed before index", + scgraph.Precedence, + "dependent", "index", + scpb.Status_ABSENT, scpb.Status_ABSENT, + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.TypeFilter(rulesVersionKey, isIndexDependent), + to.TypeFilter(rulesVersionKey, isIndex), + JoinOnIndexID(from, to, "table-id", "index-id"), + } + }, + ) + + // This rule helps us to have the index name inside event log entries. + registerDepRuleForDrop( + "index no longer public before index name", + scgraph.Precedence, + "index", "name", + scpb.Status_DELETE_ONLY, scpb.Status_ABSENT, + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.SecondaryIndex)(nil)), + to.Type((*scpb.IndexName)(nil)), + JoinOnIndexID(from, to, "table-id", "index-id"), + } + }, + ) +} + +// Special cases of the above. +func init() { + + // If we're going to be removing columns from an index, we know that + // it'll be because we're dropping the index. If we're dropping the + // index and not the descriptor, we need to make sure that we only + // do it once the index is definitely being dropped. The reason for + // this is roundabout: dropping a column from an index which is itself + // being dropped is treated as a no-op by the op rules. + // + // TODO(ajwerner): This rule really feels like it ought to be a + // same stage precedence sort of rule where we remove the columns from the + // index when we remove the index, but for some reason, that overconstrains + // the graph when dropping the table. Because of that, we allow the column + // to be removed from the index in DELETE_ONLY, and we no-op the removal. + registerDepRuleForDrop( + "remove columns from index right before removing index", + scgraph.Precedence, + "index-column", "index", + scpb.Status_DELETE_ONLY, scpb.Status_ABSENT, + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.IndexColumn)(nil)), + to.TypeFilter(rulesVersionKey, isIndex), + JoinOnIndexID(from, to, "table-id", "index-id"), + } + }, + ) + + // Special case for removal of partial predicates, which hold references to + // other descriptors. + // + // When the whole table is dropped, we can (and in fact, should) remove these + // right away in-txn. However, when only the index is dropped but the table + // remains, we need to wait until the index is DELETE_ONLY, which happens + // post-commit because of the need to uphold the 2-version invariant. + // + // We distinguish the two cases using a flag in SecondaryIndexPartial which is + // set iff the parent relation is dropped. This is a dirty hack, ideally we + // should be able to express the _absence_ of a target element as a query + // clause. + registerDepRuleForDrop( + "partial predicate removed right before secondary index when not dropping relation", + scgraph.SameStagePrecedence, + "partial-predicate", "index", + scpb.Status_ABSENT, scpb.Status_ABSENT, + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.SecondaryIndexPartial)(nil)), + descriptorIsNotBeingDropped(from.El), + to.Type((*scpb.SecondaryIndex)(nil)), + JoinOnIndexID(from, to, "table-id", "index-id"), + } + }, + ) + +} + +func init() { + // TODO(fqazi): We need to model these rules better to use indexes, + // since they may perform terrible in scenarios where we are dropping + // a large number of views and indexes (i.e. O(views * indexes) ). + registerDepRuleForDrop( + "dependent view no longer public before secondary index", + scgraph.Precedence, + "view", "index", + scpb.Status_DROPPED, scpb.Status_VALIDATED, + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.View)(nil)), + to.Type((*scpb.SecondaryIndex)(nil)), + FilterElements("viewReferencesIndex", from, to, func(from *scpb.View, to *scpb.SecondaryIndex) bool { + for _, ref := range from.ForwardReferences { + if ref.ToID == to.TableID && + ref.IndexID == to.IndexID { + return true + } + } + return false + }), + } + }, + ) + registerDepRuleForDrop( + "secondary index should be validated before dependent view can be absent", + scgraph.Precedence, + "index", "view", + scpb.Status_VALIDATED, scpb.Status_ABSENT, + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.SecondaryIndex)(nil)), + to.Type((*scpb.View)(nil)), + FilterElements("viewReferencesIndex", from, to, func(from *scpb.SecondaryIndex, to *scpb.View) bool { + for _, ref := range to.ForwardReferences { + if ref.ToID == from.TableID && + ref.IndexID == from.IndexID { + return true + } + } + return false + }), + } + }, + ) + registerDepRuleForDrop( + "dependent view absent before secondary index", + scgraph.Precedence, + "view", "index", + scpb.Status_ABSENT, scpb.Status_ABSENT, + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.View)(nil)), + to.Type((*scpb.SecondaryIndex)(nil)), + FilterElements("viewReferencesIndex", from, to, func(from *scpb.View, to *scpb.SecondaryIndex) bool { + for _, ref := range from.ForwardReferences { + if ref.ToID == to.TableID && + ref.IndexID == to.IndexID { + return true + } + } + return false + }), + } + }, + ) +} diff --git a/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_drop_index_and_column.go b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_drop_index_and_column.go new file mode 100644 index 000000000000..6588d560f53e --- /dev/null +++ b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_drop_index_and_column.go @@ -0,0 +1,82 @@ +// Copyright 2022 The Cockroach Authors. +// +// Use of this software is governed by the CockroachDB Software License +// included in the /LICENSE file. + +package release_25_1 + +import ( + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/rel" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" + . "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/rules" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/scgraph" +) + +// These rules ensure that columns and indexes containing these columns +// disappear from existence in the correct order. +func init() { + + // Without this rule, we might have an index which exists and contains + // a column which does not exist. This would lead to panics inside the + // optimizer and an invalid table descriptor. + registerDepRuleForDrop("indexes containing column reach absent before column", + scgraph.Precedence, + "index", "column", + scpb.Status_ABSENT, scpb.Status_ABSENT, + func(from, to NodeVars) rel.Clauses { + ic := MkNodeVars("index-column") + relationID, columnID := rel.Var("table-id"), rel.Var("column-id") + return rel.Clauses{ + from.Type((*scpb.PrimaryIndex)(nil), (*scpb.SecondaryIndex)(nil)), + to.Type((*scpb.Column)(nil)), + ColumnInIndex(ic, from, relationID, columnID, "index-id"), + JoinOnColumnID(ic, to, relationID, columnID), + descriptorIsNotBeingDropped(ic.El), + } + }) + + registerDepRule("secondary indexes containing column as key reach write-only before column", + scgraph.Precedence, + "index", "column", + func(from, to NodeVars) rel.Clauses { + ic := MkNodeVars("index-column") + relationID, columnID := rel.Var("table-id"), rel.Var("column-id") + return rel.Clauses{ + from.Type((*scpb.SecondaryIndex)(nil)), + to.Type((*scpb.Column)(nil)), + ColumnInIndex(ic, from, relationID, columnID, "index-id"), + JoinOnColumnID(ic, to, relationID, columnID), + StatusesToAbsent(from, scpb.Status_VALIDATED, to, scpb.Status_WRITE_ONLY), + descriptorIsNotBeingDropped(ic.El), + rel.Filter("isIndexKeyColumnKey", ic.El)( + func(ic *scpb.IndexColumn) bool { + return ic.Kind == scpb.IndexColumn_KEY || ic.Kind == scpb.IndexColumn_KEY_SUFFIX + }, + ), + } + }) + + // This rule ensures if we are dropping a column, we only transition to non-public after + // all adding indexes are present in the table descriptor (i.e. all adding indexes reached + // BACKFILL_ONLY). + // This is used when we are dropping a column but have intermediate primary indexes; + // we should delay transitioning the column to non-public after all primary indexes + // have been added to the table descriptor as mutations. + registerDepRule("all adding indexes reached BACKFILL_ONLY before any of their columns disappear", + scgraph.Precedence, + "index", "column", + func(from, to NodeVars) rel.Clauses { + ic := MkNodeVars("index-column") + relationID, columnID := rel.Var("table-id"), rel.Var("column-id") + return rel.Clauses{ + from.Type((*scpb.PrimaryIndex)(nil), (*scpb.SecondaryIndex)(nil)), + to.Type((*scpb.Column)(nil)), + ColumnInIndex(ic, from, relationID, columnID, "index-id"), + JoinOnColumnID(ic, to, relationID, columnID), + from.TargetStatus(scpb.ToPublic, scpb.Transient), + from.CurrentStatus(scpb.Status_BACKFILL_ONLY), + to.TargetStatus(scpb.ToAbsent), + to.CurrentStatus(scpb.Status_WRITE_ONLY), + } + }) +} diff --git a/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_drop_object.go b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_drop_object.go new file mode 100644 index 000000000000..3d1e4a1bb562 --- /dev/null +++ b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_drop_object.go @@ -0,0 +1,295 @@ +// Copyright 2022 The Cockroach Authors. +// +// Use of this software is governed by the CockroachDB Software License +// included in the /LICENSE file. + +package release_25_1 + +import ( + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/rel" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" + . "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/rules" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/scgraph" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/screl" +) + +// These rules ensure that: +// - a descriptor reaches ABSENT in a different transaction than it reaches +// DROPPED (i.e. it cannot be removed until PostCommit). +// - a descriptor element reaches the DROPPED state in the txn before +// its dependent elements (namespace entry, comments, column names, etc) +// reach the ABSENT state; +// - or the WRITE_ONLY state for those dependent elements subject to the +// 2-version invariant. +func init() { + + registerDepRule( + "descriptor dropped in transaction before removal", + scgraph.PreviousTransactionPrecedence, + "dropped", "absent", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.TypeFilter(rulesVersionKey, isDescriptor), + from.El.AttrEqVar(screl.DescID, "_"), + from.El.AttrEqVar(rel.Self, to.El), + StatusesToAbsent(from, scpb.Status_DROPPED, to, scpb.Status_ABSENT), + } + }) + + registerDepRule( + "descriptor dropped before dependent element removal", + scgraph.Precedence, + "descriptor", "dependent", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.TypeFilter(rulesVersionKey, isDescriptor), + to.TypeFilter(rulesVersionKey, Or(isSimpleDependent, isOwner), Not(isConstraintDependent)), + JoinOnDescID(from, to, "desc-id"), + StatusesToAbsent(from, scpb.Status_DROPPED, to, scpb.Status_ABSENT), + } + }) + + registerDepRule( + "relation dropped before dependent column", + scgraph.Precedence, + "descriptor", "column", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.Table)(nil), (*scpb.View)(nil), (*scpb.Sequence)(nil)), + to.TypeFilter(rulesVersionKey, isColumn), + JoinOnDescID(from, to, "desc-id"), + StatusesToAbsent(from, scpb.Status_DROPPED, to, scpb.Status_WRITE_ONLY), + } + }) + + registerDepRule( + "relation dropped before dependent index", + scgraph.Precedence, + "descriptor", "index", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.Table)(nil), (*scpb.View)(nil)), + to.TypeFilter(rulesVersionKey, isIndex), + JoinOnDescID(from, to, "desc-id"), + StatusesToAbsent(from, scpb.Status_DROPPED, to, scpb.Status_VALIDATED), + } + }, + ) + + registerDepRule( + "relation dropped before dependent constraint", + scgraph.Precedence, + "descriptor", "constraint", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.Table)(nil)), + to.TypeFilter(rulesVersionKey, isNonIndexBackedConstraint, isSubjectTo2VersionInvariant, Not(isNonIndexBackedCrossDescriptorConstraint)), + JoinOnDescID(from, to, "desc-id"), + StatusesToAbsent(from, scpb.Status_DROPPED, to, scpb.Status_VALIDATED), + } + }, + ) + +} + +// These rules ensure that cross-referencing simple dependent elements reach +// ABSENT in the same stage right after the referenced descriptor element +// reaches DROPPED. +// +// References from simple dependent elements to other descriptors exist as +// follows: +// - simple dependent elements with a ReferencedDescID attribute, +// - those which embed a TypeT, +// - those which embed an Expression. +func init() { + + registerDepRule( + "descriptor drop right before removing dependent with attr ref", + scgraph.SameStagePrecedence, + "referenced-descriptor", "referencing-via-attr", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.TypeFilter(rulesVersionKey, isDescriptor), + to.TypeFilter(rulesVersionKey, isSimpleDependent, Not(isDescriptorParentReference)), + JoinReferencedDescID(to, from, "desc-id"), + StatusesToAbsent(from, scpb.Status_DROPPED, to, scpb.Status_ABSENT), + } + }, + ) + + // If the descriptor references this type is already being dropped, then + // the back references don't really matter. + registerDepRule( + "descriptor drop right before removing dependent between types", + scgraph.SameStagePrecedence, + "referenced-descriptor", "referencing-via-type", + func(from, to NodeVars) rel.Clauses { + fromDescID := rel.Var("fromDescID") + return rel.Clauses{ + from.TypeFilter(rulesVersionKey, isTypeDescriptor), + from.DescIDEq(fromDescID), + to.ReferencedTypeDescIDsContain(fromDescID), + to.TypeFilter(rulesVersionKey, isSimpleDependent, isWithTypeT), + StatusesToAbsent(from, scpb.Status_DROPPED, to, scpb.Status_ABSENT), + } + }, + ) + registerDepRule( + "descriptor drop right before removing dependent with type refs in expressions", + scgraph.SameStagePrecedence, + "referenced-descriptor", "referencing-via-type", + func(from, to NodeVars) rel.Clauses { + fromDescID := rel.Var("fromDescID") + return rel.Clauses{ + from.TypeFilter(rulesVersionKey, isTypeDescriptor), + from.DescIDEq(fromDescID), + to.ReferencedTypeDescIDsContain(fromDescID), + descriptorIsNotBeingDropped(to.El), + to.TypeFilter(rulesVersionKey, isSimpleDependent, isWithExpression), + StatusesToAbsent(from, scpb.Status_DROPPED, to, scpb.Status_ABSENT), + } + }, + ) + + registerDepRule( + "descriptor drop right before removing dependent with expr ref to sequence", + scgraph.SameStagePrecedence, + "referenced-descriptor", "referencing-via-expr", + func(from, to NodeVars) rel.Clauses { + seqID := rel.Var("seqID") + return rel.Clauses{ + from.Type((*scpb.Sequence)(nil)), + from.DescIDEq(seqID), + to.ReferencedSequenceIDsContains(seqID), + to.TypeFilter(rulesVersionKey, isSimpleDependent, isWithExpression), + StatusesToAbsent(from, scpb.Status_DROPPED, to, scpb.Status_ABSENT), + } + }, + ) + + registerDepRule( + "descriptor drop right before removing dependent with function refs in columns", + scgraph.SameStagePrecedence, + "referenced-descriptor", "referencing-via-function", + func(from, to NodeVars) rel.Clauses { + fromDescID := rel.Var("fromDescID") + return rel.Clauses{ + from.Type((*scpb.Function)(nil)), + from.DescIDEq(fromDescID), + to.ReferencedFunctionIDsContains(fromDescID), + to.TypeFilter(rulesVersionKey, isSimpleDependent, isWithExpression), + StatusesToAbsent(from, scpb.Status_DROPPED, to, scpb.Status_ABSENT), + } + }, + ) + +} + +// These rules ensure that descriptor, back-reference in parent descriptor, +// and parent descriptor are dropped in appropriate order. +func init() { + + // We don't like those parent-descriptor-back-reference elements: in hindsight, + // we shouldn't have them in the first place because we cannot modify + // back-references in parent descriptor in isolation with the SQL syntax. + // This rule is to deal with this fact by tightly coupling them to the descriptor. + registerDepRule( + "descriptor dropped right before removing back-reference in its parent descriptor", + scgraph.SameStagePrecedence, + "descriptor", "back-reference-in-parent-descriptor", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.TypeFilter(rulesVersionKey, isDescriptor), + to.TypeFilter(rulesVersionKey, isDescriptorParentReference), + JoinOnDescID(from, to, "desc-id"), + StatusesToAbsent(from, scpb.Status_DROPPED, to, scpb.Status_ABSENT), + } + }) + + registerDepRule( + "back-reference in parent descriptor is removed before parent descriptor is dropped", + scgraph.Precedence, + "back-reference-in-parent-descriptor", "parent-descriptor", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.TypeFilter(rulesVersionKey, isDescriptorParentReference), + to.TypeFilter(rulesVersionKey, isDescriptor), + JoinReferencedDescID(from, to, "desc-id"), + StatusesToAbsent(from, scpb.Status_ABSENT, to, scpb.Status_DROPPED), + } + }, + ) +} + +// These rules ensure that dependents get removed before the descriptor. +// Some operations might require the descriptor to actually be present. +func init() { + registerDepRule( + "non-data dependents removed before descriptor", + scgraph.Precedence, + "dependent", "descriptor", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.TypeFilter(rulesVersionKey, Not(isDescriptor), Not(isData)), + to.TypeFilter(rulesVersionKey, isDescriptor), + JoinOnDescID(from, to, "desc-id"), + StatusesToAbsent(from, scpb.Status_ABSENT, to, scpb.Status_ABSENT), + } + }) +} + +// These rules ensures we drop cross-descriptor constraints before dropping +// descriptors, both the referencing and referenced. Namely, +// 1. cross-descriptor constraints are absent before referenced descriptor, if +// the referencing table is not being dropped. +// 2. cross-descriptor constraints are absent before referencing descriptor, if +// the referenced table is not dropped. +// +// A canonical example is FKs: +// To illustrate why rule 1 is necessary, consider we have tables `t1` and `t2`, +// and `t1` has a FK to `t2` (call this schema `S1`). The statement is +// `DROP TABLE t2 CASCADE`. We will have to first transition the FK (dropped as +// a result of CASCADE) to an intermediate state and then (in a separate +// transaction) transition the table to the dropped state. Otherwise, if the FK +// transition to absent in the same transaction as the table becomes dropped +// (call this schema `S2`), it becomes unsafe for `S1` and `S2` to exist in the +// cluster at the same time, because allowed inserts under `S2` will violate `S1`. +// +// To illustrate why rule 2 is necessary, consider we have tables `t1`, `t2`, `t3`, +// and `t1` FKs to `t2` (call it `FK1`) and `t3` FKs to `t2` (call it `FK2`). +// The statement is `DROP TABLE t1, t2 CASCADE`. Without rule 2, rule 1 alone will +// ensure that `FK2` moves to an intermediate state first, and at the same stage, +// `t1` will be dropped together with `FK1`. Validation will then fail because +// `t2` will have an enforced FK constraint whose origin table (`t1`) is dropped. +// It's worth noting that relaxing validation in this case is safe but we choose +// not to do so because it requires other related changes and makes reasoning +// harder. +func init() { + registerDepRule( + "cross-descriptor constraint is absent before referenced descriptor is dropped", + scgraph.Precedence, + "cross-desc-constraint", "referenced-descriptor", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.TypeFilter(rulesVersionKey, isNonIndexBackedCrossDescriptorConstraint, isSubjectTo2VersionInvariant), + to.TypeFilter(rulesVersionKey, isDescriptor), + JoinReferencedDescID(from, to, "desc-id"), + StatusesToAbsent(from, scpb.Status_ABSENT, to, scpb.Status_DROPPED), + } + }, + ) + + registerDepRule( + "cross-descriptor constraint is absent before referencing descriptor is dropped", + scgraph.Precedence, + "cross-desc-constraint", "referencing-descriptor", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.TypeFilter(rulesVersionKey, isNonIndexBackedCrossDescriptorConstraint, isSubjectTo2VersionInvariant), + to.TypeFilter(rulesVersionKey, isDescriptor), + JoinOnDescID(from, to, "desc-id"), + StatusesToAbsent(from, scpb.Status_ABSENT, to, scpb.Status_DROPPED), + } + }, + ) +} diff --git a/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_drop_policy.go b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_drop_policy.go new file mode 100644 index 000000000000..1fd584f60c50 --- /dev/null +++ b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_drop_policy.go @@ -0,0 +1,29 @@ +// Copyright 2025 The Cockroach Authors. +// +// Use of this software is governed by the CockroachDB Software License +// included in the /LICENSE file. + +package release_25_1 + +import ( + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/rel" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" + . "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/rules" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/scgraph" +) + +func init() { + registerDepRuleForDrop( + "dependents removed before policy", + scgraph.SameStagePrecedence, + "dependent", "policy", + scpb.Status_ABSENT, scpb.Status_ABSENT, + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.TypeFilter(rulesVersionKey, isPolicyDependent), + to.Type((*scpb.Policy)(nil)), + JoinOnPolicyID(from, to, "table-id", "policy-id"), + } + }, + ) +} diff --git a/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_drop_trigger.go b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_drop_trigger.go new file mode 100644 index 000000000000..495bbfbe4c0c --- /dev/null +++ b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_drop_trigger.go @@ -0,0 +1,31 @@ +// Copyright 2024 The Cockroach Authors. +// +// Use of this software is governed by the CockroachDB Software License +// included in the /LICENSE file. + +package release_25_1 + +import ( + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/rel" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" + . "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/rules" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/scgraph" +) + +func init() { + // The Trigger element must be removed before TriggerDeps in particular, in + // order to ensure that back-references are updated correctly. + registerDepRuleForDrop( + "trigger removed before dependents", + scgraph.Precedence, + "trigger", "dependents", + scpb.Status_ABSENT, scpb.Status_PUBLIC, + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + to.Type((*scpb.Trigger)(nil)), + from.TypeFilter(rulesVersionKey, isTriggerDependent), + JoinOnTriggerID(from, to, "table-id", "trigger-id"), + } + }, + ) +} diff --git a/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_garbage_collection.go b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_garbage_collection.go new file mode 100644 index 000000000000..91355d4d59f6 --- /dev/null +++ b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_garbage_collection.go @@ -0,0 +1,153 @@ +// Copyright 2022 The Cockroach Authors. +// +// Use of this software is governed by the CockroachDB Software License +// included in the /LICENSE file. + +package release_25_1 + +import ( + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/rel" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" + . "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/rules" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/scgraph" + "github.com/cockroachdb/cockroach/pkg/sql/sem/catid" +) + +// Rules related to garbage collection. +// Garbage collection must occur: +// - in the same stage as the descriptor disappears; +// - for indexes, not before the index disappears; +// - all in the same stage for each descriptor. +func init() { + + registerDepRule( + "table removed right before garbage collection", + scgraph.SameStagePrecedence, + "table", "data", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.TypeFilter(rulesVersionKey, isDescriptor), + to.Type((*scpb.TableData)(nil)), + JoinOnDescID(from, to, "table-id"), + StatusesToAbsent(from, scpb.Status_ABSENT, to, scpb.Status_DROPPED), + } + }, + ) + + registerDepRule( + "descriptor removed right before garbage collection", + scgraph.SameStagePrecedence, + "database", "data", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.TypeFilter(rulesVersionKey, isDescriptor), + to.Type((*scpb.DatabaseData)(nil)), + JoinOnDescID(from, to, "db-id"), + StatusesToAbsent(from, scpb.Status_ABSENT, to, scpb.Status_DROPPED), + } + }, + ) + + registerDepRuleForDrop( + "index removed before garbage collection", + scgraph.Precedence, + "index", "index-data", + scpb.Status_ABSENT, scpb.Status_DROPPED, + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.TypeFilter(rulesVersionKey, isIndex), + to.Type((*scpb.IndexData)(nil)), + JoinOnIndexID(from, to, "table-id", "index-id"), + } + }, + ) + + dataIDs := func(data scpb.Element) (catid.DescID, catid.IndexID) { + switch data := data.(type) { + case *scpb.DatabaseData: + return data.DatabaseID, 0 + case *scpb.TableData: + return data.TableID, 0 + case *scpb.IndexData: + return data.TableID, data.IndexID + } + return 0, 0 + } + + // GC jobs should all be scheduled in the same transaction. + registerDepRuleForDrop( + "schedule all GC jobs for a descriptor in the same stage", + scgraph.SameStagePrecedence, + "data-a", "data-b", + scpb.Status_DROPPED, scpb.Status_DROPPED, + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.TypeFilter(rulesVersionKey, isData), + to.TypeFilter(rulesVersionKey, isData), + JoinOnDescID(from, to, "desc-id"), + FilterElements("SmallerIDsFirst", from, to, func(a, b scpb.Element) bool { + aDescID, aIdxID := dataIDs(a) + bDescID, bIdxID := dataIDs(b) + if aDescID == bDescID { + return aIdxID < bIdxID + } + return aDescID < bDescID + }), + } + }, + ) +} + +// Rules to ensure proper garbage collection on rollbacks. +// A GC job is required as soon as a new index receives data. +func init() { + + registerDepRule( + "index data exists as soon as index accepts backfills", + scgraph.SameStagePrecedence, + "index-name", "index", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type( + (*scpb.PrimaryIndex)(nil), + (*scpb.SecondaryIndex)(nil), + ), + to.Type((*scpb.IndexData)(nil)), + JoinOnIndexID(from, to, "table-id", "index-id"), + StatusesToPublicOrTransient(from, scpb.Status_BACKFILL_ONLY, to, scpb.Status_PUBLIC), + } + }, + ) + + registerDepRule( + "temp index data exists as soon as temp index accepts writes", + scgraph.SameStagePrecedence, + "temp-index", "temp-index-data", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.TemporaryIndex)(nil)), + to.Type((*scpb.IndexData)(nil)), + JoinOnIndexID(from, to, "table-id", "index-id"), + StatusesToPublicOrTransient(from, scpb.Status_WRITE_ONLY, to, scpb.Status_PUBLIC), + } + }, + ) +} + +// Rules to ensure for created objects the table data will be live after the +// descriptor is public. +func init() { + registerDepRule( + "table added right before data element", + scgraph.Precedence, + "table", "data", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.TypeFilter(rulesVersionKey, isDescriptor), + to.TypeFilter(rulesVersionKey, isData), + JoinOnDescID(from, to, "table-id"), + StatusesToPublicOrTransient(from, scpb.Status_PUBLIC, to, scpb.Status_PUBLIC), + } + }, + ) +} diff --git a/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_swap_index.go b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_swap_index.go new file mode 100644 index 000000000000..24e61826d303 --- /dev/null +++ b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_swap_index.go @@ -0,0 +1,146 @@ +// Copyright 2022 The Cockroach Authors. +// +// Use of this software is governed by the CockroachDB Software License +// included in the /LICENSE file. + +package release_25_1 + +import ( + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/rel" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" + . "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/rules" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/scgraph" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/screl" +) + +// This rule ensures that a new primary index becomes public right after the +// old primary index starts getting removed, effectively swapping one for the +// other. This rule also applies when the schema change gets reverted. +func init() { + registerDepRule( + "primary index swap", + scgraph.SameStagePrecedence, + "old-index", "new-index", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.PrimaryIndex)(nil)), + to.Type((*scpb.PrimaryIndex)(nil)), + JoinOnDescID(from, to, "table-id"), + JoinOn( + from, screl.IndexID, + to, screl.SourceIndexID, + "old-index-id", + ), + from.TargetStatus(scpb.ToAbsent), + from.CurrentStatus(scpb.Status_VALIDATED), + to.TargetStatus(scpb.ToPublic, scpb.Transient), + to.CurrentStatus(scpb.Status_PUBLIC), + } + }, + ) + + registerDepRule( + "primary index swap", + scgraph.SameStagePrecedence, + "old-index", "new-index", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.PrimaryIndex)(nil)), + to.Type((*scpb.PrimaryIndex)(nil)), + JoinOnDescID(from, to, "table-id"), + JoinOn( + from, screl.IndexID, + to, screl.SourceIndexID, + "old-index-id", + ), + from.TargetStatus(scpb.Transient), + from.CurrentStatus(scpb.Status_TRANSIENT_VALIDATED), + to.TargetStatus(scpb.ToPublic, scpb.Transient), + to.CurrentStatus(scpb.Status_PUBLIC), + } + }, + ) + + registerDepRule( + "primary index swap", + scgraph.SameStagePrecedence, + "new-index", "old-index", + func(from, to NodeVars) rel.Clauses { + return rel.Clauses{ + from.Type((*scpb.PrimaryIndex)(nil)), + to.Type((*scpb.PrimaryIndex)(nil)), + JoinOnDescID(from, to, "table-id"), + JoinOn( + from, screl.SourceIndexID, + to, screl.IndexID, + "old-index-id", + ), + from.TargetStatus(scpb.ToAbsent), + from.CurrentStatus(scpb.Status_VALIDATED), + to.TargetStatus(scpb.ToPublic), + to.CurrentStatus(scpb.Status_PUBLIC), + } + }, + ) +} + +// This rule ensures that when a transient primary index is involved in the +// swap, the old index is gone before the new index is instated. +func init() { + + registerDepRule( + "old index absent before new index public when swapping with transient", + scgraph.Precedence, + "old-primary-index", "new-primary-index", + func(from, to NodeVars) rel.Clauses { + union := MkNodeVars("transient-primary-index") + relationID := rel.Var("table-id") + return rel.Clauses{ + from.Type((*scpb.PrimaryIndex)(nil)), + union.Type((*scpb.PrimaryIndex)(nil)), + to.Type((*scpb.PrimaryIndex)(nil)), + JoinOnDescID(from, union, relationID), + JoinOn( + from, screl.IndexID, + union, screl.SourceIndexID, + "old-index-id", + ), + JoinOnDescID(union, to, relationID), + JoinOn( + union, screl.IndexID, + to, screl.SourceIndexID, + "transient-index-id", + ), + from.TargetStatus(scpb.ToAbsent), + from.CurrentStatus(scpb.Status_ABSENT), + to.TargetStatus(scpb.ToPublic), + to.CurrentStatus(scpb.Status_PUBLIC), + } + }, + ) +} + +// This rule ensures that when secondary indexes are re-created after a primary +// index key is changed, that the secondary indexes are swapped in an atomic +// manner, so that queries are not impacted by missing indexes. +func init() { + // This ia strict version of the rule that will only work, when a node + // is generating a plan on the latest master / 23.1. The StrictRecreate flag + // will be used to tag if the existing secondary index was created on a + // new enough version. + registerDepRule( + "replacement secondary index should be validated before the old one becomes invisible", + scgraph.Precedence, + "new-index", "old-index", + func(from, to NodeVars) rel.Clauses { + // Detect a potential secondary index recreation because of a ALTER + // PRIMARY KEY, and require that the new index should be public, + // before the old index can be hidden (i.e. they are swapped + // an atomic manner). + return append(IsPotentialSecondaryIndexSwap("index-id", "table-id"), + from.CurrentStatus(scpb.Status_PUBLIC), + to.CurrentStatus(scpb.Status_VALIDATED), + ) + }, + ) +} diff --git a/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_two_version.go b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_two_version.go new file mode 100644 index 000000000000..24e85b1b1220 --- /dev/null +++ b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/dep_two_version.go @@ -0,0 +1,122 @@ +// Copyright 2022 The Cockroach Authors. +// +// Use of this software is governed by the CockroachDB Software License +// included in the /LICENSE file. + +package release_25_1 + +import ( + "fmt" + "reflect" + + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/rel" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/opgen" + . "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/rules" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/scgraph" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/screl" +) + +// These rules ensure that changes to properties of descriptors which need to +// be sequenced in order to safely enact online schema changes are sequenced +// in separate transactions. +func init() { + + findNoopSourceStatuses := func( + el scpb.Element, targetStatus scpb.TargetStatus, + ) map[scpb.Status][]scpb.Status { + // We want to skip the dependency edges if the status which got us into + // the current status was a no-op. We track the no-op status parent nodes, + // and we'll add a not-join to make sure there does not exist a node + // with such a status when installing the rule. + // + // This is necessary to deal with cases like the transition from + // BACKFILL_ONLY to its equivalent DELETE_ONLY in the rollback of an + // ADD COLUMN. We don't want or need a dependency edge from DELETE_ONLY + // to ABSENT in that case, but if we didn't check whether we got to + // DELETE_ONLY from BACKFILL_ONLY, then we'd have one implicitly. + statusMap := map[scpb.Status][]scpb.Status{} + if err := opgen.IterateTransitions(el, targetStatus, func( + t opgen.Transition, + ) error { + if !t.OpType().IsValid() { + statusMap[t.To()] = append(statusMap[t.To()], t.From()) + } + return nil + }); err != nil { + panic(err) + } + return statusMap + } + clausesForTwoVersionEdge := func( + from, to NodeVars, + el scpb.Element, + targetStatus scpb.TargetStatus, + t opgen.Transition, + prePrevStatuses []scpb.Status, + ) rel.Clauses { + descriptorData := MkNodeVars("descriptor-data") + var descID rel.Var = "descID" + clauses := rel.Clauses{ + from.Type(el), + to.Type(el), + from.El.AttrEqVar(screl.DescID, descID), + from.El.AttrEqVar(rel.Self, to.El), + from.Target.AttrEqVar(rel.Self, to.Target), + from.Target.AttrEq(screl.TargetStatus, targetStatus.Status()), + from.Node.AttrEq(screl.CurrentStatus, t.From()), + to.Node.AttrEq(screl.CurrentStatus, t.To()), + descriptorIsNotBeingDropped(from.El), + // Make sure to join a data element to confirm that data exists. + descriptorData.Type((*scpb.TableData)(nil)), + descriptorData.JoinTargetNode(), + descriptorData.CurrentStatus(scpb.Status_PUBLIC), + descriptorData.DescIDEq(descID), + descriptorDataIsNotBeingAdded(descID), + } + if len(prePrevStatuses) > 0 { + clauses = append(clauses, + GetNotJoinOnNodeWithStatusIn(prePrevStatuses)(from.Target), + ) + } + return clauses + } + addRules := func(el scpb.Element, targetStatus scpb.TargetStatus) { + statusMap := findNoopSourceStatuses(el, targetStatus) + if err := opgen.IterateTransitions(el, targetStatus, func( + t opgen.Transition, + ) error { + elemName := reflect.TypeOf(el).Elem().Name() + ruleName := scgraph.RuleName(fmt.Sprintf( + "%s transitions to %s uphold 2-version invariant: %s->%s", + elemName, targetStatus.Status(), t.From(), t.To(), + )) + registerDepRule( + ruleName, + scgraph.PreviousTransactionPrecedence, + "prev", "next", + func(from, to NodeVars) rel.Clauses { + return clausesForTwoVersionEdge( + from, to, el, targetStatus, t, statusMap[t.From()], + ) + }, + ) + return nil + }); err != nil { + panic(err) + } + } + _ = scpb.ForEachElementType(func(el scpb.Element) error { + if !isSubjectTo2VersionInvariant(el) { + return nil + } + if opgen.HasPublic(el) { + addRules(el, scpb.ToPublic) + } + if opgen.HasTransient(el) { + addRules(el, scpb.Transient) + } + addRules(el, scpb.ToAbsent) // every element has ToAbsent + return nil + }) +} diff --git a/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/helpers.go b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/helpers.go new file mode 100644 index 000000000000..ef00dc91a97f --- /dev/null +++ b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/helpers.go @@ -0,0 +1,353 @@ +// Copyright 2023 The Cockroach Authors. +// +// Use of this software is governed by the CockroachDB Software License +// included in the /LICENSE file. + +package release_25_1 + +import ( + "github.com/cockroachdb/cockroach/pkg/clusterversion" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/rel" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/rules" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/screl" + "github.com/cockroachdb/errors" +) + +const ( + // rulesVersion version of elements that can be appended to rel rule names. + rulesVersion = "-25.1" +) + +// rulesVersionKey version of elements used by this rule set. +var rulesVersionKey = clusterversion.V25_1 + +// descriptorIsNotBeingDropped creates a clause which leads to the outer clause +// failing to unify if the passed element is part of a descriptor and +// that descriptor is being dropped. +var descriptorIsNotBeingDropped = screl.Schema.DefNotJoin1( + "descriptorIsNotBeingDropped"+rulesVersion, "element", func( + element rel.Var, + ) rel.Clauses { + descriptor := rules.MkNodeVars("descriptor") + return rel.Clauses{ + descriptor.TypeFilter(rulesVersionKey, isDescriptor), + descriptor.JoinTarget(), + rules.JoinOnDescIDUntyped(descriptor.El, element, "id"), + descriptor.TargetStatus(scpb.ToAbsent), + } + }, +) + +// descriptorDataIsNotBeingAdded indicates if we are operating on a descriptor +// that already exists and was not created in the current transaction. This is +// determined by detecting if the data element is public, and not going from +// absent to public which newly created descriptors will. +var descriptorDataIsNotBeingAdded = screl.Schema.DefNotJoin1( + "descriptorIsDataNotBeingAdded"+rulesVersion, "descID", func( + descID rel.Var, + ) rel.Clauses { + descriptorData := rules.MkNodeVars("descriptor-data") + prevDescriptorData := rules.MkNodeVars("prev-descriptor-data") + return rel.Clauses{ + descriptorData.Type((*scpb.TableData)(nil)), + descriptorData.JoinTargetNode(), + descriptorData.CurrentStatus(scpb.Status_PUBLIC), + descriptorData.DescIDEq(descID), + prevDescriptorData.Type((*scpb.TableData)(nil)), + prevDescriptorData.JoinTargetNode(), + prevDescriptorData.CurrentStatus(scpb.Status_ABSENT), + prevDescriptorData.DescIDEq(descID), + prevDescriptorData.El.AttrEqVar(rel.Self, descriptorData.El), + } + }, +) + +// isDescriptor returns true for a descriptor-element, i.e. an element which +// owns its corresponding descriptor. +func isDescriptor(e scpb.Element) bool { + switch e.(type) { + case *scpb.Database, *scpb.Schema, *scpb.Table, *scpb.View, *scpb.Sequence, + *scpb.AliasType, *scpb.EnumType, *scpb.CompositeType, *scpb.Function: + return true + } + return false +} + +// IsDescriptor returns true for a descriptor-element, i.e. an element which +// owns its corresponding descriptor. This is only used for exports +func IsDescriptor(e scpb.Element) bool { + return isDescriptor(e) +} + +func isSubjectTo2VersionInvariant(e scpb.Element) bool { + // TODO(ajwerner): This should include constraints and enum values but it + // currently does not because we do not support dropping them unless we're + // dropping the descriptor and we do not support adding them. + if isIndex(e) || isColumn(e) { + return true + } + switch e.(type) { + case *scpb.CheckConstraint, *scpb.UniqueWithoutIndexConstraint, *scpb.ForeignKeyConstraint, + *scpb.ColumnNotNull: + return true + } + return false +} + +func isIndex(e scpb.Element) bool { + switch e.(type) { + case *scpb.PrimaryIndex, *scpb.SecondaryIndex, *scpb.TemporaryIndex: + return true + } + return false +} + +func isIndexColumn(e scpb.Element) bool { + switch e.(type) { + case *scpb.IndexColumn: + return true + } + return false +} + +func isColumn(e scpb.Element) bool { + _, ok := e.(*scpb.Column) + return ok +} + +func isSimpleDependent(e scpb.Element) bool { + return !isDescriptor(e) && !isSubjectTo2VersionInvariant(e) && !isData(e) +} + +func getTypeT(element scpb.Element) (*scpb.TypeT, error) { + switch e := element.(type) { + case *scpb.ColumnType: + if e == nil { + return nil, nil + } + return &e.TypeT, nil + case *scpb.AliasType: + if e == nil { + return nil, nil + } + return &e.TypeT, nil + } + return nil, errors.AssertionFailedf("element %T does not have an embedded scpb.TypeT", element) +} + +func isWithTypeT(element scpb.Element) bool { + _, err := getTypeT(element) + return err == nil +} + +func getExpression(element scpb.Element) (*scpb.Expression, error) { + switch e := element.(type) { + case *scpb.ColumnType: + if e == nil { + return nil, nil + } + return e.ComputeExpr, nil + case *scpb.ColumnComputeExpression: + if e == nil { + return nil, nil + } + return &e.Expression, nil + case *scpb.ColumnDefaultExpression: + if e == nil { + return nil, nil + } + return &e.Expression, nil + case *scpb.ColumnOnUpdateExpression: + if e == nil { + return nil, nil + } + return &e.Expression, nil + case *scpb.SecondaryIndex: + if e == nil || e.EmbeddedExpr == nil { + return nil, nil + } + return e.EmbeddedExpr, nil + case *scpb.SecondaryIndexPartial: + if e == nil { + return nil, nil + } + return &e.Expression, nil + case *scpb.CheckConstraint: + if e == nil { + return nil, nil + } + return &e.Expression, nil + case *scpb.CheckConstraintUnvalidated: + if e == nil { + return nil, nil + } + return &e.Expression, nil + } + return nil, errors.AssertionFailedf("element %T does not have an embedded scpb.Expression", element) +} + +func isWithExpression(element scpb.Element) bool { + _, err := getExpression(element) + return err == nil +} + +func isTypeDescriptor(element scpb.Element) bool { + switch element.(type) { + case *scpb.EnumType, *scpb.AliasType, *scpb.CompositeType: + return true + default: + return false + } +} + +func isColumnDependent(e scpb.Element) bool { + switch e.(type) { + case *scpb.ColumnType, *scpb.ColumnNotNull: + return true + case *scpb.ColumnName, *scpb.ColumnComment, *scpb.IndexColumn: + return true + } + return isColumnTypeDependent(e) +} + +func isColumnDependentExceptColumnName(e scpb.Element) bool { + switch e.(type) { + case *scpb.ColumnName: + return false + } + return isColumnDependent(e) +} + +func isColumnNotNull(e scpb.Element) bool { + switch e.(type) { + case *scpb.ColumnNotNull: + return true + } + return false +} +func isColumnTypeDependent(e scpb.Element) bool { + switch e.(type) { + case *scpb.SequenceOwner, *scpb.ColumnDefaultExpression, *scpb.ColumnOnUpdateExpression, *scpb.ColumnComputeExpression: + return true + } + return false +} + +func isIndexDependent(e scpb.Element) bool { + switch e.(type) { + case *scpb.IndexName, *scpb.IndexComment, *scpb.IndexColumn, + *scpb.IndexZoneConfig: + return true + case *scpb.IndexPartitioning, *scpb.PartitionZoneConfig, *scpb.SecondaryIndexPartial: + return true + } + return false +} + +// CRDB supports five constraints of two categories: +// - PK, Unique (index-backed) +// - Check, UniqueWithoutIndex, FK (non-index-backed) +func isConstraint(e scpb.Element) bool { + return isIndex(e) || isNonIndexBackedConstraint(e) +} + +// isNonIndexBackedConstraint returns true if `e` is a non-index-backed constraint. +func isNonIndexBackedConstraint(e scpb.Element) bool { + switch e.(type) { + case *scpb.CheckConstraint, *scpb.UniqueWithoutIndexConstraint, *scpb.ForeignKeyConstraint, + *scpb.ColumnNotNull: + return true + case *scpb.CheckConstraintUnvalidated, *scpb.UniqueWithoutIndexConstraintUnvalidated, + *scpb.ForeignKeyConstraintUnvalidated: + return true + } + return false +} + +// isNonIndexBackedCrossDescriptorConstraint returns true if `e` is a +// non-index-backed constraint and it can potentially reference another +// descriptor. +// +// This filter exists because in general we need to drop the constraint first +// before dropping referencing/referenced descriptor. Read rules that use +// this filter for more details. +// +// TODO (xiang): UniqueWithoutIndex and UniqueWithoutIndexNotValid should +// also be treated as cross-descriptor constraint because its partial predicate +// can references other descriptors. +func isNonIndexBackedCrossDescriptorConstraint(e scpb.Element) bool { + switch e.(type) { + case *scpb.CheckConstraint, *scpb.UniqueWithoutIndexConstraint, + *scpb.ForeignKeyConstraint: + return true + case *scpb.CheckConstraintUnvalidated, *scpb.UniqueWithoutIndexConstraintUnvalidated, + *scpb.ForeignKeyConstraintUnvalidated: + return true + } + return false +} + +func isConstraintDependent(e scpb.Element) bool { + switch e.(type) { + case *scpb.ConstraintWithoutIndexName: + return true + case *scpb.ConstraintComment: + return true + } + return false +} + +func isConstraintWithoutIndexName(e scpb.Element) bool { + switch e.(type) { + case *scpb.ConstraintWithoutIndexName: + return true + } + return false +} + +func isTriggerDependent(e scpb.Element) bool { + switch e.(type) { + case *scpb.TriggerName, *scpb.TriggerEnabled, *scpb.TriggerTiming, + *scpb.TriggerEvents, *scpb.TriggerTransition, *scpb.TriggerWhen, + *scpb.TriggerFunctionCall, *scpb.TriggerDeps: + return true + } + return false +} + +func isPolicyDependent(e scpb.Element) bool { + switch e.(type) { + case *scpb.PolicyName: + return true + } + return false +} + +func isData(e scpb.Element) bool { + switch e.(type) { + case *scpb.DatabaseData: + return true + case *scpb.TableData: + return true + case *scpb.IndexData: + return true + } + return false +} + +func isDescriptorParentReference(e scpb.Element) bool { + switch e.(type) { + case *scpb.SchemaChild, *scpb.SchemaParent: + return true + } + return false +} + +func isOwner(e scpb.Element) bool { + switch e.(type) { + case *scpb.Owner: + return true + } + return false +} diff --git a/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/registry.go b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/registry.go new file mode 100644 index 000000000000..64eca236d76b --- /dev/null +++ b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/registry.go @@ -0,0 +1,47 @@ +// Copyright 2023 The Cockroach Authors. +// +// Use of this software is governed by the CockroachDB Software License +// included in the /LICENSE file. + +package release_25_1 + +import ( + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/rel" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" + . "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/rules" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/scgraph" +) + +var registry = NewRegistry() + +func registerDepRule( + ruleName scgraph.RuleName, + kind scgraph.DepEdgeKind, + fromEl, toEl string, + def func(from, to NodeVars) rel.Clauses, +) { + registry.RegisterDepRule(ruleName, + kind, + fromEl, toEl, + def) +} + +func registerDepRuleForDrop( + ruleName scgraph.RuleName, + kind scgraph.DepEdgeKind, + from, to string, + fromStatus, toStatus scpb.Status, + fn func(from, to NodeVars) rel.Clauses, +) { + RegisterDepRuleForDrop(registry, + ruleName, + kind, + from, to, + fromStatus, toStatus, + fn) +} + +// GetRegistry returns the registry for this cockroach release. +func GetRegistry() *Registry { + return registry +} diff --git a/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/rules_test.go b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/rules_test.go new file mode 100644 index 000000000000..9ae8454c2e25 --- /dev/null +++ b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/rules_test.go @@ -0,0 +1,57 @@ +// Copyright 2021 The Cockroach Authors. +// +// Use of this software is governed by the CockroachDB Software License +// included in the /LICENSE file. + +package release_25_1 + +import ( + "sort" + "testing" + + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/rel" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/screl" + "github.com/cockroachdb/cockroach/pkg/testutils/datapathutils" + "github.com/cockroachdb/datadriven" + "github.com/stretchr/testify/require" + "gopkg.in/yaml.v3" +) + +// TestRulesYAML outputs the rules to yaml as a way to visualize changes. +// Rules are sorted by name to ensure stable output. +func TestRulesYAML(t *testing.T) { + datadriven.Walk(t, datapathutils.TestDataPath(t), func(t *testing.T, path string) { + datadriven.RunTest(t, path, func(t *testing.T, d *datadriven.TestData) string { + switch d.Cmd { + case "rules": + var m yaml.Node + m.Kind = yaml.MappingNode + var s []rel.RuleDef + screl.Schema.ForEachRule(func(def rel.RuleDef) { + s = append(s, def) + }) + sort.SliceStable(s, func(i, j int) bool { + return s[i].Name < s[j].Name + }) + for _, def := range s { + var rule yaml.Node + if err := rule.Encode(def); err != nil { + panic(err) + } + m.Content = append(m.Content, rule.Content...) + } + out, err := yaml.Marshal(m) + if err != nil { + d.Fatalf(t, "failed to marshal rules: %v", err) + } + return string(out) + case "deprules": + out, err := registry.MarshalDepRules() + require.NoError(t, err) + return out + } + d.Fatalf(t, "deprules, oprules, and rules are the only commands, got %s", d.Cmd) + return "" + }) + }) +} diff --git a/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/testdata/deprules b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/testdata/deprules new file mode 100644 index 000000000000..375aedef607d --- /dev/null +++ b/pkg/sql/schemachanger/scplan/internal/rules/release_25_1/testdata/deprules @@ -0,0 +1,9311 @@ +deprules +---- +- name: 'CheckConstraint transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.CheckConstraint' + - $next[Type] = '*scpb.CheckConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = PUBLIC + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'CheckConstraint transitions to ABSENT uphold 2-version invariant: TRANSIENT_ABSENT->ABSENT' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.CheckConstraint' + - $next[Type] = '*scpb.CheckConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_ABSENT + - $next-Node[CurrentStatus] = ABSENT + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'CheckConstraint transitions to ABSENT uphold 2-version invariant: TRANSIENT_VALIDATED->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.CheckConstraint' + - $next[Type] = '*scpb.CheckConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_VALIDATED + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'CheckConstraint transitions to ABSENT uphold 2-version invariant: TRANSIENT_WRITE_ONLY->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.CheckConstraint' + - $next[Type] = '*scpb.CheckConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'CheckConstraint transitions to ABSENT uphold 2-version invariant: VALIDATED->ABSENT' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.CheckConstraint' + - $next[Type] = '*scpb.CheckConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = VALIDATED + - $next-Node[CurrentStatus] = ABSENT + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - nodeNotExistsWithStatusIn_TRANSIENT_VALIDATED_WRITE_ONLY_TRANSIENT_WRITE_ONLY($prev-Target) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'CheckConstraint transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.CheckConstraint' + - $next[Type] = '*scpb.CheckConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = WRITE_ONLY + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'CheckConstraint transitions to PUBLIC uphold 2-version invariant: ABSENT->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.CheckConstraint' + - $next[Type] = '*scpb.CheckConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = ABSENT + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'CheckConstraint transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.CheckConstraint' + - $next[Type] = '*scpb.CheckConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = VALIDATED + - $next-Node[CurrentStatus] = PUBLIC + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'CheckConstraint transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.CheckConstraint' + - $next[Type] = '*scpb.CheckConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = WRITE_ONLY + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'CheckConstraint transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.CheckConstraint' + - $next[Type] = '*scpb.CheckConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = ABSENT + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'CheckConstraint transitions to TRANSIENT_ABSENT uphold 2-version invariant: PUBLIC->TRANSIENT_VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.CheckConstraint' + - $next[Type] = '*scpb.CheckConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = PUBLIC + - $next-Node[CurrentStatus] = TRANSIENT_VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'CheckConstraint transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_VALIDATED->TRANSIENT_ABSENT' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.CheckConstraint' + - $next[Type] = '*scpb.CheckConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_VALIDATED + - $next-Node[CurrentStatus] = TRANSIENT_ABSENT + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - nodeNotExistsWithStatusIn_TRANSIENT_WRITE_ONLY($prev-Target) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'CheckConstraint transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_WRITE_ONLY->TRANSIENT_VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.CheckConstraint' + - $next[Type] = '*scpb.CheckConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - $next-Node[CurrentStatus] = TRANSIENT_VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'CheckConstraint transitions to TRANSIENT_ABSENT uphold 2-version invariant: VALIDATED->PUBLIC' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.CheckConstraint' + - $next[Type] = '*scpb.CheckConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = VALIDATED + - $next-Node[CurrentStatus] = PUBLIC + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'CheckConstraint transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.CheckConstraint' + - $next[Type] = '*scpb.CheckConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = WRITE_ONLY + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.Column' + - $next[Type] = '*scpb.Column' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = DELETE_ONLY + - $next-Node[CurrentStatus] = ABSENT + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'Column transitions to ABSENT uphold 2-version invariant: PUBLIC->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.Column' + - $next[Type] = '*scpb.Column' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = PUBLIC + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.Column' + - $next[Type] = '*scpb.Column' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = WRITE_ONLY + - $next-Node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'Column transitions to PUBLIC uphold 2-version invariant: ABSENT->DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.Column' + - $next[Type] = '*scpb.Column' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = ABSENT + - $next-Node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'Column transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.Column' + - $next[Type] = '*scpb.Column' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = DELETE_ONLY + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.Column' + - $next[Type] = '*scpb.Column' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = WRITE_ONLY + - $next-Node[CurrentStatus] = PUBLIC + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'ColumnNotNull transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.ColumnNotNull' + - $next[Type] = '*scpb.ColumnNotNull' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = PUBLIC + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'ColumnNotNull transitions to ABSENT uphold 2-version invariant: VALIDATED->ABSENT' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.ColumnNotNull' + - $next[Type] = '*scpb.ColumnNotNull' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = VALIDATED + - $next-Node[CurrentStatus] = ABSENT + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - nodeNotExistsWithStatusIn_WRITE_ONLY($prev-Target) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'ColumnNotNull transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.ColumnNotNull' + - $next[Type] = '*scpb.ColumnNotNull' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = WRITE_ONLY + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'ColumnNotNull transitions to PUBLIC uphold 2-version invariant: ABSENT->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.ColumnNotNull' + - $next[Type] = '*scpb.ColumnNotNull' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = ABSENT + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'ColumnNotNull transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.ColumnNotNull' + - $next[Type] = '*scpb.ColumnNotNull' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = VALIDATED + - $next-Node[CurrentStatus] = PUBLIC + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'ColumnNotNull transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.ColumnNotNull' + - $next[Type] = '*scpb.ColumnNotNull' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = WRITE_ONLY + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: Computed column expression is dropped before the column it depends on + from: column-expr-Node + kind: Precedence + to: column-Node + query: + - $column-expr[Type] = '*scpb.ColumnComputeExpression' + - $column[Type] = '*scpb.Column' + - joinOnDescID($column-expr, $column, $table-id) + - computedColumnTypeReferencesColumn(*scpb.ColumnComputeExpression, *scpb.Column)($column-expr, $column) + - toAbsent($column-expr-Target, $column-Target) + - $column-expr-Node[CurrentStatus] = ABSENT + - $column-Node[CurrentStatus] = WRITE_ONLY + - joinTargetNode($column-expr, $column-expr-Target, $column-expr-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: Computed column expression is dropped before the column it depends on + from: column-expr-Node + kind: Precedence + to: column-Node + query: + - $column-expr[Type] = '*scpb.ColumnComputeExpression' + - $column[Type] = '*scpb.Column' + - joinOnDescID($column-expr, $column, $table-id) + - computedColumnTypeReferencesColumn(*scpb.ColumnComputeExpression, *scpb.Column)($column-expr, $column) + - transient($column-expr-Target, $column-Target) + - $column-expr-Node[CurrentStatus] = TRANSIENT_ABSENT + - $column-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - joinTargetNode($column-expr, $column-expr-Target, $column-expr-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: Computed column expression is dropped before the column it depends on + from: column-expr-Node + kind: Precedence + to: column-Node + query: + - $column-expr[Type] = '*scpb.ColumnComputeExpression' + - $column[Type] = '*scpb.Column' + - joinOnDescID($column-expr, $column, $table-id) + - computedColumnTypeReferencesColumn(*scpb.ColumnComputeExpression, *scpb.Column)($column-expr, $column) + - $column-expr-Target[TargetStatus] = TRANSIENT_ABSENT + - $column-expr-Node[CurrentStatus] = TRANSIENT_ABSENT + - $column-Target[TargetStatus] = ABSENT + - $column-Node[CurrentStatus] = WRITE_ONLY + - joinTargetNode($column-expr, $column-expr-Target, $column-expr-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: Computed column expression is dropped before the column it depends on + from: column-expr-Node + kind: Precedence + to: column-Node + query: + - $column-expr[Type] = '*scpb.ColumnComputeExpression' + - $column[Type] = '*scpb.Column' + - joinOnDescID($column-expr, $column, $table-id) + - computedColumnTypeReferencesColumn(*scpb.ColumnComputeExpression, *scpb.Column)($column-expr, $column) + - $column-expr-Target[TargetStatus] = ABSENT + - $column-expr-Node[CurrentStatus] = ABSENT + - $column-Target[TargetStatus] = TRANSIENT_ABSENT + - $column-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - joinTargetNode($column-expr, $column-expr-Target, $column-expr-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: Constraint should be hidden before name + from: constraint-name-Node + kind: Precedence + to: constraint-Node + query: + - $constraint-name[Type] = '*scpb.ConstraintWithoutIndexName' + - $constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.CheckConstraintUnvalidated', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.UniqueWithoutIndexConstraint', '*scpb.UniqueWithoutIndexConstraintUnvalidated'] + - joinOnConstraintID($constraint-name, $constraint, $table-id, $constraint-id) + - toAbsent($constraint-name-Target, $constraint-Target) + - $constraint-name-Node[CurrentStatus] = ABSENT + - $constraint-Node[CurrentStatus] = ABSENT + - joinTargetNode($constraint-name, $constraint-name-Target, $constraint-name-Node) + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) +- name: Constraint should be hidden before name + from: constraint-name-Node + kind: Precedence + to: constraint-Node + query: + - $constraint-name[Type] = '*scpb.ConstraintWithoutIndexName' + - $constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.CheckConstraintUnvalidated', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.UniqueWithoutIndexConstraint', '*scpb.UniqueWithoutIndexConstraintUnvalidated'] + - joinOnConstraintID($constraint-name, $constraint, $table-id, $constraint-id) + - transient($constraint-name-Target, $constraint-Target) + - $constraint-name-Node[CurrentStatus] = TRANSIENT_ABSENT + - $constraint-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($constraint-name, $constraint-name-Target, $constraint-name-Node) + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) +- name: Constraint should be hidden before name + from: constraint-name-Node + kind: Precedence + to: constraint-Node + query: + - $constraint-name[Type] = '*scpb.ConstraintWithoutIndexName' + - $constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.CheckConstraintUnvalidated', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.UniqueWithoutIndexConstraint', '*scpb.UniqueWithoutIndexConstraintUnvalidated'] + - joinOnConstraintID($constraint-name, $constraint, $table-id, $constraint-id) + - $constraint-name-Target[TargetStatus] = TRANSIENT_ABSENT + - $constraint-name-Node[CurrentStatus] = TRANSIENT_ABSENT + - $constraint-Target[TargetStatus] = ABSENT + - $constraint-Node[CurrentStatus] = ABSENT + - joinTargetNode($constraint-name, $constraint-name-Target, $constraint-name-Node) + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) +- name: Constraint should be hidden before name + from: constraint-name-Node + kind: Precedence + to: constraint-Node + query: + - $constraint-name[Type] = '*scpb.ConstraintWithoutIndexName' + - $constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.CheckConstraintUnvalidated', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.UniqueWithoutIndexConstraint', '*scpb.UniqueWithoutIndexConstraintUnvalidated'] + - joinOnConstraintID($constraint-name, $constraint, $table-id, $constraint-id) + - $constraint-name-Target[TargetStatus] = ABSENT + - $constraint-name-Node[CurrentStatus] = ABSENT + - $constraint-Target[TargetStatus] = TRANSIENT_ABSENT + - $constraint-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($constraint-name, $constraint-name-Target, $constraint-name-Node) + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) +- name: Constraint should be hidden before name + from: constraint-Node + kind: Precedence + to: constraint-name-Node + query: + - $constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.CheckConstraintUnvalidated', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.UniqueWithoutIndexConstraint', '*scpb.UniqueWithoutIndexConstraintUnvalidated'] + - $constraint-name[Type] = '*scpb.ConstraintWithoutIndexName' + - joinOnConstraintID($constraint, $constraint-name, $table-id, $constraint-id) + - toAbsent($constraint-Target, $constraint-name-Target) + - $constraint-Node[CurrentStatus] = VALIDATED + - $constraint-name-Node[CurrentStatus] = ABSENT + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) + - joinTargetNode($constraint-name, $constraint-name-Target, $constraint-name-Node) +- name: Constraint should be hidden before name + from: constraint-Node + kind: Precedence + to: constraint-name-Node + query: + - $constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.CheckConstraintUnvalidated', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.UniqueWithoutIndexConstraint', '*scpb.UniqueWithoutIndexConstraintUnvalidated'] + - $constraint-name[Type] = '*scpb.ConstraintWithoutIndexName' + - joinOnConstraintID($constraint, $constraint-name, $table-id, $constraint-id) + - transient($constraint-Target, $constraint-name-Target) + - $constraint-Node[CurrentStatus] = TRANSIENT_VALIDATED + - $constraint-name-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) + - joinTargetNode($constraint-name, $constraint-name-Target, $constraint-name-Node) +- name: Constraint should be hidden before name + from: constraint-Node + kind: Precedence + to: constraint-name-Node + query: + - $constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.CheckConstraintUnvalidated', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.UniqueWithoutIndexConstraint', '*scpb.UniqueWithoutIndexConstraintUnvalidated'] + - $constraint-name[Type] = '*scpb.ConstraintWithoutIndexName' + - joinOnConstraintID($constraint, $constraint-name, $table-id, $constraint-id) + - $constraint-Target[TargetStatus] = TRANSIENT_ABSENT + - $constraint-Node[CurrentStatus] = TRANSIENT_VALIDATED + - $constraint-name-Target[TargetStatus] = ABSENT + - $constraint-name-Node[CurrentStatus] = ABSENT + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) + - joinTargetNode($constraint-name, $constraint-name-Target, $constraint-name-Node) +- name: Constraint should be hidden before name + from: constraint-Node + kind: Precedence + to: constraint-name-Node + query: + - $constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.CheckConstraintUnvalidated', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.UniqueWithoutIndexConstraint', '*scpb.UniqueWithoutIndexConstraintUnvalidated'] + - $constraint-name[Type] = '*scpb.ConstraintWithoutIndexName' + - joinOnConstraintID($constraint, $constraint-name, $table-id, $constraint-id) + - $constraint-Target[TargetStatus] = ABSENT + - $constraint-Node[CurrentStatus] = VALIDATED + - $constraint-name-Target[TargetStatus] = TRANSIENT_ABSENT + - $constraint-name-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) + - joinTargetNode($constraint-name, $constraint-name-Target, $constraint-name-Node) +- name: DEFAULT or ON UPDATE existence precedes writes to column, except if they are added as part of a alter column type + from: expr-Node + kind: Precedence + to: column-Node + query: + - $expr[Type] IN ['*scpb.ColumnDefaultExpression', '*scpb.ColumnOnUpdateExpression'] + - $column[Type] = '*scpb.Column' + - joinOnColumnID($expr, $column, $table-id, $col-id) + - no column type alteration in progress($table-id, $col-id) + - ToPublicOrTransient($expr-Target, $column-Target) + - $expr-Node[CurrentStatus] = PUBLIC + - $column-Node[CurrentStatus] = WRITE_ONLY + - joinTargetNode($expr, $expr-Target, $expr-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: DEFAULT or ON UPDATE expressions is public after transient compute expression transitions to absent + from: transient-compute-expression-Node + kind: SameStagePrecedence + to: column-expr-Node + query: + - $transient-compute-expression[Type] = '*scpb.ColumnComputeExpression' + - $column-expr[Type] IN ['*scpb.ColumnDefaultExpression', '*scpb.ColumnOnUpdateExpression'] + - joinOnColumnID($transient-compute-expression, $column-expr, $table-id, $col-id) + - ToPublicOrTransient($transient-compute-expression-Target, $column-expr-Target) + - $transient-compute-expression-Node[CurrentStatus] = TRANSIENT_ABSENT + - $column-expr-Node[CurrentStatus] = PUBLIC + - joinTargetNode($transient-compute-expression, $transient-compute-expression-Target, $transient-compute-expression-Node) + - joinTargetNode($column-expr, $column-expr-Target, $column-expr-Node) +- name: Final compute expression is always added after transient compute expression + from: transient-compute-expression-Node + kind: SameStagePrecedence + to: final-compute-expression-Node + query: + - $transient-compute-expression[Type] = '*scpb.ColumnComputeExpression' + - $final-compute-expression[Type] = '*scpb.ColumnComputeExpression' + - joinOnColumnID($transient-compute-expression, $final-compute-expression, $table-id, $col-id) + - $transient-compute-expression[Usage] = ALTER_TYPE_USING + - $final-compute-expression[Usage] = REGULAR + - ToPublicOrTransient($transient-compute-expression-Target, $final-compute-expression-Target) + - $transient-compute-expression-Node[CurrentStatus] = TRANSIENT_ABSENT + - $final-compute-expression-Node[CurrentStatus] = PUBLIC + - joinTargetNode($transient-compute-expression, $transient-compute-expression-Target, $transient-compute-expression-Node) + - joinTargetNode($final-compute-expression, $final-compute-expression-Target, $final-compute-expression-Node) +- name: 'ForeignKeyConstraint transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.ForeignKeyConstraint' + - $next[Type] = '*scpb.ForeignKeyConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = PUBLIC + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'ForeignKeyConstraint transitions to ABSENT uphold 2-version invariant: VALIDATED->ABSENT' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.ForeignKeyConstraint' + - $next[Type] = '*scpb.ForeignKeyConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = VALIDATED + - $next-Node[CurrentStatus] = ABSENT + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - nodeNotExistsWithStatusIn_WRITE_ONLY($prev-Target) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'ForeignKeyConstraint transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.ForeignKeyConstraint' + - $next[Type] = '*scpb.ForeignKeyConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = WRITE_ONLY + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'ForeignKeyConstraint transitions to PUBLIC uphold 2-version invariant: ABSENT->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.ForeignKeyConstraint' + - $next[Type] = '*scpb.ForeignKeyConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = ABSENT + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'ForeignKeyConstraint transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.ForeignKeyConstraint' + - $next[Type] = '*scpb.ForeignKeyConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = VALIDATED + - $next-Node[CurrentStatus] = PUBLIC + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'ForeignKeyConstraint transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.ForeignKeyConstraint' + - $next[Type] = '*scpb.ForeignKeyConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = WRITE_ONLY + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: New primary index for alter column type should go public in the same stage as dropped column + from: column-Node + kind: SameStagePrecedence + to: new-primary-index-Node + query: + - $column[Type] = '*scpb.Column' + - $new-primary-index[Type] = '*scpb.PrimaryIndex' + - ColumnInSourcePrimaryIndex($index-column, $new-primary-index, $table-id, $old-column-id, $index-id) + - joinOnColumnID($index-column, $column, $table-id, $old-column-id) + - $column-Target[TargetStatus] = ABSENT + - $column-Node[CurrentStatus] = WRITE_ONLY + - $new-primary-index-Target[TargetStatus] = PUBLIC + - $new-primary-index-Node[CurrentStatus] = PUBLIC + - $old-column-name[Type] = '*scpb.ColumnName' + - $new-column-name[Type] = '*scpb.ColumnName' + - joinOnColumnName($old-column-name, $new-column-name, $table-id, $column-name) + - $old-column-name[ColumnID] = $old-column-id + - $old-column-name-Target[TargetStatus] = ABSENT + - $new-column-name-Target[TargetStatus] = PUBLIC + - $compute-expression[Type] = '*scpb.ColumnComputeExpression' + - joinOnColumnID($new-column-name, $compute-expression, $table-id, $new-column-id) + - $compute-expression[Usage] = ALTER_TYPE_USING + - joinTargetNode($old-column-name, $old-column-name-Target, $old-column-name-Node) + - joinTargetNode($new-column-name, $new-column-name-Target, $new-column-name-Node) + - joinTargetNode($compute-expression, $compute-expression-Target, $compute-expression-Node) + - joinTargetNode($column, $column-Target, $column-Node) + - joinTargetNode($new-primary-index, $new-primary-index-Target, $new-primary-index-Node) +- name: New primary index should go public only after columns being dropped move to WRITE_ONLY + from: column-Node + kind: Precedence + to: new-primary-index-Node + query: + - $column[Type] = '*scpb.Column' + - $new-primary-index[Type] = '*scpb.PrimaryIndex' + - ColumnInSourcePrimaryIndex($index-column, $new-primary-index, $table-id, $old-column-id, $index-id) + - joinOnColumnID($index-column, $column, $table-id, $old-column-id) + - $column-Target[TargetStatus] = ABSENT + - $column-Node[CurrentStatus] = WRITE_ONLY + - $new-primary-index-Target[TargetStatus] = PUBLIC + - $new-primary-index-Node[CurrentStatus] = PUBLIC + - dropped column is not part of column type operation($table-id, $old-column-id) + - joinTargetNode($column, $column-Target, $column-Node) + - joinTargetNode($new-primary-index, $new-primary-index-Target, $new-primary-index-Node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILLED->DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = BACKFILLED + - $next-Node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = BACKFILL_ONLY + - $next-Node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = DELETE_ONLY + - $next-Node[CurrentStatus] = ABSENT + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - nodeNotExistsWithStatusIn_TRANSIENT_DELETE_ONLY_BACKFILLED_TRANSIENT_BACKFILLED_BACKFILL_ONLY_TRANSIENT_BACKFILL_ONLY($prev-Target) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: MERGED->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = MERGED + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = MERGE_ONLY + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = PUBLIC + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_ABSENT->ABSENT' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_ABSENT + - $next-Node[CurrentStatus] = ABSENT + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_BACKFILLED->DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_BACKFILLED + - $next-Node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_BACKFILL_ONLY->DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_BACKFILL_ONLY + - $next-Node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - $next-Node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_MERGED->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_MERGED + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_MERGE_ONLY->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_MERGE_ONLY + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_VALIDATED->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_VALIDATED + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_WRITE_ONLY->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = VALIDATED + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - nodeNotExistsWithStatusIn_TRANSIENT_VALIDATED($prev-Target) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = WRITE_ONLY + - $next-Node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - nodeNotExistsWithStatusIn_VALIDATED_TRANSIENT_WRITE_ONLY_MERGE_ONLY_TRANSIENT_MERGE_ONLY_MERGED_TRANSIENT_MERGED($prev-Target) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: ABSENT->BACKFILL_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = ABSENT + - $next-Node[CurrentStatus] = BACKFILL_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILLED->DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = BACKFILLED + - $next-Node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = BACKFILL_ONLY + - $next-Node[CurrentStatus] = BACKFILLED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = DELETE_ONLY + - $next-Node[CurrentStatus] = MERGE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGED->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = MERGED + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGE_ONLY->MERGED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = MERGE_ONLY + - $next-Node[CurrentStatus] = MERGED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = VALIDATED + - $next-Node[CurrentStatus] = PUBLIC + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = WRITE_ONLY + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->BACKFILL_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = ABSENT + - $next-Node[CurrentStatus] = BACKFILL_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: BACKFILLED->DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = BACKFILLED + - $next-Node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = BACKFILL_ONLY + - $next-Node[CurrentStatus] = BACKFILLED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = DELETE_ONLY + - $next-Node[CurrentStatus] = MERGE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: MERGED->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = MERGED + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: MERGE_ONLY->MERGED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = MERGE_ONLY + - $next-Node[CurrentStatus] = MERGED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: PUBLIC->TRANSIENT_VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = PUBLIC + - $next-Node[CurrentStatus] = TRANSIENT_VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_BACKFILLED->TRANSIENT_DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_BACKFILLED + - $next-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_BACKFILL_ONLY->TRANSIENT_DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_BACKFILL_ONLY + - $next-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - $next-Node[CurrentStatus] = TRANSIENT_ABSENT + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - nodeNotExistsWithStatusIn_TRANSIENT_BACKFILLED_TRANSIENT_BACKFILL_ONLY($prev-Target) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_MERGED->TRANSIENT_WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_MERGED + - $next-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_MERGE_ONLY->TRANSIENT_WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_MERGE_ONLY + - $next-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_VALIDATED->TRANSIENT_WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_VALIDATED + - $next-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_WRITE_ONLY->TRANSIENT_DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - $next-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - nodeNotExistsWithStatusIn_TRANSIENT_VALIDATED_TRANSIENT_MERGE_ONLY_TRANSIENT_MERGED($prev-Target) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: VALIDATED->PUBLIC' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = VALIDATED + - $next-Node[CurrentStatus] = PUBLIC + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = WRITE_ONLY + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILLED->DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = BACKFILLED + - $next-Node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = BACKFILL_ONLY + - $next-Node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = DELETE_ONLY + - $next-Node[CurrentStatus] = ABSENT + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - nodeNotExistsWithStatusIn_BACKFILLED_BACKFILL_ONLY($prev-Target) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: MERGED->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = MERGED + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = MERGE_ONLY + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = PUBLIC + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = VALIDATED + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = WRITE_ONLY + - $next-Node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - nodeNotExistsWithStatusIn_VALIDATED_MERGE_ONLY_MERGED($prev-Target) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: ABSENT->BACKFILL_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = ABSENT + - $next-Node[CurrentStatus] = BACKFILL_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILLED->DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = BACKFILLED + - $next-Node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = BACKFILL_ONLY + - $next-Node[CurrentStatus] = BACKFILLED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = DELETE_ONLY + - $next-Node[CurrentStatus] = MERGE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: MERGED->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = MERGED + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: MERGE_ONLY->MERGED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = MERGE_ONLY + - $next-Node[CurrentStatus] = MERGED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = VALIDATED + - $next-Node[CurrentStatus] = PUBLIC + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = WRITE_ONLY + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.TemporaryIndex' + - $next[Type] = '*scpb.TemporaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = DELETE_ONLY + - $next-Node[CurrentStatus] = ABSENT + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - nodeNotExistsWithStatusIn_TRANSIENT_DELETE_ONLY($prev-Target) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'TemporaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_ABSENT->ABSENT' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.TemporaryIndex' + - $next[Type] = '*scpb.TemporaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_ABSENT + - $next-Node[CurrentStatus] = ABSENT + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'TemporaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.TemporaryIndex' + - $next[Type] = '*scpb.TemporaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - $next-Node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.TemporaryIndex' + - $next[Type] = '*scpb.TemporaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = WRITE_ONLY + - $next-Node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.TemporaryIndex' + - $next[Type] = '*scpb.TemporaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = ABSENT + - $next-Node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.TemporaryIndex' + - $next[Type] = '*scpb.TemporaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = DELETE_ONLY + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.TemporaryIndex' + - $next[Type] = '*scpb.TemporaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - $next-Node[CurrentStatus] = TRANSIENT_ABSENT + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->TRANSIENT_DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.TemporaryIndex' + - $next[Type] = '*scpb.TemporaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = WRITE_ONLY + - $next-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'UniqueWithoutIndexConstraint transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.UniqueWithoutIndexConstraint' + - $next[Type] = '*scpb.UniqueWithoutIndexConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = PUBLIC + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'UniqueWithoutIndexConstraint transitions to ABSENT uphold 2-version invariant: VALIDATED->ABSENT' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.UniqueWithoutIndexConstraint' + - $next[Type] = '*scpb.UniqueWithoutIndexConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = VALIDATED + - $next-Node[CurrentStatus] = ABSENT + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - nodeNotExistsWithStatusIn_WRITE_ONLY($prev-Target) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'UniqueWithoutIndexConstraint transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.UniqueWithoutIndexConstraint' + - $next[Type] = '*scpb.UniqueWithoutIndexConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = WRITE_ONLY + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'UniqueWithoutIndexConstraint transitions to PUBLIC uphold 2-version invariant: ABSENT->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.UniqueWithoutIndexConstraint' + - $next[Type] = '*scpb.UniqueWithoutIndexConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = ABSENT + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'UniqueWithoutIndexConstraint transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.UniqueWithoutIndexConstraint' + - $next[Type] = '*scpb.UniqueWithoutIndexConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = VALIDATED + - $next-Node[CurrentStatus] = PUBLIC + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'UniqueWithoutIndexConstraint transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.UniqueWithoutIndexConstraint' + - $next[Type] = '*scpb.UniqueWithoutIndexConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = WRITE_ONLY + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: adding a transient column compute expression moves to 'absent' after PK validation to ensures it's there for the backfill + from: primary-index-Node + kind: Precedence + to: transient-column-compute-Node + query: + - $primary-index[Type] = '*scpb.PrimaryIndex' + - $transient-column-compute[Type] = '*scpb.ColumnComputeExpression' + - joinOnDescID($primary-index, $transient-column-compute, $table-id) + - $primary-index-Target[TargetStatus] = PUBLIC + - $transient-column-compute-Target[TargetStatus] = TRANSIENT_ABSENT + - $primary-index-Node[CurrentStatus] = VALIDATED + - $transient-column-compute-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($primary-index, $primary-index-Target, $primary-index-Node) + - joinTargetNode($transient-column-compute, $transient-column-compute-Target, $transient-column-compute-Node) +- name: all adding indexes reached BACKFILL_ONLY before any of their columns disappear + from: index-Node + kind: Precedence + to: column-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex'] + - $column[Type] = '*scpb.Column' + - ColumnInIndex($index-column, $index, $table-id, $column-id, $index-id) + - joinOnColumnID($index-column, $column, $table-id, $column-id) + - $index-Target[TargetStatus] IN [PUBLIC, TRANSIENT_ABSENT] + - $index-Node[CurrentStatus] = BACKFILL_ONLY + - $column-Target[TargetStatus] = ABSENT + - $column-Node[CurrentStatus] = WRITE_ONLY + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: back-reference in parent descriptor is removed before parent descriptor is dropped + from: back-reference-in-parent-descriptor-Node + kind: Precedence + to: parent-descriptor-Node + query: + - $back-reference-in-parent-descriptor[Type] IN ['*scpb.SchemaChild', '*scpb.SchemaParent'] + - $parent-descriptor[Type] IN ['*scpb.AliasType', '*scpb.CompositeType', '*scpb.Database', '*scpb.EnumType', '*scpb.Function', '*scpb.Schema', '*scpb.Sequence', '*scpb.Table', '*scpb.View'] + - joinReferencedDescID($back-reference-in-parent-descriptor, $parent-descriptor, $desc-id) + - toAbsent($back-reference-in-parent-descriptor-Target, $parent-descriptor-Target) + - $back-reference-in-parent-descriptor-Node[CurrentStatus] = ABSENT + - $parent-descriptor-Node[CurrentStatus] = DROPPED + - joinTargetNode($back-reference-in-parent-descriptor, $back-reference-in-parent-descriptor-Target, $back-reference-in-parent-descriptor-Node) + - joinTargetNode($parent-descriptor, $parent-descriptor-Target, $parent-descriptor-Node) +- name: column constraint removed right before column reaches write only + from: column-constraint-Node + kind: Precedence + to: column-Node + query: + - $column-constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.UniqueWithoutIndexConstraint'] + - $column[Type] = '*scpb.Column' + - joinOnColumnID($column-constraint, $column, $table-id, $col-id) + - toAbsent($column-constraint-Target, $column-Target) + - $column-constraint-Node[CurrentStatus] = ABSENT + - $column-Node[CurrentStatus] = WRITE_ONLY + - joinTargetNode($column-constraint, $column-constraint-Target, $column-constraint-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: column constraint removed right before column reaches write only + from: column-constraint-Node + kind: Precedence + to: column-Node + query: + - $column-constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.UniqueWithoutIndexConstraint'] + - $column[Type] = '*scpb.Column' + - joinOnColumnID($column-constraint, $column, $table-id, $col-id) + - transient($column-constraint-Target, $column-Target) + - $column-constraint-Node[CurrentStatus] = TRANSIENT_ABSENT + - $column-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - joinTargetNode($column-constraint, $column-constraint-Target, $column-constraint-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: column constraint removed right before column reaches write only + from: column-constraint-Node + kind: Precedence + to: column-Node + query: + - $column-constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.UniqueWithoutIndexConstraint'] + - $column[Type] = '*scpb.Column' + - joinOnColumnID($column-constraint, $column, $table-id, $col-id) + - $column-constraint-Target[TargetStatus] = TRANSIENT_ABSENT + - $column-constraint-Node[CurrentStatus] = TRANSIENT_ABSENT + - $column-Target[TargetStatus] = ABSENT + - $column-Node[CurrentStatus] = WRITE_ONLY + - joinTargetNode($column-constraint, $column-constraint-Target, $column-constraint-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: column constraint removed right before column reaches write only + from: column-constraint-Node + kind: Precedence + to: column-Node + query: + - $column-constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.UniqueWithoutIndexConstraint'] + - $column[Type] = '*scpb.Column' + - joinOnColumnID($column-constraint, $column, $table-id, $col-id) + - $column-constraint-Target[TargetStatus] = ABSENT + - $column-constraint-Node[CurrentStatus] = ABSENT + - $column-Target[TargetStatus] = TRANSIENT_ABSENT + - $column-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - joinTargetNode($column-constraint, $column-constraint-Target, $column-constraint-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: column dependents exist before column becomes public + from: dependent-Node + kind: Precedence + to: column-Node + query: + - $dependent[Type] IN ['*scpb.ColumnComment', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnName', '*scpb.ColumnNotNull', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.IndexColumn', '*scpb.SequenceOwner'] + - $column[Type] = '*scpb.Column' + - joinOnColumnID($dependent, $column, $table-id, $col-id) + - ToPublicOrTransient($dependent-Target, $column-Target) + - $dependent-Node[CurrentStatus] = PUBLIC + - $column-Node[CurrentStatus] = PUBLIC + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: column existence precedes column dependents + from: column-Node + kind: Precedence + to: dependent-Node + query: + - $column[Type] = '*scpb.Column' + - $dependent[Type] IN ['*scpb.ColumnComment', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnName', '*scpb.ColumnNotNull', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.IndexColumn', '*scpb.SequenceOwner'] + - joinOnColumnID($column, $dependent, $table-id, $col-id) + - ToPublicOrTransient($column-Target, $dependent-Target) + - $column-Node[CurrentStatus] = DELETE_ONLY + - $dependent-Node[CurrentStatus] = PUBLIC + - no column type alteration in progress($table-id, $col-id) + - joinTargetNode($column, $column-Target, $column-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: column existence precedes column dependents during an alter column type + from: column-Node + kind: Precedence + to: dependent-Node + query: + - $column[Type] = '*scpb.Column' + - $dependent[Type] IN ['*scpb.ColumnComment', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnNotNull', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.IndexColumn', '*scpb.SequenceOwner'] + - joinOnColumnID($column, $dependent, $table-id, $col-id) + - ToPublicOrTransient($column-Target, $dependent-Target) + - $column-Node[CurrentStatus] = DELETE_ONLY + - $dependent-Node[CurrentStatus] = PUBLIC + - $column[Type] = '*scpb.Column' + - $compute-expression[Type] = '*scpb.ColumnComputeExpression' + - joinOnColumnID($column, $compute-expression, $table-id, $col-id) + - $compute-expression[Usage] = ALTER_TYPE_USING + - joinTargetNode($column, $column-Target, $column-Node) + - joinTargetNode($compute-expression, $compute-expression-Target, $compute-expression-Node) + - joinTargetNode($column, $column-Target, $column-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: column existence precedes index existence + from: column-Node + kind: Precedence + to: index-Node + query: + - $column[Type] = '*scpb.Column' + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex'] + - joinOnColumnID($column, $index-column, $table-id, $column-id) + - ColumnInIndex($index-column, $index, $table-id, $column-id, $index-id) + - ToPublicOrTransient($column-Target, $index-Target) + - $column-Node[CurrentStatus] = DELETE_ONLY + - $index-Node[CurrentStatus] = BACKFILL_ONLY + - joinTargetNode($column, $column-Target, $column-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: column existence precedes temp index existence + from: column-Node + kind: Precedence + to: index-Node + query: + - $column[Type] = '*scpb.Column' + - $index[Type] = '*scpb.TemporaryIndex' + - joinOnColumnID($index-column, $column, $table-id, $column-id) + - ColumnInIndex($index-column, $index, $table-id, $column-id, $index-id) + - ToPublicOrTransient($column-Target, $index-Target) + - $column-Node[CurrentStatus] = DELETE_ONLY + - $index-Node[CurrentStatus] = DELETE_ONLY + - joinTargetNode($column, $column-Target, $column-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: column is WRITE_ONLY before temporary index is WRITE_ONLY + from: column-Node + kind: Precedence + to: index-Node + query: + - $column[Type] = '*scpb.Column' + - $index[Type] = '*scpb.TemporaryIndex' + - joinOnColumnID($index-column, $column, $table-id, $column-id) + - ColumnInIndex($index-column, $index, $table-id, $column-id, $index-id) + - ToPublicOrTransient($column-Target, $index-Target) + - $column-Node[CurrentStatus] = WRITE_ONLY + - $index-Node[CurrentStatus] = WRITE_ONLY + - joinTargetNode($column, $column-Target, $column-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: column name set right after column existence, except for alter column type + from: column-Node + kind: SameStagePrecedence + to: column-name-or-type-Node + query: + - $column[Type] = '*scpb.Column' + - $column-name-or-type[Type] = '*scpb.ColumnName' + - ToPublicOrTransient($column-Target, $column-name-or-type-Target) + - $column-Node[CurrentStatus] = DELETE_ONLY + - $column-name-or-type-Node[CurrentStatus] = PUBLIC + - joinOnColumnID($column, $column-name-or-type, $table-id, $col-id) + - no column type alteration in progress($table-id, $col-id) + - joinTargetNode($column, $column-Target, $column-Node) + - joinTargetNode($column-name-or-type, $column-name-or-type-Target, $column-name-or-type-Node) +- name: column no longer public before dependents + from: column-Node + kind: Precedence + to: dependent-Node + query: + - $column[Type] = '*scpb.Column' + - $dependent[Type] IN ['*scpb.ColumnComment', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnName', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.IndexColumn', '*scpb.SequenceOwner'] + - joinOnColumnID($column, $dependent, $table-id, $col-id) + - toAbsent($column-Target, $dependent-Target) + - $column-Node[CurrentStatus] = WRITE_ONLY + - $dependent-Node[CurrentStatus] = ABSENT + - joinTargetNode($column, $column-Target, $column-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: column no longer public before dependents + from: column-Node + kind: Precedence + to: dependent-Node + query: + - $column[Type] = '*scpb.Column' + - $dependent[Type] IN ['*scpb.ColumnComment', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnName', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.IndexColumn', '*scpb.SequenceOwner'] + - joinOnColumnID($column, $dependent, $table-id, $col-id) + - transient($column-Target, $dependent-Target) + - $column-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - $dependent-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($column, $column-Target, $column-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: column no longer public before dependents + from: column-Node + kind: Precedence + to: dependent-Node + query: + - $column[Type] = '*scpb.Column' + - $dependent[Type] IN ['*scpb.ColumnComment', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnName', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.IndexColumn', '*scpb.SequenceOwner'] + - joinOnColumnID($column, $dependent, $table-id, $col-id) + - $column-Target[TargetStatus] = TRANSIENT_ABSENT + - $column-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - $dependent-Target[TargetStatus] = ABSENT + - $dependent-Node[CurrentStatus] = ABSENT + - joinTargetNode($column, $column-Target, $column-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: column no longer public before dependents + from: column-Node + kind: Precedence + to: dependent-Node + query: + - $column[Type] = '*scpb.Column' + - $dependent[Type] IN ['*scpb.ColumnComment', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnName', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.IndexColumn', '*scpb.SequenceOwner'] + - joinOnColumnID($column, $dependent, $table-id, $col-id) + - $column-Target[TargetStatus] = ABSENT + - $column-Node[CurrentStatus] = WRITE_ONLY + - $dependent-Target[TargetStatus] = TRANSIENT_ABSENT + - $dependent-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($column, $column-Target, $column-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: column public before non-index-backed constraint (including hash-sharded) is created + from: column-Node + kind: Precedence + to: constraint-Node + query: + - $column[Type] = '*scpb.Column' + - $constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.CheckConstraintUnvalidated', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.UniqueWithoutIndexConstraint', '*scpb.UniqueWithoutIndexConstraintUnvalidated'] + - $column[ColumnID] = $columnID + - $constraint[ReferencedColumnIDs] CONTAINS $columnID + - joinOnDescID($column, $constraint, $table-id) + - ToPublicOrTransient($column-Target, $constraint-Target) + - $column-Node[CurrentStatus] = PUBLIC + - $constraint-Node[CurrentStatus] = WRITE_ONLY + - joinTargetNode($column, $column-Target, $column-Node) + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) +- name: 'column type dependents removed right before column type, except if part of a column type alteration ' + from: dependent-Node + kind: SameStagePrecedence + to: column-type-Node + query: + - $dependent[Type] IN ['*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnOnUpdateExpression', '*scpb.SequenceOwner'] + - $column-type[Type] = '*scpb.ColumnType' + - joinOnColumnID($dependent, $column-type, $table-id, $col-id) + - no column type alteration in progress($table-id, $col-id) + - toAbsent($dependent-Target, $column-type-Target) + - $dependent-Node[CurrentStatus] = ABSENT + - $column-type-Node[CurrentStatus] = ABSENT + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($column-type, $column-type-Target, $column-type-Node) +- name: column type is changed to public after doing validation of a transient check constraint + from: transient-check-constraint-Node + kind: SameStagePrecedence + to: column-type-Node + query: + - $transient-check-constraint[Type] = '*scpb.CheckConstraint' + - $column-type[Type] = '*scpb.ColumnType' + - joinOnDescID($transient-check-constraint, $column-type, $table-id) + - $column-type[ColumnID] = $columnID + - $transient-check-constraint[ReferencedColumnIDs] CONTAINS $columnID + - $transient-check-constraint-Target[TargetStatus] = TRANSIENT_ABSENT + - $column-type-Target[TargetStatus] = PUBLIC + - $transient-check-constraint-Node[CurrentStatus] = TRANSIENT_VALIDATED + - $column-type-Node[CurrentStatus] = PUBLIC + - joinTargetNode($transient-check-constraint, $transient-check-constraint-Target, $transient-check-constraint-Node) + - joinTargetNode($column-type, $column-type-Target, $column-type-Node) +- name: column type removed before column family + from: column-type-Node + kind: Precedence + to: column-family-Node + query: + - $column-type[Type] = '*scpb.ColumnType' + - $column-family[Type] = '*scpb.ColumnFamily' + - joinOnColumnFamilyID($column-type, $column-family, $table-id, $family-id) + - toAbsent($column-type-Target, $column-family-Target) + - $column-type-Node[CurrentStatus] = ABSENT + - $column-family-Node[CurrentStatus] = ABSENT + - joinTargetNode($column-type, $column-type-Target, $column-type-Node) + - joinTargetNode($column-family, $column-family-Target, $column-family-Node) +- name: column type removed right before column when not dropping relation + from: column-type-Node + kind: SameStagePrecedence + to: column-Node + query: + - $column-type[Type] = '*scpb.ColumnType' + - descriptorIsNotBeingDropped-25.1($column-type) + - $column[Type] = '*scpb.Column' + - joinOnColumnID($column-type, $column, $table-id, $col-id) + - toAbsent($column-type-Target, $column-Target) + - $column-type-Node[CurrentStatus] = ABSENT + - $column-Node[CurrentStatus] = ABSENT + - joinTargetNode($column-type, $column-type-Target, $column-type-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: column type set right after column existence + from: column-Node + kind: SameStagePrecedence + to: column-type-Node + query: + - $column[Type] = '*scpb.Column' + - $column-type[Type] = '*scpb.ColumnType' + - ToPublicOrTransient($column-Target, $column-type-Target) + - $column-Node[CurrentStatus] = DELETE_ONLY + - $column-type-Node[CurrentStatus] = PUBLIC + - joinOnColumnID($column, $column-type, $table-id, $col-id) + - joinTargetNode($column, $column-Target, $column-Node) + - joinTargetNode($column-type, $column-type-Target, $column-type-Node) +- name: column type update is decomposed as a drop then add + from: old-column-type-Node + kind: Precedence + to: new-column-type-Node + query: + - $old-column-type[Type] = '*scpb.ColumnType' + - $new-column-type[Type] = '*scpb.ColumnType' + - joinOnColumnID($old-column-type, $new-column-type, $table-id, $col-id) + - $old-column-type-Target[TargetStatus] = ABSENT + - $old-column-type-Node[CurrentStatus] = PUBLIC + - $new-column-type-Target[TargetStatus] = PUBLIC + - $new-column-type-Node[CurrentStatus] = ABSENT + - joinTargetNode($old-column-type, $old-column-type-Target, $old-column-type-Node) + - joinTargetNode($new-column-type, $new-column-type-Target, $new-column-type-Node) +- name: column writable right before column constraint is enforced. + from: column-Node + kind: SameStagePrecedence + to: column-constraint-Node + query: + - $column[Type] = '*scpb.Column' + - $column-constraint[Type] = '*scpb.ColumnNotNull' + - joinOnColumnID($column, $column-constraint, $table-id, $col-id) + - ToPublicOrTransient($column-Target, $column-constraint-Target) + - $column-Node[CurrentStatus] = WRITE_ONLY + - $column-constraint-Node[CurrentStatus] = WRITE_ONLY + - joinTargetNode($column, $column-Target, $column-Node) + - joinTargetNode($column-constraint, $column-constraint-Target, $column-constraint-Node) +- name: constraint dependent public right before complex constraint + from: dependent-Node + kind: SameStagePrecedence + to: complex-constraint-Node + query: + - $dependent[Type] = '*scpb.ConstraintComment' + - $complex-constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.UniqueWithoutIndexConstraint'] + - joinOnConstraintID($dependent, $complex-constraint, $table-id, $constraint-id) + - ToPublicOrTransient($dependent-Target, $complex-constraint-Target) + - $dependent-Node[CurrentStatus] = PUBLIC + - $complex-constraint-Node[CurrentStatus] = PUBLIC + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($complex-constraint, $complex-constraint-Target, $complex-constraint-Node) +- name: constraint no longer public before dependents + from: constraint-Node + kind: Precedence + to: dependent-Node + query: + - $constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.UniqueWithoutIndexConstraint'] + - $dependent[Type] = '*scpb.ConstraintComment' + - joinOnConstraintID($constraint, $dependent, $table-id, $constraint-id) + - toAbsent($constraint-Target, $dependent-Target) + - $constraint-Node[CurrentStatus] = VALIDATED + - $dependent-Node[CurrentStatus] = ABSENT + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: constraint no longer public before dependents + from: constraint-Node + kind: Precedence + to: dependent-Node + query: + - $constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.UniqueWithoutIndexConstraint'] + - $dependent[Type] = '*scpb.ConstraintComment' + - joinOnConstraintID($constraint, $dependent, $table-id, $constraint-id) + - transient($constraint-Target, $dependent-Target) + - $constraint-Node[CurrentStatus] = TRANSIENT_VALIDATED + - $dependent-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: constraint no longer public before dependents + from: constraint-Node + kind: Precedence + to: dependent-Node + query: + - $constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.UniqueWithoutIndexConstraint'] + - $dependent[Type] = '*scpb.ConstraintComment' + - joinOnConstraintID($constraint, $dependent, $table-id, $constraint-id) + - $constraint-Target[TargetStatus] = TRANSIENT_ABSENT + - $constraint-Node[CurrentStatus] = TRANSIENT_VALIDATED + - $dependent-Target[TargetStatus] = ABSENT + - $dependent-Node[CurrentStatus] = ABSENT + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: constraint no longer public before dependents + from: constraint-Node + kind: Precedence + to: dependent-Node + query: + - $constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.UniqueWithoutIndexConstraint'] + - $dependent[Type] = '*scpb.ConstraintComment' + - joinOnConstraintID($constraint, $dependent, $table-id, $constraint-id) + - $constraint-Target[TargetStatus] = ABSENT + - $constraint-Node[CurrentStatus] = VALIDATED + - $dependent-Target[TargetStatus] = TRANSIENT_ABSENT + - $dependent-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: cross-descriptor constraint is absent before referenced descriptor is dropped + from: cross-desc-constraint-Node + kind: Precedence + to: referenced-descriptor-Node + query: + - $cross-desc-constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.ForeignKeyConstraint', '*scpb.UniqueWithoutIndexConstraint'] + - $referenced-descriptor[Type] IN ['*scpb.AliasType', '*scpb.CompositeType', '*scpb.Database', '*scpb.EnumType', '*scpb.Function', '*scpb.Schema', '*scpb.Sequence', '*scpb.Table', '*scpb.View'] + - joinReferencedDescID($cross-desc-constraint, $referenced-descriptor, $desc-id) + - toAbsent($cross-desc-constraint-Target, $referenced-descriptor-Target) + - $cross-desc-constraint-Node[CurrentStatus] = ABSENT + - $referenced-descriptor-Node[CurrentStatus] = DROPPED + - joinTargetNode($cross-desc-constraint, $cross-desc-constraint-Target, $cross-desc-constraint-Node) + - joinTargetNode($referenced-descriptor, $referenced-descriptor-Target, $referenced-descriptor-Node) +- name: cross-descriptor constraint is absent before referencing descriptor is dropped + from: cross-desc-constraint-Node + kind: Precedence + to: referencing-descriptor-Node + query: + - $cross-desc-constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.ForeignKeyConstraint', '*scpb.UniqueWithoutIndexConstraint'] + - $referencing-descriptor[Type] IN ['*scpb.AliasType', '*scpb.CompositeType', '*scpb.Database', '*scpb.EnumType', '*scpb.Function', '*scpb.Schema', '*scpb.Sequence', '*scpb.Table', '*scpb.View'] + - joinOnDescID($cross-desc-constraint, $referencing-descriptor, $desc-id) + - toAbsent($cross-desc-constraint-Target, $referencing-descriptor-Target) + - $cross-desc-constraint-Node[CurrentStatus] = ABSENT + - $referencing-descriptor-Node[CurrentStatus] = DROPPED + - joinTargetNode($cross-desc-constraint, $cross-desc-constraint-Target, $cross-desc-constraint-Node) + - joinTargetNode($referencing-descriptor, $referencing-descriptor-Target, $referencing-descriptor-Node) +- name: dependent view absent before secondary index + from: view-Node + kind: Precedence + to: index-Node + query: + - $view[Type] = '*scpb.View' + - $index[Type] = '*scpb.SecondaryIndex' + - viewReferencesIndex(*scpb.View, *scpb.SecondaryIndex)($view, $index) + - toAbsent($view-Target, $index-Target) + - $view-Node[CurrentStatus] = ABSENT + - $index-Node[CurrentStatus] = ABSENT + - joinTargetNode($view, $view-Target, $view-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: dependent view absent before secondary index + from: view-Node + kind: Precedence + to: index-Node + query: + - $view[Type] = '*scpb.View' + - $index[Type] = '*scpb.SecondaryIndex' + - viewReferencesIndex(*scpb.View, *scpb.SecondaryIndex)($view, $index) + - transient($view-Target, $index-Target) + - $view-Node[CurrentStatus] = TRANSIENT_ABSENT + - $index-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($view, $view-Target, $view-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: dependent view absent before secondary index + from: view-Node + kind: Precedence + to: index-Node + query: + - $view[Type] = '*scpb.View' + - $index[Type] = '*scpb.SecondaryIndex' + - viewReferencesIndex(*scpb.View, *scpb.SecondaryIndex)($view, $index) + - $view-Target[TargetStatus] = TRANSIENT_ABSENT + - $view-Node[CurrentStatus] = TRANSIENT_ABSENT + - $index-Target[TargetStatus] = ABSENT + - $index-Node[CurrentStatus] = ABSENT + - joinTargetNode($view, $view-Target, $view-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: dependent view absent before secondary index + from: view-Node + kind: Precedence + to: index-Node + query: + - $view[Type] = '*scpb.View' + - $index[Type] = '*scpb.SecondaryIndex' + - viewReferencesIndex(*scpb.View, *scpb.SecondaryIndex)($view, $index) + - $view-Target[TargetStatus] = ABSENT + - $view-Node[CurrentStatus] = ABSENT + - $index-Target[TargetStatus] = TRANSIENT_ABSENT + - $index-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($view, $view-Target, $view-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: dependent view no longer public before secondary index + from: view-Node + kind: Precedence + to: index-Node + query: + - $view[Type] = '*scpb.View' + - $index[Type] = '*scpb.SecondaryIndex' + - viewReferencesIndex(*scpb.View, *scpb.SecondaryIndex)($view, $index) + - toAbsent($view-Target, $index-Target) + - $view-Node[CurrentStatus] = DROPPED + - $index-Node[CurrentStatus] = VALIDATED + - joinTargetNode($view, $view-Target, $view-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: dependent view no longer public before secondary index + from: view-Node + kind: Precedence + to: index-Node + query: + - $view[Type] = '*scpb.View' + - $index[Type] = '*scpb.SecondaryIndex' + - viewReferencesIndex(*scpb.View, *scpb.SecondaryIndex)($view, $index) + - transient($view-Target, $index-Target) + - $view-Node[CurrentStatus] = TRANSIENT_DROPPED + - $index-Node[CurrentStatus] = TRANSIENT_VALIDATED + - joinTargetNode($view, $view-Target, $view-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: dependent view no longer public before secondary index + from: view-Node + kind: Precedence + to: index-Node + query: + - $view[Type] = '*scpb.View' + - $index[Type] = '*scpb.SecondaryIndex' + - viewReferencesIndex(*scpb.View, *scpb.SecondaryIndex)($view, $index) + - $view-Target[TargetStatus] = TRANSIENT_ABSENT + - $view-Node[CurrentStatus] = TRANSIENT_DROPPED + - $index-Target[TargetStatus] = ABSENT + - $index-Node[CurrentStatus] = VALIDATED + - joinTargetNode($view, $view-Target, $view-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: dependent view no longer public before secondary index + from: view-Node + kind: Precedence + to: index-Node + query: + - $view[Type] = '*scpb.View' + - $index[Type] = '*scpb.SecondaryIndex' + - viewReferencesIndex(*scpb.View, *scpb.SecondaryIndex)($view, $index) + - $view-Target[TargetStatus] = ABSENT + - $view-Node[CurrentStatus] = DROPPED + - $index-Target[TargetStatus] = TRANSIENT_ABSENT + - $index-Node[CurrentStatus] = TRANSIENT_VALIDATED + - joinTargetNode($view, $view-Target, $view-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: dependents added after policy + from: policy-Node + kind: SameStagePrecedence + to: dependent-Node + query: + - $policy[Type] = '*scpb.Policy' + - $dependent[Type] = '*scpb.PolicyName' + - joinOnPolicyID($policy, $dependent, $table-id, $policy-id) + - ToPublicOrTransient($policy-Target, $dependent-Target) + - $policy-Node[CurrentStatus] = PUBLIC + - $dependent-Node[CurrentStatus] = PUBLIC + - joinTargetNode($policy, $policy-Target, $policy-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: dependents exist before descriptor becomes public + from: dependent-Node + kind: Precedence + to: relation-Node + query: + - $dependent[Type] IN ['*scpb.CheckConstraint', '*scpb.CheckConstraintUnvalidated', '*scpb.Column', '*scpb.ColumnComment', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnFamily', '*scpb.ColumnName', '*scpb.ColumnNotNull', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.CompositeTypeAttrName', '*scpb.CompositeTypeAttrType', '*scpb.ConstraintComment', '*scpb.ConstraintWithoutIndexName', '*scpb.DatabaseComment', '*scpb.DatabaseRegionConfig', '*scpb.DatabaseRoleSetting', '*scpb.DatabaseZoneConfig', '*scpb.EnumTypeValue', '*scpb.ForeignKeyConstraint', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.FunctionBody', '*scpb.FunctionLeakProof', '*scpb.FunctionName', '*scpb.FunctionNullInputBehavior', '*scpb.FunctionSecurity', '*scpb.FunctionVolatility', '*scpb.IndexColumn', '*scpb.IndexComment', '*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.IndexZoneConfig', '*scpb.LDRJobIDs', '*scpb.NamedRangeZoneConfig', '*scpb.Namespace', '*scpb.Owner', '*scpb.PartitionZoneConfig', '*scpb.Policy', '*scpb.PolicyName', '*scpb.PolicyRole', '*scpb.PrimaryIndex', '*scpb.RowLevelTTL', '*scpb.SchemaChild', '*scpb.SchemaComment', '*scpb.SchemaParent', '*scpb.SecondaryIndex', '*scpb.SecondaryIndexPartial', '*scpb.SequenceOption', '*scpb.SequenceOwner', '*scpb.TableComment', '*scpb.TableLocalityGlobal', '*scpb.TableLocalityPrimaryRegion', '*scpb.TableLocalityRegionalByRow', '*scpb.TableLocalitySecondaryRegion', '*scpb.TablePartitioning', '*scpb.TableSchemaLocked', '*scpb.TableZoneConfig', '*scpb.TemporaryIndex', '*scpb.Trigger', '*scpb.TriggerDeps', '*scpb.TriggerEnabled', '*scpb.TriggerEvents', '*scpb.TriggerFunctionCall', '*scpb.TriggerName', '*scpb.TriggerTiming', '*scpb.TriggerTransition', '*scpb.TriggerWhen', '*scpb.TypeComment', '*scpb.UniqueWithoutIndexConstraint', '*scpb.UniqueWithoutIndexConstraintUnvalidated', '*scpb.UserPrivileges'] + - $relation[Type] IN ['*scpb.AliasType', '*scpb.CompositeType', '*scpb.Database', '*scpb.EnumType', '*scpb.Function', '*scpb.Schema', '*scpb.Sequence', '*scpb.Table', '*scpb.View'] + - joinOnDescID($dependent, $relation, $relation-id) + - ToPublicOrTransient($dependent-Target, $relation-Target) + - $dependent-Node[CurrentStatus] = PUBLIC + - $relation-Node[CurrentStatus] = PUBLIC + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($relation, $relation-Target, $relation-Node) +- name: dependents removed before column + from: dependent-Node + kind: Precedence + to: column-Node + query: + - $dependent[Type] IN ['*scpb.ColumnComment', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnName', '*scpb.ColumnNotNull', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.IndexColumn', '*scpb.SequenceOwner'] + - $column[Type] = '*scpb.Column' + - joinOnColumnID($dependent, $column, $table-id, $col-id) + - toAbsent($dependent-Target, $column-Target) + - $dependent-Node[CurrentStatus] = ABSENT + - $column-Node[CurrentStatus] = ABSENT + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: dependents removed before column + from: dependent-Node + kind: Precedence + to: column-Node + query: + - $dependent[Type] IN ['*scpb.ColumnComment', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnName', '*scpb.ColumnNotNull', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.IndexColumn', '*scpb.SequenceOwner'] + - $column[Type] = '*scpb.Column' + - joinOnColumnID($dependent, $column, $table-id, $col-id) + - transient($dependent-Target, $column-Target) + - $dependent-Node[CurrentStatus] = TRANSIENT_ABSENT + - $column-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: dependents removed before column + from: dependent-Node + kind: Precedence + to: column-Node + query: + - $dependent[Type] IN ['*scpb.ColumnComment', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnName', '*scpb.ColumnNotNull', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.IndexColumn', '*scpb.SequenceOwner'] + - $column[Type] = '*scpb.Column' + - joinOnColumnID($dependent, $column, $table-id, $col-id) + - $dependent-Target[TargetStatus] = TRANSIENT_ABSENT + - $dependent-Node[CurrentStatus] = TRANSIENT_ABSENT + - $column-Target[TargetStatus] = ABSENT + - $column-Node[CurrentStatus] = ABSENT + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: dependents removed before column + from: dependent-Node + kind: Precedence + to: column-Node + query: + - $dependent[Type] IN ['*scpb.ColumnComment', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnName', '*scpb.ColumnNotNull', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.IndexColumn', '*scpb.SequenceOwner'] + - $column[Type] = '*scpb.Column' + - joinOnColumnID($dependent, $column, $table-id, $col-id) + - $dependent-Target[TargetStatus] = ABSENT + - $dependent-Node[CurrentStatus] = ABSENT + - $column-Target[TargetStatus] = TRANSIENT_ABSENT + - $column-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: dependents removed before constraint + from: dependents-Node + kind: Precedence + to: constraint-Node + query: + - $dependents[Type] = '*scpb.ConstraintComment' + - $constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.UniqueWithoutIndexConstraint'] + - joinOnConstraintID($dependents, $constraint, $table-id, $constraint-id) + - toAbsent($dependents-Target, $constraint-Target) + - $dependents-Node[CurrentStatus] = ABSENT + - $constraint-Node[CurrentStatus] = ABSENT + - joinTargetNode($dependents, $dependents-Target, $dependents-Node) + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) +- name: dependents removed before constraint + from: dependents-Node + kind: Precedence + to: constraint-Node + query: + - $dependents[Type] = '*scpb.ConstraintComment' + - $constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.UniqueWithoutIndexConstraint'] + - joinOnConstraintID($dependents, $constraint, $table-id, $constraint-id) + - transient($dependents-Target, $constraint-Target) + - $dependents-Node[CurrentStatus] = TRANSIENT_ABSENT + - $constraint-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($dependents, $dependents-Target, $dependents-Node) + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) +- name: dependents removed before constraint + from: dependents-Node + kind: Precedence + to: constraint-Node + query: + - $dependents[Type] = '*scpb.ConstraintComment' + - $constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.UniqueWithoutIndexConstraint'] + - joinOnConstraintID($dependents, $constraint, $table-id, $constraint-id) + - $dependents-Target[TargetStatus] = TRANSIENT_ABSENT + - $dependents-Node[CurrentStatus] = TRANSIENT_ABSENT + - $constraint-Target[TargetStatus] = ABSENT + - $constraint-Node[CurrentStatus] = ABSENT + - joinTargetNode($dependents, $dependents-Target, $dependents-Node) + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) +- name: dependents removed before constraint + from: dependents-Node + kind: Precedence + to: constraint-Node + query: + - $dependents[Type] = '*scpb.ConstraintComment' + - $constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.UniqueWithoutIndexConstraint'] + - joinOnConstraintID($dependents, $constraint, $table-id, $constraint-id) + - $dependents-Target[TargetStatus] = ABSENT + - $dependents-Node[CurrentStatus] = ABSENT + - $constraint-Target[TargetStatus] = TRANSIENT_ABSENT + - $constraint-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($dependents, $dependents-Target, $dependents-Node) + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) +- name: dependents removed before index + from: dependent-Node + kind: Precedence + to: index-Node + query: + - $dependent[Type] IN ['*scpb.IndexColumn', '*scpb.IndexComment', '*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.IndexZoneConfig', '*scpb.PartitionZoneConfig', '*scpb.SecondaryIndexPartial'] + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - joinOnIndexID($dependent, $index, $table-id, $index-id) + - toAbsent($dependent-Target, $index-Target) + - $dependent-Node[CurrentStatus] = ABSENT + - $index-Node[CurrentStatus] = ABSENT + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: dependents removed before index + from: dependent-Node + kind: Precedence + to: index-Node + query: + - $dependent[Type] IN ['*scpb.IndexColumn', '*scpb.IndexComment', '*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.IndexZoneConfig', '*scpb.PartitionZoneConfig', '*scpb.SecondaryIndexPartial'] + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - joinOnIndexID($dependent, $index, $table-id, $index-id) + - transient($dependent-Target, $index-Target) + - $dependent-Node[CurrentStatus] = TRANSIENT_ABSENT + - $index-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: dependents removed before index + from: dependent-Node + kind: Precedence + to: index-Node + query: + - $dependent[Type] IN ['*scpb.IndexColumn', '*scpb.IndexComment', '*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.IndexZoneConfig', '*scpb.PartitionZoneConfig', '*scpb.SecondaryIndexPartial'] + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - joinOnIndexID($dependent, $index, $table-id, $index-id) + - $dependent-Target[TargetStatus] = TRANSIENT_ABSENT + - $dependent-Node[CurrentStatus] = TRANSIENT_ABSENT + - $index-Target[TargetStatus] = ABSENT + - $index-Node[CurrentStatus] = ABSENT + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: dependents removed before index + from: dependent-Node + kind: Precedence + to: index-Node + query: + - $dependent[Type] IN ['*scpb.IndexColumn', '*scpb.IndexComment', '*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.IndexZoneConfig', '*scpb.PartitionZoneConfig', '*scpb.SecondaryIndexPartial'] + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - joinOnIndexID($dependent, $index, $table-id, $index-id) + - $dependent-Target[TargetStatus] = ABSENT + - $dependent-Node[CurrentStatus] = ABSENT + - $index-Target[TargetStatus] = TRANSIENT_ABSENT + - $index-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: dependents removed before policy + from: dependent-Node + kind: SameStagePrecedence + to: policy-Node + query: + - $dependent[Type] = '*scpb.PolicyName' + - $policy[Type] = '*scpb.Policy' + - joinOnPolicyID($dependent, $policy, $table-id, $policy-id) + - toAbsent($dependent-Target, $policy-Target) + - $dependent-Node[CurrentStatus] = ABSENT + - $policy-Node[CurrentStatus] = ABSENT + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($policy, $policy-Target, $policy-Node) +- name: dependents removed before policy + from: dependent-Node + kind: SameStagePrecedence + to: policy-Node + query: + - $dependent[Type] = '*scpb.PolicyName' + - $policy[Type] = '*scpb.Policy' + - joinOnPolicyID($dependent, $policy, $table-id, $policy-id) + - transient($dependent-Target, $policy-Target) + - $dependent-Node[CurrentStatus] = TRANSIENT_ABSENT + - $policy-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($policy, $policy-Target, $policy-Node) +- name: dependents removed before policy + from: dependent-Node + kind: SameStagePrecedence + to: policy-Node + query: + - $dependent[Type] = '*scpb.PolicyName' + - $policy[Type] = '*scpb.Policy' + - joinOnPolicyID($dependent, $policy, $table-id, $policy-id) + - $dependent-Target[TargetStatus] = TRANSIENT_ABSENT + - $dependent-Node[CurrentStatus] = TRANSIENT_ABSENT + - $policy-Target[TargetStatus] = ABSENT + - $policy-Node[CurrentStatus] = ABSENT + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($policy, $policy-Target, $policy-Node) +- name: dependents removed before policy + from: dependent-Node + kind: SameStagePrecedence + to: policy-Node + query: + - $dependent[Type] = '*scpb.PolicyName' + - $policy[Type] = '*scpb.Policy' + - joinOnPolicyID($dependent, $policy, $table-id, $policy-id) + - $dependent-Target[TargetStatus] = ABSENT + - $dependent-Node[CurrentStatus] = ABSENT + - $policy-Target[TargetStatus] = TRANSIENT_ABSENT + - $policy-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($policy, $policy-Target, $policy-Node) +- name: dependents removed right before simple constraint + from: dependents-Node + kind: SameStagePrecedence + to: constraint-Node + query: + - $dependents[Type] = '*scpb.ConstraintComment' + - $constraint[Type] IN ['*scpb.CheckConstraintUnvalidated', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.UniqueWithoutIndexConstraintUnvalidated'] + - joinOnConstraintID($dependents, $constraint, $table-id, $constraint-id) + - toAbsent($dependents-Target, $constraint-Target) + - $dependents-Node[CurrentStatus] = ABSENT + - $constraint-Node[CurrentStatus] = ABSENT + - joinTargetNode($dependents, $dependents-Target, $dependents-Node) + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) +- name: dependents removed right before simple constraint + from: dependents-Node + kind: SameStagePrecedence + to: constraint-Node + query: + - $dependents[Type] = '*scpb.ConstraintComment' + - $constraint[Type] IN ['*scpb.CheckConstraintUnvalidated', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.UniqueWithoutIndexConstraintUnvalidated'] + - joinOnConstraintID($dependents, $constraint, $table-id, $constraint-id) + - transient($dependents-Target, $constraint-Target) + - $dependents-Node[CurrentStatus] = TRANSIENT_ABSENT + - $constraint-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($dependents, $dependents-Target, $dependents-Node) + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) +- name: dependents removed right before simple constraint + from: dependents-Node + kind: SameStagePrecedence + to: constraint-Node + query: + - $dependents[Type] = '*scpb.ConstraintComment' + - $constraint[Type] IN ['*scpb.CheckConstraintUnvalidated', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.UniqueWithoutIndexConstraintUnvalidated'] + - joinOnConstraintID($dependents, $constraint, $table-id, $constraint-id) + - $dependents-Target[TargetStatus] = TRANSIENT_ABSENT + - $dependents-Node[CurrentStatus] = TRANSIENT_ABSENT + - $constraint-Target[TargetStatus] = ABSENT + - $constraint-Node[CurrentStatus] = ABSENT + - joinTargetNode($dependents, $dependents-Target, $dependents-Node) + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) +- name: dependents removed right before simple constraint + from: dependents-Node + kind: SameStagePrecedence + to: constraint-Node + query: + - $dependents[Type] = '*scpb.ConstraintComment' + - $constraint[Type] IN ['*scpb.CheckConstraintUnvalidated', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.UniqueWithoutIndexConstraintUnvalidated'] + - joinOnConstraintID($dependents, $constraint, $table-id, $constraint-id) + - $dependents-Target[TargetStatus] = ABSENT + - $dependents-Node[CurrentStatus] = ABSENT + - $constraint-Target[TargetStatus] = TRANSIENT_ABSENT + - $constraint-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($dependents, $dependents-Target, $dependents-Node) + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) +- name: descriptor drop right before removing dependent between types + from: referenced-descriptor-Node + kind: SameStagePrecedence + to: referencing-via-type-Node + query: + - $referenced-descriptor[Type] IN ['*scpb.AliasType', '*scpb.CompositeType', '*scpb.EnumType'] + - $referenced-descriptor[DescID] = $fromDescID + - $referencing-via-type[ReferencedTypeIDs] CONTAINS $fromDescID + - $referencing-via-type[Type] = '*scpb.ColumnType' + - toAbsent($referenced-descriptor-Target, $referencing-via-type-Target) + - $referenced-descriptor-Node[CurrentStatus] = DROPPED + - $referencing-via-type-Node[CurrentStatus] = ABSENT + - joinTargetNode($referenced-descriptor, $referenced-descriptor-Target, $referenced-descriptor-Node) + - joinTargetNode($referencing-via-type, $referencing-via-type-Target, $referencing-via-type-Node) +- name: descriptor drop right before removing dependent with attr ref + from: referenced-descriptor-Node + kind: SameStagePrecedence + to: referencing-via-attr-Node + query: + - $referenced-descriptor[Type] IN ['*scpb.AliasType', '*scpb.CompositeType', '*scpb.Database', '*scpb.EnumType', '*scpb.Function', '*scpb.Schema', '*scpb.Sequence', '*scpb.Table', '*scpb.View'] + - $referencing-via-attr[Type] IN ['*scpb.CheckConstraintUnvalidated', '*scpb.ColumnComment', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnFamily', '*scpb.ColumnName', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.CompositeTypeAttrName', '*scpb.CompositeTypeAttrType', '*scpb.ConstraintComment', '*scpb.ConstraintWithoutIndexName', '*scpb.DatabaseComment', '*scpb.DatabaseRegionConfig', '*scpb.DatabaseRoleSetting', '*scpb.DatabaseZoneConfig', '*scpb.EnumTypeValue', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.FunctionBody', '*scpb.FunctionLeakProof', '*scpb.FunctionName', '*scpb.FunctionNullInputBehavior', '*scpb.FunctionSecurity', '*scpb.FunctionVolatility', '*scpb.IndexColumn', '*scpb.IndexComment', '*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.IndexZoneConfig', '*scpb.LDRJobIDs', '*scpb.NamedRangeZoneConfig', '*scpb.Namespace', '*scpb.Owner', '*scpb.PartitionZoneConfig', '*scpb.Policy', '*scpb.PolicyName', '*scpb.PolicyRole', '*scpb.RowLevelTTL', '*scpb.SchemaComment', '*scpb.SecondaryIndexPartial', '*scpb.SequenceOption', '*scpb.SequenceOwner', '*scpb.TableComment', '*scpb.TableLocalityGlobal', '*scpb.TableLocalityPrimaryRegion', '*scpb.TableLocalityRegionalByRow', '*scpb.TableLocalitySecondaryRegion', '*scpb.TablePartitioning', '*scpb.TableSchemaLocked', '*scpb.TableZoneConfig', '*scpb.Trigger', '*scpb.TriggerDeps', '*scpb.TriggerEnabled', '*scpb.TriggerEvents', '*scpb.TriggerFunctionCall', '*scpb.TriggerName', '*scpb.TriggerTiming', '*scpb.TriggerTransition', '*scpb.TriggerWhen', '*scpb.TypeComment', '*scpb.UniqueWithoutIndexConstraintUnvalidated', '*scpb.UserPrivileges'] + - joinReferencedDescID($referencing-via-attr, $referenced-descriptor, $desc-id) + - toAbsent($referenced-descriptor-Target, $referencing-via-attr-Target) + - $referenced-descriptor-Node[CurrentStatus] = DROPPED + - $referencing-via-attr-Node[CurrentStatus] = ABSENT + - joinTargetNode($referenced-descriptor, $referenced-descriptor-Target, $referenced-descriptor-Node) + - joinTargetNode($referencing-via-attr, $referencing-via-attr-Target, $referencing-via-attr-Node) +- name: descriptor drop right before removing dependent with expr ref to sequence + from: referenced-descriptor-Node + kind: SameStagePrecedence + to: referencing-via-expr-Node + query: + - $referenced-descriptor[Type] = '*scpb.Sequence' + - $referenced-descriptor[DescID] = $seqID + - $referencing-via-expr[ReferencedSequenceIDs] CONTAINS $seqID + - $referencing-via-expr[Type] IN ['*scpb.CheckConstraintUnvalidated', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.SecondaryIndexPartial'] + - toAbsent($referenced-descriptor-Target, $referencing-via-expr-Target) + - $referenced-descriptor-Node[CurrentStatus] = DROPPED + - $referencing-via-expr-Node[CurrentStatus] = ABSENT + - joinTargetNode($referenced-descriptor, $referenced-descriptor-Target, $referenced-descriptor-Node) + - joinTargetNode($referencing-via-expr, $referencing-via-expr-Target, $referencing-via-expr-Node) +- name: descriptor drop right before removing dependent with function refs in columns + from: referenced-descriptor-Node + kind: SameStagePrecedence + to: referencing-via-function-Node + query: + - $referenced-descriptor[Type] = '*scpb.Function' + - $referenced-descriptor[DescID] = $fromDescID + - $referencing-via-function[ReferencedFunctionIDs] CONTAINS $fromDescID + - $referencing-via-function[Type] IN ['*scpb.CheckConstraintUnvalidated', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.SecondaryIndexPartial'] + - toAbsent($referenced-descriptor-Target, $referencing-via-function-Target) + - $referenced-descriptor-Node[CurrentStatus] = DROPPED + - $referencing-via-function-Node[CurrentStatus] = ABSENT + - joinTargetNode($referenced-descriptor, $referenced-descriptor-Target, $referenced-descriptor-Node) + - joinTargetNode($referencing-via-function, $referencing-via-function-Target, $referencing-via-function-Node) +- name: descriptor drop right before removing dependent with type refs in expressions + from: referenced-descriptor-Node + kind: SameStagePrecedence + to: referencing-via-type-Node + query: + - $referenced-descriptor[Type] IN ['*scpb.AliasType', '*scpb.CompositeType', '*scpb.EnumType'] + - $referenced-descriptor[DescID] = $fromDescID + - $referencing-via-type[ReferencedTypeIDs] CONTAINS $fromDescID + - descriptorIsNotBeingDropped-25.1($referencing-via-type) + - $referencing-via-type[Type] IN ['*scpb.CheckConstraintUnvalidated', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.SecondaryIndexPartial'] + - toAbsent($referenced-descriptor-Target, $referencing-via-type-Target) + - $referenced-descriptor-Node[CurrentStatus] = DROPPED + - $referencing-via-type-Node[CurrentStatus] = ABSENT + - joinTargetNode($referenced-descriptor, $referenced-descriptor-Target, $referenced-descriptor-Node) + - joinTargetNode($referencing-via-type, $referencing-via-type-Target, $referencing-via-type-Node) +- name: descriptor dropped before dependent element removal + from: descriptor-Node + kind: Precedence + to: dependent-Node + query: + - $descriptor[Type] IN ['*scpb.AliasType', '*scpb.CompositeType', '*scpb.Database', '*scpb.EnumType', '*scpb.Function', '*scpb.Schema', '*scpb.Sequence', '*scpb.Table', '*scpb.View'] + - $dependent[Type] IN ['*scpb.CheckConstraintUnvalidated', '*scpb.ColumnComment', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnFamily', '*scpb.ColumnName', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.CompositeTypeAttrName', '*scpb.CompositeTypeAttrType', '*scpb.DatabaseComment', '*scpb.DatabaseRegionConfig', '*scpb.DatabaseRoleSetting', '*scpb.DatabaseZoneConfig', '*scpb.EnumTypeValue', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.FunctionBody', '*scpb.FunctionLeakProof', '*scpb.FunctionName', '*scpb.FunctionNullInputBehavior', '*scpb.FunctionSecurity', '*scpb.FunctionVolatility', '*scpb.IndexColumn', '*scpb.IndexComment', '*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.IndexZoneConfig', '*scpb.LDRJobIDs', '*scpb.NamedRangeZoneConfig', '*scpb.Namespace', '*scpb.Owner', '*scpb.PartitionZoneConfig', '*scpb.Policy', '*scpb.PolicyName', '*scpb.PolicyRole', '*scpb.RowLevelTTL', '*scpb.SchemaChild', '*scpb.SchemaComment', '*scpb.SchemaParent', '*scpb.SecondaryIndexPartial', '*scpb.SequenceOption', '*scpb.SequenceOwner', '*scpb.TableComment', '*scpb.TableLocalityGlobal', '*scpb.TableLocalityPrimaryRegion', '*scpb.TableLocalityRegionalByRow', '*scpb.TableLocalitySecondaryRegion', '*scpb.TablePartitioning', '*scpb.TableSchemaLocked', '*scpb.TableZoneConfig', '*scpb.Trigger', '*scpb.TriggerDeps', '*scpb.TriggerEnabled', '*scpb.TriggerEvents', '*scpb.TriggerFunctionCall', '*scpb.TriggerName', '*scpb.TriggerTiming', '*scpb.TriggerTransition', '*scpb.TriggerWhen', '*scpb.TypeComment', '*scpb.UniqueWithoutIndexConstraintUnvalidated', '*scpb.UserPrivileges'] + - joinOnDescID($descriptor, $dependent, $desc-id) + - toAbsent($descriptor-Target, $dependent-Target) + - $descriptor-Node[CurrentStatus] = DROPPED + - $dependent-Node[CurrentStatus] = ABSENT + - joinTargetNode($descriptor, $descriptor-Target, $descriptor-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: descriptor dropped in transaction before removal + from: dropped-Node + kind: PreviousTransactionPrecedence + to: absent-Node + query: + - $dropped[Type] IN ['*scpb.AliasType', '*scpb.CompositeType', '*scpb.Database', '*scpb.EnumType', '*scpb.Function', '*scpb.Schema', '*scpb.Sequence', '*scpb.Table', '*scpb.View'] + - $dropped[DescID] = $_ + - $dropped[Self] = $absent + - toAbsent($dropped-Target, $absent-Target) + - $dropped-Node[CurrentStatus] = DROPPED + - $absent-Node[CurrentStatus] = ABSENT + - joinTargetNode($dropped, $dropped-Target, $dropped-Node) + - joinTargetNode($absent, $absent-Target, $absent-Node) +- name: descriptor dropped right before removing back-reference in its parent descriptor + from: descriptor-Node + kind: SameStagePrecedence + to: back-reference-in-parent-descriptor-Node + query: + - $descriptor[Type] IN ['*scpb.AliasType', '*scpb.CompositeType', '*scpb.Database', '*scpb.EnumType', '*scpb.Function', '*scpb.Schema', '*scpb.Sequence', '*scpb.Table', '*scpb.View'] + - $back-reference-in-parent-descriptor[Type] IN ['*scpb.SchemaChild', '*scpb.SchemaParent'] + - joinOnDescID($descriptor, $back-reference-in-parent-descriptor, $desc-id) + - toAbsent($descriptor-Target, $back-reference-in-parent-descriptor-Target) + - $descriptor-Node[CurrentStatus] = DROPPED + - $back-reference-in-parent-descriptor-Node[CurrentStatus] = ABSENT + - joinTargetNode($descriptor, $descriptor-Target, $descriptor-Node) + - joinTargetNode($back-reference-in-parent-descriptor, $back-reference-in-parent-descriptor-Target, $back-reference-in-parent-descriptor-Node) +- name: descriptor existence precedes dependents + from: relation-Node + kind: Precedence + to: dependent-Node + query: + - $relation[Type] IN ['*scpb.AliasType', '*scpb.CompositeType', '*scpb.Database', '*scpb.EnumType', '*scpb.Function', '*scpb.Schema', '*scpb.Sequence', '*scpb.Table', '*scpb.View'] + - $dependent[Type] IN ['*scpb.CheckConstraint', '*scpb.CheckConstraintUnvalidated', '*scpb.Column', '*scpb.ColumnComment', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnFamily', '*scpb.ColumnName', '*scpb.ColumnNotNull', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.CompositeTypeAttrName', '*scpb.CompositeTypeAttrType', '*scpb.ConstraintComment', '*scpb.ConstraintWithoutIndexName', '*scpb.DatabaseComment', '*scpb.DatabaseData', '*scpb.DatabaseRegionConfig', '*scpb.DatabaseRoleSetting', '*scpb.DatabaseZoneConfig', '*scpb.EnumTypeValue', '*scpb.ForeignKeyConstraint', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.FunctionBody', '*scpb.FunctionLeakProof', '*scpb.FunctionName', '*scpb.FunctionNullInputBehavior', '*scpb.FunctionSecurity', '*scpb.FunctionVolatility', '*scpb.IndexColumn', '*scpb.IndexComment', '*scpb.IndexData', '*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.IndexZoneConfig', '*scpb.LDRJobIDs', '*scpb.NamedRangeZoneConfig', '*scpb.Namespace', '*scpb.Owner', '*scpb.PartitionZoneConfig', '*scpb.Policy', '*scpb.PolicyName', '*scpb.PolicyRole', '*scpb.PrimaryIndex', '*scpb.RowLevelTTL', '*scpb.SchemaChild', '*scpb.SchemaComment', '*scpb.SchemaParent', '*scpb.SecondaryIndex', '*scpb.SecondaryIndexPartial', '*scpb.SequenceOption', '*scpb.SequenceOwner', '*scpb.TableComment', '*scpb.TableData', '*scpb.TableLocalityGlobal', '*scpb.TableLocalityPrimaryRegion', '*scpb.TableLocalityRegionalByRow', '*scpb.TableLocalitySecondaryRegion', '*scpb.TablePartitioning', '*scpb.TableSchemaLocked', '*scpb.TableZoneConfig', '*scpb.TemporaryIndex', '*scpb.Trigger', '*scpb.TriggerDeps', '*scpb.TriggerEnabled', '*scpb.TriggerEvents', '*scpb.TriggerFunctionCall', '*scpb.TriggerName', '*scpb.TriggerTiming', '*scpb.TriggerTransition', '*scpb.TriggerWhen', '*scpb.TypeComment', '*scpb.UniqueWithoutIndexConstraint', '*scpb.UniqueWithoutIndexConstraintUnvalidated', '*scpb.UserPrivileges'] + - joinOnDescID($relation, $dependent, $relation-id) + - ToPublicOrTransient($relation-Target, $dependent-Target) + - $relation-Node[CurrentStatus] = DESCRIPTOR_ADDED + - $dependent-Node[CurrentStatus] = PUBLIC + - joinTargetNode($relation, $relation-Target, $relation-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: descriptor removed right before garbage collection + from: database-Node + kind: SameStagePrecedence + to: data-Node + query: + - $database[Type] IN ['*scpb.AliasType', '*scpb.CompositeType', '*scpb.Database', '*scpb.EnumType', '*scpb.Function', '*scpb.Schema', '*scpb.Sequence', '*scpb.Table', '*scpb.View'] + - $data[Type] = '*scpb.DatabaseData' + - joinOnDescID($database, $data, $db-id) + - toAbsent($database-Target, $data-Target) + - $database-Node[CurrentStatus] = ABSENT + - $data-Node[CurrentStatus] = DROPPED + - joinTargetNode($database, $database-Target, $database-Node) + - joinTargetNode($data, $data-Target, $data-Node) +- name: during a column type alterations, column type dependents removed before column type + from: dependent-Node + kind: Precedence + to: column-type-Node + query: + - $dependent[Type] IN ['*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnOnUpdateExpression', '*scpb.SequenceOwner'] + - $column-type[Type] = '*scpb.ColumnType' + - joinOnColumnID($dependent, $column-type, $table-id, $col-id) + - $column[Type] = '*scpb.Column' + - $compute-expression[Type] = '*scpb.ColumnComputeExpression' + - joinOnColumnID($column, $compute-expression, $table-id, $col-id) + - $compute-expression[Usage] = ALTER_TYPE_USING + - joinTargetNode($column, $column-Target, $column-Node) + - joinTargetNode($compute-expression, $compute-expression-Target, $compute-expression-Node) + - toAbsent($dependent-Target, $column-type-Target) + - $dependent-Node[CurrentStatus] = ABSENT + - $column-type-Node[CurrentStatus] = ABSENT + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($column-type, $column-type-Target, $column-type-Node) +- name: during alter column type, column names for old and new columns are swapped in the same stage + from: old-column-name-Node + kind: SameStagePrecedence + to: new-column-name-Node + query: + - $old-column-name[Type] = '*scpb.ColumnName' + - $new-column-name[Type] = '*scpb.ColumnName' + - $old-column-name-Target[TargetStatus] = ABSENT + - $old-column-name-Node[CurrentStatus] = ABSENT + - $new-column-name-Target[TargetStatus] = PUBLIC + - $new-column-name-Node[CurrentStatus] = PUBLIC + - joinOnDescID($old-column-name, $new-column-name, $table-id) + - $new-column-name[ColumnID] = $new-col-id + - $column[Type] = '*scpb.Column' + - $compute-expression[Type] = '*scpb.ColumnComputeExpression' + - joinOnColumnID($column, $compute-expression, $table-id, $new-col-id) + - $compute-expression[Usage] = ALTER_TYPE_USING + - joinTargetNode($column, $column-Target, $column-Node) + - joinTargetNode($compute-expression, $compute-expression-Target, $compute-expression-Node) + - joinTargetNode($old-column-name, $old-column-name-Target, $old-column-name-Node) + - joinTargetNode($new-column-name, $new-column-name-Target, $new-column-name-Node) +- name: ensure columns are in increasing order + from: later-column-Node + kind: Precedence + to: earlier-column-Node + query: + - $later-column[Type] = '*scpb.Column' + - joinTargetNode($later-column, $later-column-Target, $later-column-Node) + - $earlier-column[Type] = '*scpb.Column' + - joinOnDescID($later-column, $earlier-column, $table-id) + - ToPublicOrTransient($later-column-Target, $earlier-column-Target) + - $status IN [WRITE_ONLY, PUBLIC] + - $later-column-Node[CurrentStatus] = $status + - $earlier-column-Node[CurrentStatus] = $status + - SmallerColumnIDFirst(*scpb.Column, *scpb.Column)($later-column, $earlier-column) + - joinTargetNode($later-column, $later-column-Target, $later-column-Node) + - joinTargetNode($earlier-column, $earlier-column-Target, $earlier-column-Node) +- name: function name should be set before parent ids + from: function-name-Node + kind: Precedence + to: function-parent-Node + query: + - $function-name[Type] = '*scpb.FunctionName' + - $function-parent[Type] = '*scpb.SchemaChild' + - joinOnDescID($function-name, $function-parent, $function-id) + - ToPublicOrTransient($function-name-Target, $function-parent-Target) + - $function-name-Node[CurrentStatus] = PUBLIC + - $function-parent-Node[CurrentStatus] = PUBLIC + - joinTargetNode($function-name, $function-name-Target, $function-name-Node) + - joinTargetNode($function-parent, $function-parent-Target, $function-parent-Node) +- name: index data exists as soon as index accepts backfills + from: index-name-Node + kind: SameStagePrecedence + to: index-Node + query: + - $index-name[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex'] + - $index[Type] = '*scpb.IndexData' + - joinOnIndexID($index-name, $index, $table-id, $index-id) + - ToPublicOrTransient($index-name-Target, $index-Target) + - $index-name-Node[CurrentStatus] = BACKFILL_ONLY + - $index-Node[CurrentStatus] = PUBLIC + - joinTargetNode($index-name, $index-name-Target, $index-name-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: index dependents exist before index becomes public + from: dependent-Node + kind: Precedence + to: index-Node + query: + - $dependent[Type] IN ['*scpb.IndexColumn', '*scpb.IndexComment', '*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.IndexZoneConfig', '*scpb.PartitionZoneConfig', '*scpb.SecondaryIndexPartial'] + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - joinOnIndexID($dependent, $index, $table-id, $index-id) + - ToPublicOrTransient($dependent-Target, $index-Target) + - $dependent-Node[CurrentStatus] = PUBLIC + - $index-Node[CurrentStatus] = PUBLIC + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: index drop mutation visible before cleaning up index columns + from: index-Node + kind: Precedence + to: dependent-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - $dependent[Type] = '*scpb.IndexColumn' + - joinOnIndexID($index, $dependent, $table-id, $index-id) + - toAbsent($index-Target, $dependent-Target) + - $index-Node[CurrentStatus] = DELETE_ONLY + - $dependent-Node[CurrentStatus] = ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: index drop mutation visible before cleaning up index columns + from: index-Node + kind: Precedence + to: dependent-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - $dependent[Type] = '*scpb.IndexColumn' + - joinOnIndexID($index, $dependent, $table-id, $index-id) + - transient($index-Target, $dependent-Target) + - $index-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - $dependent-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: index drop mutation visible before cleaning up index columns + from: index-Node + kind: Precedence + to: dependent-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - $dependent[Type] = '*scpb.IndexColumn' + - joinOnIndexID($index, $dependent, $table-id, $index-id) + - $index-Target[TargetStatus] = TRANSIENT_ABSENT + - $index-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - $dependent-Target[TargetStatus] = ABSENT + - $dependent-Node[CurrentStatus] = ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: index drop mutation visible before cleaning up index columns + from: index-Node + kind: Precedence + to: dependent-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - $dependent[Type] = '*scpb.IndexColumn' + - joinOnIndexID($index, $dependent, $table-id, $index-id) + - $index-Target[TargetStatus] = ABSENT + - $index-Node[CurrentStatus] = DELETE_ONLY + - $dependent-Target[TargetStatus] = TRANSIENT_ABSENT + - $dependent-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: index existence precedes index dependents + from: index-Node + kind: Precedence + to: dependent-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex'] + - $dependent[Type] IN ['*scpb.IndexColumn', '*scpb.IndexComment', '*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.IndexZoneConfig', '*scpb.PartitionZoneConfig', '*scpb.SecondaryIndexPartial'] + - joinOnIndexID($index, $dependent, $table-id, $index-id) + - ToPublicOrTransient($index-Target, $dependent-Target) + - $index-Node[CurrentStatus] = BACKFILL_ONLY + - $dependent-Node[CurrentStatus] = PUBLIC + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: index is MERGED before its temp index starts to disappear + from: index-Node + kind: Precedence + to: temp-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex'] + - $temp[Type] = '*scpb.TemporaryIndex' + - joinOnDescID($index, $temp, $table-id) + - $index[TemporaryIndexID] = $temp-index-id + - $temp[IndexID] = $temp-index-id + - $index-Target[TargetStatus] IN [PUBLIC, TRANSIENT_ABSENT] + - $index-Node[CurrentStatus] = MERGED + - $temp-Target[TargetStatus] = TRANSIENT_ABSENT + - $temp-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($temp, $temp-Target, $temp-Node) +- name: index is ready to be validated before we validate constraint on it + from: index-Node + kind: Precedence + to: constraint-Node + query: + - $index[Type] = '*scpb.PrimaryIndex' + - $constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.UniqueWithoutIndexConstraint'] + - joinOnDescID($index, $constraint, $table-id) + - $index[IndexID] = $index-id-for-validation + - $constraint[IndexID] = $index-id-for-validation + - ToPublicOrTransient($index-Target, $constraint-Target) + - $index-Node[CurrentStatus] = VALIDATED + - $constraint-Node[CurrentStatus] = VALIDATED + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) +- name: index no longer public before dependents, excluding columns + from: index-Node + kind: Precedence + to: dependent-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - $dependent[Type] IN ['*scpb.IndexComment', '*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.IndexZoneConfig', '*scpb.PartitionZoneConfig', '*scpb.SecondaryIndexPartial'] + - joinOnIndexID($index, $dependent, $table-id, $index-id) + - toAbsent($index-Target, $dependent-Target) + - $index-Node[CurrentStatus] = VALIDATED + - $dependent-Node[CurrentStatus] = ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: index no longer public before dependents, excluding columns + from: index-Node + kind: Precedence + to: dependent-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - $dependent[Type] IN ['*scpb.IndexComment', '*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.IndexZoneConfig', '*scpb.PartitionZoneConfig', '*scpb.SecondaryIndexPartial'] + - joinOnIndexID($index, $dependent, $table-id, $index-id) + - transient($index-Target, $dependent-Target) + - $index-Node[CurrentStatus] = TRANSIENT_VALIDATED + - $dependent-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: index no longer public before dependents, excluding columns + from: index-Node + kind: Precedence + to: dependent-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - $dependent[Type] IN ['*scpb.IndexComment', '*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.IndexZoneConfig', '*scpb.PartitionZoneConfig', '*scpb.SecondaryIndexPartial'] + - joinOnIndexID($index, $dependent, $table-id, $index-id) + - $index-Target[TargetStatus] = TRANSIENT_ABSENT + - $index-Node[CurrentStatus] = TRANSIENT_VALIDATED + - $dependent-Target[TargetStatus] = ABSENT + - $dependent-Node[CurrentStatus] = ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: index no longer public before dependents, excluding columns + from: index-Node + kind: Precedence + to: dependent-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - $dependent[Type] IN ['*scpb.IndexComment', '*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.IndexZoneConfig', '*scpb.PartitionZoneConfig', '*scpb.SecondaryIndexPartial'] + - joinOnIndexID($index, $dependent, $table-id, $index-id) + - $index-Target[TargetStatus] = ABSENT + - $index-Node[CurrentStatus] = VALIDATED + - $dependent-Target[TargetStatus] = TRANSIENT_ABSENT + - $dependent-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: index no longer public before index name + from: index-Node + kind: Precedence + to: name-Node + query: + - $index[Type] = '*scpb.SecondaryIndex' + - $name[Type] = '*scpb.IndexName' + - joinOnIndexID($index, $name, $table-id, $index-id) + - toAbsent($index-Target, $name-Target) + - $index-Node[CurrentStatus] = DELETE_ONLY + - $name-Node[CurrentStatus] = ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($name, $name-Target, $name-Node) +- name: index no longer public before index name + from: index-Node + kind: Precedence + to: name-Node + query: + - $index[Type] = '*scpb.SecondaryIndex' + - $name[Type] = '*scpb.IndexName' + - joinOnIndexID($index, $name, $table-id, $index-id) + - transient($index-Target, $name-Target) + - $index-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - $name-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($name, $name-Target, $name-Node) +- name: index no longer public before index name + from: index-Node + kind: Precedence + to: name-Node + query: + - $index[Type] = '*scpb.SecondaryIndex' + - $name[Type] = '*scpb.IndexName' + - joinOnIndexID($index, $name, $table-id, $index-id) + - $index-Target[TargetStatus] = TRANSIENT_ABSENT + - $index-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - $name-Target[TargetStatus] = ABSENT + - $name-Node[CurrentStatus] = ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($name, $name-Target, $name-Node) +- name: index no longer public before index name + from: index-Node + kind: Precedence + to: name-Node + query: + - $index[Type] = '*scpb.SecondaryIndex' + - $name[Type] = '*scpb.IndexName' + - joinOnIndexID($index, $name, $table-id, $index-id) + - $index-Target[TargetStatus] = ABSENT + - $index-Node[CurrentStatus] = DELETE_ONLY + - $name-Target[TargetStatus] = TRANSIENT_ABSENT + - $name-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($name, $name-Target, $name-Node) +- name: index removed before garbage collection + from: index-Node + kind: Precedence + to: index-data-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - $index-data[Type] = '*scpb.IndexData' + - joinOnIndexID($index, $index-data, $table-id, $index-id) + - toAbsent($index-Target, $index-data-Target) + - $index-Node[CurrentStatus] = ABSENT + - $index-data-Node[CurrentStatus] = DROPPED + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($index-data, $index-data-Target, $index-data-Node) +- name: index removed before garbage collection + from: index-Node + kind: Precedence + to: index-data-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - $index-data[Type] = '*scpb.IndexData' + - joinOnIndexID($index, $index-data, $table-id, $index-id) + - transient($index-Target, $index-data-Target) + - $index-Node[CurrentStatus] = TRANSIENT_ABSENT + - $index-data-Node[CurrentStatus] = TRANSIENT_DROPPED + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($index-data, $index-data-Target, $index-data-Node) +- name: index removed before garbage collection + from: index-Node + kind: Precedence + to: index-data-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - $index-data[Type] = '*scpb.IndexData' + - joinOnIndexID($index, $index-data, $table-id, $index-id) + - $index-Target[TargetStatus] = TRANSIENT_ABSENT + - $index-Node[CurrentStatus] = TRANSIENT_ABSENT + - $index-data-Target[TargetStatus] = ABSENT + - $index-data-Node[CurrentStatus] = DROPPED + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($index-data, $index-data-Target, $index-data-Node) +- name: index removed before garbage collection + from: index-Node + kind: Precedence + to: index-data-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - $index-data[Type] = '*scpb.IndexData' + - joinOnIndexID($index, $index-data, $table-id, $index-id) + - $index-Target[TargetStatus] = ABSENT + - $index-Node[CurrentStatus] = ABSENT + - $index-data-Target[TargetStatus] = TRANSIENT_ABSENT + - $index-data-Node[CurrentStatus] = TRANSIENT_DROPPED + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($index-data, $index-data-Target, $index-data-Node) +- name: index-column added to index before index is backfilled + from: index-column-Node + kind: Precedence + to: index-Node + query: + - $index-column[Type] = '*scpb.IndexColumn' + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex'] + - joinOnIndexID($index-column, $index, $table-id, $index-id) + - ToPublicOrTransient($index-column-Target, $index-Target) + - $index-column-Node[CurrentStatus] = PUBLIC + - $index-Node[CurrentStatus] = BACKFILLED + - joinTargetNode($index-column, $index-column-Target, $index-column-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: index-column added to index before temp index receives writes + from: index-column-Node + kind: Precedence + to: index-Node + query: + - $index-column[Type] = '*scpb.IndexColumn' + - $index[Type] = '*scpb.TemporaryIndex' + - joinOnIndexID($index-column, $index, $table-id, $index-id) + - transient($index-column-Target, $index-Target) + - $index-column-Node[CurrentStatus] = PUBLIC + - $index-Node[CurrentStatus] = WRITE_ONLY + - joinTargetNode($index-column, $index-column-Target, $index-column-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: indexes containing column reach absent before column + from: index-Node + kind: Precedence + to: column-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex'] + - $column[Type] = '*scpb.Column' + - ColumnInIndex($index-column, $index, $table-id, $column-id, $index-id) + - joinOnColumnID($index-column, $column, $table-id, $column-id) + - descriptorIsNotBeingDropped-25.1($index-column) + - toAbsent($index-Target, $column-Target) + - $index-Node[CurrentStatus] = ABSENT + - $column-Node[CurrentStatus] = ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: indexes containing column reach absent before column + from: index-Node + kind: Precedence + to: column-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex'] + - $column[Type] = '*scpb.Column' + - ColumnInIndex($index-column, $index, $table-id, $column-id, $index-id) + - joinOnColumnID($index-column, $column, $table-id, $column-id) + - descriptorIsNotBeingDropped-25.1($index-column) + - transient($index-Target, $column-Target) + - $index-Node[CurrentStatus] = TRANSIENT_ABSENT + - $column-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: indexes containing column reach absent before column + from: index-Node + kind: Precedence + to: column-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex'] + - $column[Type] = '*scpb.Column' + - ColumnInIndex($index-column, $index, $table-id, $column-id, $index-id) + - joinOnColumnID($index-column, $column, $table-id, $column-id) + - descriptorIsNotBeingDropped-25.1($index-column) + - $index-Target[TargetStatus] = TRANSIENT_ABSENT + - $index-Node[CurrentStatus] = TRANSIENT_ABSENT + - $column-Target[TargetStatus] = ABSENT + - $column-Node[CurrentStatus] = ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: indexes containing column reach absent before column + from: index-Node + kind: Precedence + to: column-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex'] + - $column[Type] = '*scpb.Column' + - ColumnInIndex($index-column, $index, $table-id, $column-id, $index-id) + - joinOnColumnID($index-column, $column, $table-id, $column-id) + - descriptorIsNotBeingDropped-25.1($index-column) + - $index-Target[TargetStatus] = ABSENT + - $index-Node[CurrentStatus] = ABSENT + - $column-Target[TargetStatus] = TRANSIENT_ABSENT + - $column-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: namespace exist before schema parent + from: dependent-Node + kind: Precedence + to: relation-Node + query: + - $dependent[Type] = '*scpb.Namespace' + - $relation[Type] = '*scpb.SchemaParent' + - joinOnDescID($dependent, $relation, $schema-id) + - ToPublicOrTransient($dependent-Target, $relation-Target) + - $dependent-Node[CurrentStatus] = PUBLIC + - $relation-Node[CurrentStatus] = PUBLIC + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($relation, $relation-Target, $relation-Node) +- name: non-data dependents removed before descriptor + from: dependent-Node + kind: Precedence + to: descriptor-Node + query: + - $dependent[Type] IN ['*scpb.CheckConstraint', '*scpb.CheckConstraintUnvalidated', '*scpb.Column', '*scpb.ColumnComment', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnFamily', '*scpb.ColumnName', '*scpb.ColumnNotNull', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.CompositeTypeAttrName', '*scpb.CompositeTypeAttrType', '*scpb.ConstraintComment', '*scpb.ConstraintWithoutIndexName', '*scpb.DatabaseComment', '*scpb.DatabaseRegionConfig', '*scpb.DatabaseRoleSetting', '*scpb.DatabaseZoneConfig', '*scpb.EnumTypeValue', '*scpb.ForeignKeyConstraint', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.FunctionBody', '*scpb.FunctionLeakProof', '*scpb.FunctionName', '*scpb.FunctionNullInputBehavior', '*scpb.FunctionSecurity', '*scpb.FunctionVolatility', '*scpb.IndexColumn', '*scpb.IndexComment', '*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.IndexZoneConfig', '*scpb.LDRJobIDs', '*scpb.NamedRangeZoneConfig', '*scpb.Namespace', '*scpb.Owner', '*scpb.PartitionZoneConfig', '*scpb.Policy', '*scpb.PolicyName', '*scpb.PolicyRole', '*scpb.PrimaryIndex', '*scpb.RowLevelTTL', '*scpb.SchemaChild', '*scpb.SchemaComment', '*scpb.SchemaParent', '*scpb.SecondaryIndex', '*scpb.SecondaryIndexPartial', '*scpb.SequenceOption', '*scpb.SequenceOwner', '*scpb.TableComment', '*scpb.TableLocalityGlobal', '*scpb.TableLocalityPrimaryRegion', '*scpb.TableLocalityRegionalByRow', '*scpb.TableLocalitySecondaryRegion', '*scpb.TablePartitioning', '*scpb.TableSchemaLocked', '*scpb.TableZoneConfig', '*scpb.TemporaryIndex', '*scpb.Trigger', '*scpb.TriggerDeps', '*scpb.TriggerEnabled', '*scpb.TriggerEvents', '*scpb.TriggerFunctionCall', '*scpb.TriggerName', '*scpb.TriggerTiming', '*scpb.TriggerTransition', '*scpb.TriggerWhen', '*scpb.TypeComment', '*scpb.UniqueWithoutIndexConstraint', '*scpb.UniqueWithoutIndexConstraintUnvalidated', '*scpb.UserPrivileges'] + - $descriptor[Type] IN ['*scpb.AliasType', '*scpb.CompositeType', '*scpb.Database', '*scpb.EnumType', '*scpb.Function', '*scpb.Schema', '*scpb.Sequence', '*scpb.Table', '*scpb.View'] + - joinOnDescID($dependent, $descriptor, $desc-id) + - toAbsent($dependent-Target, $descriptor-Target) + - $dependent-Node[CurrentStatus] = ABSENT + - $descriptor-Node[CurrentStatus] = ABSENT + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($descriptor, $descriptor-Target, $descriptor-Node) +- name: old index absent before new index public when swapping with transient + from: old-primary-index-Node + kind: Precedence + to: new-primary-index-Node + query: + - $old-primary-index[Type] = '*scpb.PrimaryIndex' + - $transient-primary-index[Type] = '*scpb.PrimaryIndex' + - $new-primary-index[Type] = '*scpb.PrimaryIndex' + - joinOnDescID($old-primary-index, $transient-primary-index, $table-id) + - $old-primary-index[IndexID] = $old-index-id + - $transient-primary-index[SourceIndexID] = $old-index-id + - joinOnDescID($transient-primary-index, $new-primary-index, $table-id) + - $transient-primary-index[IndexID] = $transient-index-id + - $new-primary-index[SourceIndexID] = $transient-index-id + - $old-primary-index-Target[TargetStatus] = ABSENT + - $old-primary-index-Node[CurrentStatus] = ABSENT + - $new-primary-index-Target[TargetStatus] = PUBLIC + - $new-primary-index-Node[CurrentStatus] = PUBLIC + - joinTargetNode($old-primary-index, $old-primary-index-Target, $old-primary-index-Node) + - joinTargetNode($new-primary-index, $new-primary-index-Target, $new-primary-index-Node) +- name: partial predicate removed right before secondary index when not dropping relation + from: partial-predicate-Node + kind: SameStagePrecedence + to: index-Node + query: + - $partial-predicate[Type] = '*scpb.SecondaryIndexPartial' + - descriptorIsNotBeingDropped-25.1($partial-predicate) + - $index[Type] = '*scpb.SecondaryIndex' + - joinOnIndexID($partial-predicate, $index, $table-id, $index-id) + - toAbsent($partial-predicate-Target, $index-Target) + - $partial-predicate-Node[CurrentStatus] = ABSENT + - $index-Node[CurrentStatus] = ABSENT + - joinTargetNode($partial-predicate, $partial-predicate-Target, $partial-predicate-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: partial predicate removed right before secondary index when not dropping relation + from: partial-predicate-Node + kind: SameStagePrecedence + to: index-Node + query: + - $partial-predicate[Type] = '*scpb.SecondaryIndexPartial' + - descriptorIsNotBeingDropped-25.1($partial-predicate) + - $index[Type] = '*scpb.SecondaryIndex' + - joinOnIndexID($partial-predicate, $index, $table-id, $index-id) + - transient($partial-predicate-Target, $index-Target) + - $partial-predicate-Node[CurrentStatus] = TRANSIENT_ABSENT + - $index-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($partial-predicate, $partial-predicate-Target, $partial-predicate-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: partial predicate removed right before secondary index when not dropping relation + from: partial-predicate-Node + kind: SameStagePrecedence + to: index-Node + query: + - $partial-predicate[Type] = '*scpb.SecondaryIndexPartial' + - descriptorIsNotBeingDropped-25.1($partial-predicate) + - $index[Type] = '*scpb.SecondaryIndex' + - joinOnIndexID($partial-predicate, $index, $table-id, $index-id) + - $partial-predicate-Target[TargetStatus] = TRANSIENT_ABSENT + - $partial-predicate-Node[CurrentStatus] = TRANSIENT_ABSENT + - $index-Target[TargetStatus] = ABSENT + - $index-Node[CurrentStatus] = ABSENT + - joinTargetNode($partial-predicate, $partial-predicate-Target, $partial-predicate-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: partial predicate removed right before secondary index when not dropping relation + from: partial-predicate-Node + kind: SameStagePrecedence + to: index-Node + query: + - $partial-predicate[Type] = '*scpb.SecondaryIndexPartial' + - descriptorIsNotBeingDropped-25.1($partial-predicate) + - $index[Type] = '*scpb.SecondaryIndex' + - joinOnIndexID($partial-predicate, $index, $table-id, $index-id) + - $partial-predicate-Target[TargetStatus] = ABSENT + - $partial-predicate-Node[CurrentStatus] = ABSENT + - $index-Target[TargetStatus] = TRANSIENT_ABSENT + - $index-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($partial-predicate, $partial-predicate-Target, $partial-predicate-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: primary index named right before index becomes public + from: index-name-Node + kind: SameStagePrecedence + to: index-Node + query: + - $index-name[Type] = '*scpb.IndexName' + - $index[Type] = '*scpb.PrimaryIndex' + - joinOnIndexID($index-name, $index, $table-id, $index-id) + - ToPublicOrTransient($index-name-Target, $index-Target) + - $index-name-Node[CurrentStatus] = PUBLIC + - $index-Node[CurrentStatus] = PUBLIC + - joinTargetNode($index-name, $index-name-Target, $index-name-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: primary index swap + from: old-index-Node + kind: SameStagePrecedence + to: new-index-Node + query: + - $old-index[Type] = '*scpb.PrimaryIndex' + - $new-index[Type] = '*scpb.PrimaryIndex' + - joinOnDescID($old-index, $new-index, $table-id) + - $old-index[IndexID] = $old-index-id + - $new-index[SourceIndexID] = $old-index-id + - $old-index-Target[TargetStatus] = ABSENT + - $old-index-Node[CurrentStatus] = VALIDATED + - $new-index-Target[TargetStatus] IN [PUBLIC, TRANSIENT_ABSENT] + - $new-index-Node[CurrentStatus] = PUBLIC + - joinTargetNode($old-index, $old-index-Target, $old-index-Node) + - joinTargetNode($new-index, $new-index-Target, $new-index-Node) +- name: primary index swap + from: old-index-Node + kind: SameStagePrecedence + to: new-index-Node + query: + - $old-index[Type] = '*scpb.PrimaryIndex' + - $new-index[Type] = '*scpb.PrimaryIndex' + - joinOnDescID($old-index, $new-index, $table-id) + - $old-index[IndexID] = $old-index-id + - $new-index[SourceIndexID] = $old-index-id + - $old-index-Target[TargetStatus] = TRANSIENT_ABSENT + - $old-index-Node[CurrentStatus] = TRANSIENT_VALIDATED + - $new-index-Target[TargetStatus] IN [PUBLIC, TRANSIENT_ABSENT] + - $new-index-Node[CurrentStatus] = PUBLIC + - joinTargetNode($old-index, $old-index-Target, $old-index-Node) + - joinTargetNode($new-index, $new-index-Target, $new-index-Node) +- name: primary index swap + from: new-index-Node + kind: SameStagePrecedence + to: old-index-Node + query: + - $new-index[Type] = '*scpb.PrimaryIndex' + - $old-index[Type] = '*scpb.PrimaryIndex' + - joinOnDescID($new-index, $old-index, $table-id) + - $new-index[SourceIndexID] = $old-index-id + - $old-index[IndexID] = $old-index-id + - $new-index-Target[TargetStatus] = ABSENT + - $new-index-Node[CurrentStatus] = VALIDATED + - $old-index-Target[TargetStatus] = PUBLIC + - $old-index-Node[CurrentStatus] = PUBLIC + - joinTargetNode($new-index, $new-index-Target, $new-index-Node) + - joinTargetNode($old-index, $old-index-Target, $old-index-Node) +- name: primary index with new columns should exist before secondary indexes + from: primary-index-Node + kind: Precedence + to: secondary-index-Node + query: + - $primary-index[Type] = '*scpb.PrimaryIndex' + - $secondary-index[Type] = '*scpb.SecondaryIndex' + - joinOnDescID($primary-index, $secondary-index, $table-id) + - $primary-index[IndexID] = $primary-index-id + - $secondary-index[SourceIndexID] = $primary-index-id + - ToPublicOrTransient($primary-index-Target, $secondary-index-Target) + - $primary-index-Node[CurrentStatus] = PUBLIC + - $secondary-index-Node[CurrentStatus] = BACKFILL_ONLY + - joinTargetNode($primary-index, $primary-index-Target, $primary-index-Node) + - joinTargetNode($secondary-index, $secondary-index-Target, $secondary-index-Node) +- name: primary index with new columns should exist before temp indexes + from: primary-index-Node + kind: Precedence + to: temp-index-Node + query: + - $primary-index[Type] = '*scpb.PrimaryIndex' + - $temp-index[Type] = '*scpb.TemporaryIndex' + - joinOnDescID($primary-index, $temp-index, $table-id) + - $primary-index[IndexID] = $primary-index-id + - $temp-index[SourceIndexID] = $primary-index-id + - ToPublicOrTransient($primary-index-Target, $temp-index-Target) + - $primary-index-Node[CurrentStatus] = PUBLIC + - $temp-index-Node[CurrentStatus] = DELETE_ONLY + - joinTargetNode($primary-index, $primary-index-Target, $primary-index-Node) + - joinTargetNode($temp-index, $temp-index-Target, $temp-index-Node) +- name: relation dropped before dependent column + from: descriptor-Node + kind: Precedence + to: column-Node + query: + - $descriptor[Type] IN ['*scpb.Table', '*scpb.View', '*scpb.Sequence'] + - $column[Type] = '*scpb.Column' + - joinOnDescID($descriptor, $column, $desc-id) + - toAbsent($descriptor-Target, $column-Target) + - $descriptor-Node[CurrentStatus] = DROPPED + - $column-Node[CurrentStatus] = WRITE_ONLY + - joinTargetNode($descriptor, $descriptor-Target, $descriptor-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: relation dropped before dependent constraint + from: descriptor-Node + kind: Precedence + to: constraint-Node + query: + - $descriptor[Type] = '*scpb.Table' + - $constraint[Type] = '*scpb.ColumnNotNull' + - joinOnDescID($descriptor, $constraint, $desc-id) + - toAbsent($descriptor-Target, $constraint-Target) + - $descriptor-Node[CurrentStatus] = DROPPED + - $constraint-Node[CurrentStatus] = VALIDATED + - joinTargetNode($descriptor, $descriptor-Target, $descriptor-Node) + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) +- name: relation dropped before dependent index + from: descriptor-Node + kind: Precedence + to: index-Node + query: + - $descriptor[Type] IN ['*scpb.Table', '*scpb.View'] + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - joinOnDescID($descriptor, $index, $desc-id) + - toAbsent($descriptor-Target, $index-Target) + - $descriptor-Node[CurrentStatus] = DROPPED + - $index-Node[CurrentStatus] = VALIDATED + - joinTargetNode($descriptor, $descriptor-Target, $descriptor-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: remove columns from index right before removing index + from: index-column-Node + kind: Precedence + to: index-Node + query: + - $index-column[Type] = '*scpb.IndexColumn' + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - joinOnIndexID($index-column, $index, $table-id, $index-id) + - toAbsent($index-column-Target, $index-Target) + - $index-column-Node[CurrentStatus] = DELETE_ONLY + - $index-Node[CurrentStatus] = ABSENT + - joinTargetNode($index-column, $index-column-Target, $index-column-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: remove columns from index right before removing index + from: index-column-Node + kind: Precedence + to: index-Node + query: + - $index-column[Type] = '*scpb.IndexColumn' + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - joinOnIndexID($index-column, $index, $table-id, $index-id) + - transient($index-column-Target, $index-Target) + - $index-column-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - $index-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($index-column, $index-column-Target, $index-column-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: remove columns from index right before removing index + from: index-column-Node + kind: Precedence + to: index-Node + query: + - $index-column[Type] = '*scpb.IndexColumn' + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - joinOnIndexID($index-column, $index, $table-id, $index-id) + - $index-column-Target[TargetStatus] = TRANSIENT_ABSENT + - $index-column-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - $index-Target[TargetStatus] = ABSENT + - $index-Node[CurrentStatus] = ABSENT + - joinTargetNode($index-column, $index-column-Target, $index-column-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: remove columns from index right before removing index + from: index-column-Node + kind: Precedence + to: index-Node + query: + - $index-column[Type] = '*scpb.IndexColumn' + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - joinOnIndexID($index-column, $index, $table-id, $index-id) + - $index-column-Target[TargetStatus] = ABSENT + - $index-column-Node[CurrentStatus] = DELETE_ONLY + - $index-Target[TargetStatus] = TRANSIENT_ABSENT + - $index-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($index-column, $index-column-Target, $index-column-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: replacement secondary index should be validated before the old one becomes invisible + from: new-index-Node + kind: Precedence + to: old-index-Node + query: + - $old-index[Type] = '*scpb.SecondaryIndex' + - $new-index[Type] = '*scpb.SecondaryIndex' + - $old-index-Target[TargetStatus] = ABSENT + - $new-index-Target[TargetStatus] IN [PUBLIC, TRANSIENT_ABSENT] + - joinOnDescID($old-index, $new-index, $table-id) + - $new-index[IndexID] = $index-id + - $old-index[IndexID] = $old-index-id + - $new-index[RecreateSourceIndexID] = $old-index-id + - joinTargetNode($old-index, $old-index-Target, $old-index-Node) + - joinTargetNode($new-index, $new-index-Target, $new-index-Node) + - $new-index-Node[CurrentStatus] = PUBLIC + - $old-index-Node[CurrentStatus] = VALIDATED + - joinTargetNode($new-index, $new-index-Target, $new-index-Node) + - joinTargetNode($old-index, $old-index-Target, $old-index-Node) +- name: schedule all GC jobs for a descriptor in the same stage + from: data-a-Node + kind: SameStagePrecedence + to: data-b-Node + query: + - $data-a[Type] IN ['*scpb.DatabaseData', '*scpb.IndexData', '*scpb.TableData'] + - $data-b[Type] IN ['*scpb.DatabaseData', '*scpb.IndexData', '*scpb.TableData'] + - joinOnDescID($data-a, $data-b, $desc-id) + - SmallerIDsFirst(scpb.Element, scpb.Element)($data-a, $data-b) + - toAbsent($data-a-Target, $data-b-Target) + - $data-a-Node[CurrentStatus] = DROPPED + - $data-b-Node[CurrentStatus] = DROPPED + - joinTargetNode($data-a, $data-a-Target, $data-a-Node) + - joinTargetNode($data-b, $data-b-Target, $data-b-Node) +- name: schedule all GC jobs for a descriptor in the same stage + from: data-a-Node + kind: SameStagePrecedence + to: data-b-Node + query: + - $data-a[Type] IN ['*scpb.DatabaseData', '*scpb.IndexData', '*scpb.TableData'] + - $data-b[Type] IN ['*scpb.DatabaseData', '*scpb.IndexData', '*scpb.TableData'] + - joinOnDescID($data-a, $data-b, $desc-id) + - SmallerIDsFirst(scpb.Element, scpb.Element)($data-a, $data-b) + - transient($data-a-Target, $data-b-Target) + - $data-a-Node[CurrentStatus] = TRANSIENT_DROPPED + - $data-b-Node[CurrentStatus] = TRANSIENT_DROPPED + - joinTargetNode($data-a, $data-a-Target, $data-a-Node) + - joinTargetNode($data-b, $data-b-Target, $data-b-Node) +- name: schedule all GC jobs for a descriptor in the same stage + from: data-a-Node + kind: SameStagePrecedence + to: data-b-Node + query: + - $data-a[Type] IN ['*scpb.DatabaseData', '*scpb.IndexData', '*scpb.TableData'] + - $data-b[Type] IN ['*scpb.DatabaseData', '*scpb.IndexData', '*scpb.TableData'] + - joinOnDescID($data-a, $data-b, $desc-id) + - SmallerIDsFirst(scpb.Element, scpb.Element)($data-a, $data-b) + - $data-a-Target[TargetStatus] = TRANSIENT_ABSENT + - $data-a-Node[CurrentStatus] = TRANSIENT_DROPPED + - $data-b-Target[TargetStatus] = ABSENT + - $data-b-Node[CurrentStatus] = DROPPED + - joinTargetNode($data-a, $data-a-Target, $data-a-Node) + - joinTargetNode($data-b, $data-b-Target, $data-b-Node) +- name: schedule all GC jobs for a descriptor in the same stage + from: data-a-Node + kind: SameStagePrecedence + to: data-b-Node + query: + - $data-a[Type] IN ['*scpb.DatabaseData', '*scpb.IndexData', '*scpb.TableData'] + - $data-b[Type] IN ['*scpb.DatabaseData', '*scpb.IndexData', '*scpb.TableData'] + - joinOnDescID($data-a, $data-b, $desc-id) + - SmallerIDsFirst(scpb.Element, scpb.Element)($data-a, $data-b) + - $data-a-Target[TargetStatus] = ABSENT + - $data-a-Node[CurrentStatus] = DROPPED + - $data-b-Target[TargetStatus] = TRANSIENT_ABSENT + - $data-b-Node[CurrentStatus] = TRANSIENT_DROPPED + - joinTargetNode($data-a, $data-a-Target, $data-a-Node) + - joinTargetNode($data-b, $data-b-Target, $data-b-Node) +- name: secondary index named before public (with index swap) + from: index-Node + kind: Precedence + to: index-name-Node + query: + - $index-name[Type] = '*scpb.IndexName' + - $index[Type] = '*scpb.SecondaryIndex' + - joinOnIndexID($index, $index-name, $table-id, $index-id) + - ToPublicOrTransient($index-Target, $index-name-Target) + - $index-Node[CurrentStatus] = VALIDATED + - $index-name-Node[CurrentStatus] = PUBLIC + - $old-index[Type] = '*scpb.SecondaryIndex' + - $new-index[Type] = '*scpb.SecondaryIndex' + - $old-index-Target[TargetStatus] = ABSENT + - $new-index-Target[TargetStatus] IN [PUBLIC, TRANSIENT_ABSENT] + - joinOnDescID($old-index, $new-index, $table-id) + - $new-index[IndexID] = $index-id + - $old-index[IndexID] = $old-index-id + - $new-index[RecreateSourceIndexID] = $old-index-id + - joinTargetNode($old-index, $old-index-Target, $old-index-Node) + - joinTargetNode($new-index, $new-index-Target, $new-index-Node) + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($index-name, $index-name-Target, $index-name-Node) +- name: secondary index named before validation (without index swap) + from: index-name-Node + kind: Precedence + to: index-Node + query: + - $index-name[Type] = '*scpb.IndexName' + - $index[Type] = '*scpb.SecondaryIndex' + - joinOnIndexID($index-name, $index, $table-id, $index-id) + - no secondary index swap is on going($table-id, $index-id) + - ToPublicOrTransient($index-name-Target, $index-Target) + - $index-name-Node[CurrentStatus] = PUBLIC + - $index-Node[CurrentStatus] = VALIDATED + - joinTargetNode($index-name, $index-name-Target, $index-name-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: secondary index partial no longer public before referenced column + from: secondary-partial-index-Node + kind: Precedence + to: column-Node + query: + - $secondary-partial-index[Type] = '*scpb.SecondaryIndex' + - $column[Type] = '*scpb.Column' + - joinOnDescID($secondary-partial-index, $column, $table-id) + - descriptorIsNotBeingDropped-25.1($secondary-partial-index) + - secondaryIndexReferencesColumn(*scpb.SecondaryIndex, *scpb.Column)($secondary-partial-index, $column) + - toAbsent($secondary-partial-index-Target, $column-Target) + - $secondary-partial-index-Node[CurrentStatus] = DELETE_ONLY + - $column-Node[CurrentStatus] = WRITE_ONLY + - joinTargetNode($secondary-partial-index, $secondary-partial-index-Target, $secondary-partial-index-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: secondary index partial no longer public before referenced column + from: secondary-partial-index-Node + kind: Precedence + to: column-Node + query: + - $secondary-partial-index[Type] = '*scpb.SecondaryIndex' + - $column[Type] = '*scpb.Column' + - joinOnDescID($secondary-partial-index, $column, $table-id) + - descriptorIsNotBeingDropped-25.1($secondary-partial-index) + - secondaryIndexReferencesColumn(*scpb.SecondaryIndex, *scpb.Column)($secondary-partial-index, $column) + - transient($secondary-partial-index-Target, $column-Target) + - $secondary-partial-index-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - $column-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - joinTargetNode($secondary-partial-index, $secondary-partial-index-Target, $secondary-partial-index-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: secondary index partial no longer public before referenced column + from: secondary-partial-index-Node + kind: Precedence + to: column-Node + query: + - $secondary-partial-index[Type] = '*scpb.SecondaryIndex' + - $column[Type] = '*scpb.Column' + - joinOnDescID($secondary-partial-index, $column, $table-id) + - descriptorIsNotBeingDropped-25.1($secondary-partial-index) + - secondaryIndexReferencesColumn(*scpb.SecondaryIndex, *scpb.Column)($secondary-partial-index, $column) + - $secondary-partial-index-Target[TargetStatus] = TRANSIENT_ABSENT + - $secondary-partial-index-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - $column-Target[TargetStatus] = ABSENT + - $column-Node[CurrentStatus] = WRITE_ONLY + - joinTargetNode($secondary-partial-index, $secondary-partial-index-Target, $secondary-partial-index-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: secondary index partial no longer public before referenced column + from: secondary-partial-index-Node + kind: Precedence + to: column-Node + query: + - $secondary-partial-index[Type] = '*scpb.SecondaryIndex' + - $column[Type] = '*scpb.Column' + - joinOnDescID($secondary-partial-index, $column, $table-id) + - descriptorIsNotBeingDropped-25.1($secondary-partial-index) + - secondaryIndexReferencesColumn(*scpb.SecondaryIndex, *scpb.Column)($secondary-partial-index, $column) + - $secondary-partial-index-Target[TargetStatus] = ABSENT + - $secondary-partial-index-Node[CurrentStatus] = DELETE_ONLY + - $column-Target[TargetStatus] = TRANSIENT_ABSENT + - $column-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - joinTargetNode($secondary-partial-index, $secondary-partial-index-Target, $secondary-partial-index-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: secondary index partial no longer public before referenced column + from: secondary-partial-index-Node + kind: Precedence + to: column-Node + query: + - $secondary-partial-index[Type] = '*scpb.SecondaryIndexPartial' + - $column[Type] = '*scpb.Column' + - joinOnDescID($secondary-partial-index, $column, $table-id) + - descriptorIsNotBeingDropped-25.1($secondary-partial-index) + - secondaryIndexReferencesColumn(*scpb.SecondaryIndexPartial, *scpb.Column)($secondary-partial-index, $column) + - toAbsent($secondary-partial-index-Target, $column-Target) + - $secondary-partial-index-Node[CurrentStatus] = ABSENT + - $column-Node[CurrentStatus] = WRITE_ONLY + - joinTargetNode($secondary-partial-index, $secondary-partial-index-Target, $secondary-partial-index-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: secondary index partial no longer public before referenced column + from: secondary-partial-index-Node + kind: Precedence + to: column-Node + query: + - $secondary-partial-index[Type] = '*scpb.SecondaryIndexPartial' + - $column[Type] = '*scpb.Column' + - joinOnDescID($secondary-partial-index, $column, $table-id) + - descriptorIsNotBeingDropped-25.1($secondary-partial-index) + - secondaryIndexReferencesColumn(*scpb.SecondaryIndexPartial, *scpb.Column)($secondary-partial-index, $column) + - transient($secondary-partial-index-Target, $column-Target) + - $secondary-partial-index-Node[CurrentStatus] = TRANSIENT_ABSENT + - $column-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - joinTargetNode($secondary-partial-index, $secondary-partial-index-Target, $secondary-partial-index-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: secondary index partial no longer public before referenced column + from: secondary-partial-index-Node + kind: Precedence + to: column-Node + query: + - $secondary-partial-index[Type] = '*scpb.SecondaryIndexPartial' + - $column[Type] = '*scpb.Column' + - joinOnDescID($secondary-partial-index, $column, $table-id) + - descriptorIsNotBeingDropped-25.1($secondary-partial-index) + - secondaryIndexReferencesColumn(*scpb.SecondaryIndexPartial, *scpb.Column)($secondary-partial-index, $column) + - $secondary-partial-index-Target[TargetStatus] = TRANSIENT_ABSENT + - $secondary-partial-index-Node[CurrentStatus] = TRANSIENT_ABSENT + - $column-Target[TargetStatus] = ABSENT + - $column-Node[CurrentStatus] = WRITE_ONLY + - joinTargetNode($secondary-partial-index, $secondary-partial-index-Target, $secondary-partial-index-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: secondary index partial no longer public before referenced column + from: secondary-partial-index-Node + kind: Precedence + to: column-Node + query: + - $secondary-partial-index[Type] = '*scpb.SecondaryIndexPartial' + - $column[Type] = '*scpb.Column' + - joinOnDescID($secondary-partial-index, $column, $table-id) + - descriptorIsNotBeingDropped-25.1($secondary-partial-index) + - secondaryIndexReferencesColumn(*scpb.SecondaryIndexPartial, *scpb.Column)($secondary-partial-index, $column) + - $secondary-partial-index-Target[TargetStatus] = ABSENT + - $secondary-partial-index-Node[CurrentStatus] = ABSENT + - $column-Target[TargetStatus] = TRANSIENT_ABSENT + - $column-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - joinTargetNode($secondary-partial-index, $secondary-partial-index-Target, $secondary-partial-index-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: secondary index should be validated before dependent view can be absent + from: index-Node + kind: Precedence + to: view-Node + query: + - $index[Type] = '*scpb.SecondaryIndex' + - $view[Type] = '*scpb.View' + - viewReferencesIndex(*scpb.SecondaryIndex, *scpb.View)($index, $view) + - toAbsent($index-Target, $view-Target) + - $index-Node[CurrentStatus] = VALIDATED + - $view-Node[CurrentStatus] = ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($view, $view-Target, $view-Node) +- name: secondary index should be validated before dependent view can be absent + from: index-Node + kind: Precedence + to: view-Node + query: + - $index[Type] = '*scpb.SecondaryIndex' + - $view[Type] = '*scpb.View' + - viewReferencesIndex(*scpb.SecondaryIndex, *scpb.View)($index, $view) + - transient($index-Target, $view-Target) + - $index-Node[CurrentStatus] = TRANSIENT_VALIDATED + - $view-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($view, $view-Target, $view-Node) +- name: secondary index should be validated before dependent view can be absent + from: index-Node + kind: Precedence + to: view-Node + query: + - $index[Type] = '*scpb.SecondaryIndex' + - $view[Type] = '*scpb.View' + - viewReferencesIndex(*scpb.SecondaryIndex, *scpb.View)($index, $view) + - $index-Target[TargetStatus] = TRANSIENT_ABSENT + - $index-Node[CurrentStatus] = TRANSIENT_VALIDATED + - $view-Target[TargetStatus] = ABSENT + - $view-Node[CurrentStatus] = ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($view, $view-Target, $view-Node) +- name: secondary index should be validated before dependent view can be absent + from: index-Node + kind: Precedence + to: view-Node + query: + - $index[Type] = '*scpb.SecondaryIndex' + - $view[Type] = '*scpb.View' + - viewReferencesIndex(*scpb.SecondaryIndex, *scpb.View)($index, $view) + - $index-Target[TargetStatus] = ABSENT + - $index-Node[CurrentStatus] = VALIDATED + - $view-Target[TargetStatus] = TRANSIENT_ABSENT + - $view-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($view, $view-Target, $view-Node) +- name: secondary indexes containing column as key reach write-only before column + from: index-Node + kind: Precedence + to: column-Node + query: + - $index[Type] = '*scpb.SecondaryIndex' + - $column[Type] = '*scpb.Column' + - ColumnInIndex($index-column, $index, $table-id, $column-id, $index-id) + - joinOnColumnID($index-column, $column, $table-id, $column-id) + - toAbsent($index-Target, $column-Target) + - $index-Node[CurrentStatus] = VALIDATED + - $column-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($index-column) + - isIndexKeyColumnKey(*scpb.IndexColumn)($index-column) + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: simple constraint public right before its dependents + from: simple-constraint-Node + kind: SameStagePrecedence + to: dependent-Node + query: + - $simple-constraint[Type] = '*scpb.ColumnNotNull' + - $dependent[Type] IN ['*scpb.ConstraintComment', '*scpb.ConstraintWithoutIndexName'] + - joinOnConstraintID($simple-constraint, $dependent, $table-id, $constraint-id) + - ToPublicOrTransient($simple-constraint-Target, $dependent-Target) + - $simple-constraint-Node[CurrentStatus] = PUBLIC + - $dependent-Node[CurrentStatus] = PUBLIC + - joinTargetNode($simple-constraint, $simple-constraint-Target, $simple-constraint-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: simple constraint visible before name + from: simple-constraint-Node + kind: Precedence + to: constraint-name-Node + query: + - $simple-constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.CheckConstraintUnvalidated', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.UniqueWithoutIndexConstraint', '*scpb.UniqueWithoutIndexConstraintUnvalidated'] + - $constraint-name[Type] = '*scpb.ConstraintWithoutIndexName' + - joinOnConstraintID($simple-constraint, $constraint-name, $table-id, $constraint-id) + - ToPublicOrTransient($simple-constraint-Target, $constraint-name-Target) + - $simple-constraint-Node[CurrentStatus] = WRITE_ONLY + - $constraint-name-Node[CurrentStatus] = PUBLIC + - joinTargetNode($simple-constraint, $simple-constraint-Target, $simple-constraint-Node) + - joinTargetNode($constraint-name, $constraint-name-Target, $constraint-name-Node) +- name: swapped primary index public before column + from: index-Node + kind: Precedence + to: column-Node + query: + - $index[Type] = '*scpb.PrimaryIndex' + - $column[Type] = '*scpb.Column' + - ColumnInSwappedInPrimaryIndex($index-column, $index, $table-id, $column-id, $index-id) + - joinOnColumnID($index-column, $column, $table-id, $column-id) + - ToPublicOrTransient($index-Target, $column-Target) + - $index-Node[CurrentStatus] = PUBLIC + - $column-Node[CurrentStatus] = PUBLIC + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: table added right before data element + from: table-Node + kind: Precedence + to: data-Node + query: + - $table[Type] IN ['*scpb.AliasType', '*scpb.CompositeType', '*scpb.Database', '*scpb.EnumType', '*scpb.Function', '*scpb.Schema', '*scpb.Sequence', '*scpb.Table', '*scpb.View'] + - $data[Type] IN ['*scpb.DatabaseData', '*scpb.IndexData', '*scpb.TableData'] + - joinOnDescID($table, $data, $table-id) + - ToPublicOrTransient($table-Target, $data-Target) + - $table-Node[CurrentStatus] = PUBLIC + - $data-Node[CurrentStatus] = PUBLIC + - joinTargetNode($table, $table-Target, $table-Node) + - joinTargetNode($data, $data-Target, $data-Node) +- name: table removed right before garbage collection + from: table-Node + kind: SameStagePrecedence + to: data-Node + query: + - $table[Type] IN ['*scpb.AliasType', '*scpb.CompositeType', '*scpb.Database', '*scpb.EnumType', '*scpb.Function', '*scpb.Schema', '*scpb.Sequence', '*scpb.Table', '*scpb.View'] + - $data[Type] = '*scpb.TableData' + - joinOnDescID($table, $data, $table-id) + - toAbsent($table-Target, $data-Target) + - $table-Node[CurrentStatus] = ABSENT + - $data-Node[CurrentStatus] = DROPPED + - joinTargetNode($table, $table-Target, $table-Node) + - joinTargetNode($data, $data-Target, $data-Node) +- name: temp index data exists as soon as temp index accepts writes + from: temp-index-Node + kind: SameStagePrecedence + to: temp-index-data-Node + query: + - $temp-index[Type] = '*scpb.TemporaryIndex' + - $temp-index-data[Type] = '*scpb.IndexData' + - joinOnIndexID($temp-index, $temp-index-data, $table-id, $index-id) + - ToPublicOrTransient($temp-index-Target, $temp-index-data-Target) + - $temp-index-Node[CurrentStatus] = WRITE_ONLY + - $temp-index-data-Node[CurrentStatus] = PUBLIC + - joinTargetNode($temp-index, $temp-index-Target, $temp-index-Node) + - joinTargetNode($temp-index-data, $temp-index-data-Target, $temp-index-data-Node) +- name: temp index disappeared before its master index reaches WRITE_ONLY + from: temp-Node + kind: Precedence + to: index-Node + query: + - $temp[Type] = '*scpb.TemporaryIndex' + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex'] + - joinOnDescID($temp, $index, $table-id) + - $temp[IndexID] = $temp-index-id + - $index[TemporaryIndexID] = $temp-index-id + - $temp-Target[TargetStatus] = TRANSIENT_ABSENT + - $temp-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - $index-Target[TargetStatus] IN [PUBLIC, TRANSIENT_ABSENT] + - $index-Node[CurrentStatus] = WRITE_ONLY + - joinTargetNode($temp, $temp-Target, $temp-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: temp index existence precedes index dependents + from: index-Node + kind: Precedence + to: dependent-Node + query: + - $index[Type] = '*scpb.TemporaryIndex' + - $dependent[Type] IN ['*scpb.IndexColumn', '*scpb.IndexComment', '*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.IndexZoneConfig', '*scpb.PartitionZoneConfig', '*scpb.SecondaryIndexPartial'] + - joinOnIndexID($index, $dependent, $table-id, $index-id) + - ToPublicOrTransient($index-Target, $dependent-Target) + - $index-Node[CurrentStatus] = DELETE_ONLY + - $dependent-Node[CurrentStatus] = PUBLIC + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: temp index is WRITE_ONLY before backfill + from: temp-Node + kind: Precedence + to: index-Node + query: + - $temp[Type] = '*scpb.TemporaryIndex' + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex'] + - joinOnDescID($temp, $index, $table-id) + - $temp[IndexID] = $temp-index-id + - $index[TemporaryIndexID] = $temp-index-id + - $temp-Target[TargetStatus] = TRANSIENT_ABSENT + - $index-Target[TargetStatus] IN [PUBLIC, TRANSIENT_ABSENT] + - $temp-Node[CurrentStatus] = WRITE_ONLY + - $index-Node[CurrentStatus] = BACKFILLED + - joinTargetNode($temp, $temp-Target, $temp-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: trigger public before its dependents + from: trigger-Node + kind: Precedence + to: dependent-Node + query: + - $trigger[Type] = '*scpb.Trigger' + - $dependent[Type] IN ['*scpb.TriggerDeps', '*scpb.TriggerEnabled', '*scpb.TriggerEvents', '*scpb.TriggerFunctionCall', '*scpb.TriggerName', '*scpb.TriggerTiming', '*scpb.TriggerTransition', '*scpb.TriggerWhen'] + - joinOnTriggerID($trigger, $dependent, $table-id, $trigger-id) + - ToPublicOrTransient($trigger-Target, $dependent-Target) + - $trigger-Node[CurrentStatus] = PUBLIC + - $dependent-Node[CurrentStatus] = PUBLIC + - joinTargetNode($trigger, $trigger-Target, $trigger-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: trigger removed before dependents + from: trigger-Node + kind: Precedence + to: dependents-Node + query: + - $dependents[Type] = '*scpb.Trigger' + - $trigger[Type] IN ['*scpb.TriggerDeps', '*scpb.TriggerEnabled', '*scpb.TriggerEvents', '*scpb.TriggerFunctionCall', '*scpb.TriggerName', '*scpb.TriggerTiming', '*scpb.TriggerTransition', '*scpb.TriggerWhen'] + - joinOnTriggerID($trigger, $dependents, $table-id, $trigger-id) + - toAbsent($trigger-Target, $dependents-Target) + - $trigger-Node[CurrentStatus] = ABSENT + - $dependents-Node[CurrentStatus] = PUBLIC + - joinTargetNode($trigger, $trigger-Target, $trigger-Node) + - joinTargetNode($dependents, $dependents-Target, $dependents-Node) +- name: trigger removed before dependents + from: trigger-Node + kind: Precedence + to: dependents-Node + query: + - $dependents[Type] = '*scpb.Trigger' + - $trigger[Type] IN ['*scpb.TriggerDeps', '*scpb.TriggerEnabled', '*scpb.TriggerEvents', '*scpb.TriggerFunctionCall', '*scpb.TriggerName', '*scpb.TriggerTiming', '*scpb.TriggerTransition', '*scpb.TriggerWhen'] + - joinOnTriggerID($trigger, $dependents, $table-id, $trigger-id) + - transient($trigger-Target, $dependents-Target) + - $trigger-Node[CurrentStatus] = TRANSIENT_ABSENT + - $dependents-Node[CurrentStatus] = TRANSIENT_PUBLIC + - joinTargetNode($trigger, $trigger-Target, $trigger-Node) + - joinTargetNode($dependents, $dependents-Target, $dependents-Node) +- name: trigger removed before dependents + from: trigger-Node + kind: Precedence + to: dependents-Node + query: + - $dependents[Type] = '*scpb.Trigger' + - $trigger[Type] IN ['*scpb.TriggerDeps', '*scpb.TriggerEnabled', '*scpb.TriggerEvents', '*scpb.TriggerFunctionCall', '*scpb.TriggerName', '*scpb.TriggerTiming', '*scpb.TriggerTransition', '*scpb.TriggerWhen'] + - joinOnTriggerID($trigger, $dependents, $table-id, $trigger-id) + - $trigger-Target[TargetStatus] = TRANSIENT_ABSENT + - $trigger-Node[CurrentStatus] = TRANSIENT_ABSENT + - $dependents-Target[TargetStatus] = ABSENT + - $dependents-Node[CurrentStatus] = PUBLIC + - joinTargetNode($trigger, $trigger-Target, $trigger-Node) + - joinTargetNode($dependents, $dependents-Target, $dependents-Node) +- name: trigger removed before dependents + from: trigger-Node + kind: Precedence + to: dependents-Node + query: + - $dependents[Type] = '*scpb.Trigger' + - $trigger[Type] IN ['*scpb.TriggerDeps', '*scpb.TriggerEnabled', '*scpb.TriggerEvents', '*scpb.TriggerFunctionCall', '*scpb.TriggerName', '*scpb.TriggerTiming', '*scpb.TriggerTransition', '*scpb.TriggerWhen'] + - joinOnTriggerID($trigger, $dependents, $table-id, $trigger-id) + - $trigger-Target[TargetStatus] = ABSENT + - $trigger-Node[CurrentStatus] = ABSENT + - $dependents-Target[TargetStatus] = TRANSIENT_ABSENT + - $dependents-Node[CurrentStatus] = TRANSIENT_PUBLIC + - joinTargetNode($trigger, $trigger-Target, $trigger-Node) + - joinTargetNode($dependents, $dependents-Target, $dependents-Node) + +deprules +---- +- name: 'CheckConstraint transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.CheckConstraint' + - $next[Type] = '*scpb.CheckConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = PUBLIC + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'CheckConstraint transitions to ABSENT uphold 2-version invariant: TRANSIENT_ABSENT->ABSENT' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.CheckConstraint' + - $next[Type] = '*scpb.CheckConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_ABSENT + - $next-Node[CurrentStatus] = ABSENT + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'CheckConstraint transitions to ABSENT uphold 2-version invariant: TRANSIENT_VALIDATED->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.CheckConstraint' + - $next[Type] = '*scpb.CheckConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_VALIDATED + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'CheckConstraint transitions to ABSENT uphold 2-version invariant: TRANSIENT_WRITE_ONLY->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.CheckConstraint' + - $next[Type] = '*scpb.CheckConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'CheckConstraint transitions to ABSENT uphold 2-version invariant: VALIDATED->ABSENT' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.CheckConstraint' + - $next[Type] = '*scpb.CheckConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = VALIDATED + - $next-Node[CurrentStatus] = ABSENT + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - nodeNotExistsWithStatusIn_TRANSIENT_VALIDATED_WRITE_ONLY_TRANSIENT_WRITE_ONLY($prev-Target) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'CheckConstraint transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.CheckConstraint' + - $next[Type] = '*scpb.CheckConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = WRITE_ONLY + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'CheckConstraint transitions to PUBLIC uphold 2-version invariant: ABSENT->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.CheckConstraint' + - $next[Type] = '*scpb.CheckConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = ABSENT + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'CheckConstraint transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.CheckConstraint' + - $next[Type] = '*scpb.CheckConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = VALIDATED + - $next-Node[CurrentStatus] = PUBLIC + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'CheckConstraint transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.CheckConstraint' + - $next[Type] = '*scpb.CheckConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = WRITE_ONLY + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'CheckConstraint transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.CheckConstraint' + - $next[Type] = '*scpb.CheckConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = ABSENT + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'CheckConstraint transitions to TRANSIENT_ABSENT uphold 2-version invariant: PUBLIC->TRANSIENT_VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.CheckConstraint' + - $next[Type] = '*scpb.CheckConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = PUBLIC + - $next-Node[CurrentStatus] = TRANSIENT_VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'CheckConstraint transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_VALIDATED->TRANSIENT_ABSENT' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.CheckConstraint' + - $next[Type] = '*scpb.CheckConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_VALIDATED + - $next-Node[CurrentStatus] = TRANSIENT_ABSENT + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - nodeNotExistsWithStatusIn_TRANSIENT_WRITE_ONLY($prev-Target) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'CheckConstraint transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_WRITE_ONLY->TRANSIENT_VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.CheckConstraint' + - $next[Type] = '*scpb.CheckConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - $next-Node[CurrentStatus] = TRANSIENT_VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'CheckConstraint transitions to TRANSIENT_ABSENT uphold 2-version invariant: VALIDATED->PUBLIC' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.CheckConstraint' + - $next[Type] = '*scpb.CheckConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = VALIDATED + - $next-Node[CurrentStatus] = PUBLIC + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'CheckConstraint transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.CheckConstraint' + - $next[Type] = '*scpb.CheckConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = WRITE_ONLY + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'Column transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.Column' + - $next[Type] = '*scpb.Column' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = DELETE_ONLY + - $next-Node[CurrentStatus] = ABSENT + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'Column transitions to ABSENT uphold 2-version invariant: PUBLIC->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.Column' + - $next[Type] = '*scpb.Column' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = PUBLIC + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'Column transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.Column' + - $next[Type] = '*scpb.Column' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = WRITE_ONLY + - $next-Node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'Column transitions to PUBLIC uphold 2-version invariant: ABSENT->DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.Column' + - $next[Type] = '*scpb.Column' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = ABSENT + - $next-Node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'Column transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.Column' + - $next[Type] = '*scpb.Column' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = DELETE_ONLY + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'Column transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->PUBLIC' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.Column' + - $next[Type] = '*scpb.Column' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = WRITE_ONLY + - $next-Node[CurrentStatus] = PUBLIC + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'ColumnNotNull transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.ColumnNotNull' + - $next[Type] = '*scpb.ColumnNotNull' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = PUBLIC + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'ColumnNotNull transitions to ABSENT uphold 2-version invariant: VALIDATED->ABSENT' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.ColumnNotNull' + - $next[Type] = '*scpb.ColumnNotNull' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = VALIDATED + - $next-Node[CurrentStatus] = ABSENT + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - nodeNotExistsWithStatusIn_WRITE_ONLY($prev-Target) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'ColumnNotNull transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.ColumnNotNull' + - $next[Type] = '*scpb.ColumnNotNull' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = WRITE_ONLY + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'ColumnNotNull transitions to PUBLIC uphold 2-version invariant: ABSENT->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.ColumnNotNull' + - $next[Type] = '*scpb.ColumnNotNull' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = ABSENT + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'ColumnNotNull transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.ColumnNotNull' + - $next[Type] = '*scpb.ColumnNotNull' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = VALIDATED + - $next-Node[CurrentStatus] = PUBLIC + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'ColumnNotNull transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.ColumnNotNull' + - $next[Type] = '*scpb.ColumnNotNull' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = WRITE_ONLY + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: Computed column expression is dropped before the column it depends on + from: column-expr-Node + kind: Precedence + to: column-Node + query: + - $column-expr[Type] = '*scpb.ColumnComputeExpression' + - $column[Type] = '*scpb.Column' + - joinOnDescID($column-expr, $column, $table-id) + - computedColumnTypeReferencesColumn(*scpb.ColumnComputeExpression, *scpb.Column)($column-expr, $column) + - toAbsent($column-expr-Target, $column-Target) + - $column-expr-Node[CurrentStatus] = ABSENT + - $column-Node[CurrentStatus] = WRITE_ONLY + - joinTargetNode($column-expr, $column-expr-Target, $column-expr-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: Computed column expression is dropped before the column it depends on + from: column-expr-Node + kind: Precedence + to: column-Node + query: + - $column-expr[Type] = '*scpb.ColumnComputeExpression' + - $column[Type] = '*scpb.Column' + - joinOnDescID($column-expr, $column, $table-id) + - computedColumnTypeReferencesColumn(*scpb.ColumnComputeExpression, *scpb.Column)($column-expr, $column) + - transient($column-expr-Target, $column-Target) + - $column-expr-Node[CurrentStatus] = TRANSIENT_ABSENT + - $column-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - joinTargetNode($column-expr, $column-expr-Target, $column-expr-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: Computed column expression is dropped before the column it depends on + from: column-expr-Node + kind: Precedence + to: column-Node + query: + - $column-expr[Type] = '*scpb.ColumnComputeExpression' + - $column[Type] = '*scpb.Column' + - joinOnDescID($column-expr, $column, $table-id) + - computedColumnTypeReferencesColumn(*scpb.ColumnComputeExpression, *scpb.Column)($column-expr, $column) + - $column-expr-Target[TargetStatus] = TRANSIENT_ABSENT + - $column-expr-Node[CurrentStatus] = TRANSIENT_ABSENT + - $column-Target[TargetStatus] = ABSENT + - $column-Node[CurrentStatus] = WRITE_ONLY + - joinTargetNode($column-expr, $column-expr-Target, $column-expr-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: Computed column expression is dropped before the column it depends on + from: column-expr-Node + kind: Precedence + to: column-Node + query: + - $column-expr[Type] = '*scpb.ColumnComputeExpression' + - $column[Type] = '*scpb.Column' + - joinOnDescID($column-expr, $column, $table-id) + - computedColumnTypeReferencesColumn(*scpb.ColumnComputeExpression, *scpb.Column)($column-expr, $column) + - $column-expr-Target[TargetStatus] = ABSENT + - $column-expr-Node[CurrentStatus] = ABSENT + - $column-Target[TargetStatus] = TRANSIENT_ABSENT + - $column-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - joinTargetNode($column-expr, $column-expr-Target, $column-expr-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: Constraint should be hidden before name + from: constraint-name-Node + kind: Precedence + to: constraint-Node + query: + - $constraint-name[Type] = '*scpb.ConstraintWithoutIndexName' + - $constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.CheckConstraintUnvalidated', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.UniqueWithoutIndexConstraint', '*scpb.UniqueWithoutIndexConstraintUnvalidated'] + - joinOnConstraintID($constraint-name, $constraint, $table-id, $constraint-id) + - toAbsent($constraint-name-Target, $constraint-Target) + - $constraint-name-Node[CurrentStatus] = ABSENT + - $constraint-Node[CurrentStatus] = ABSENT + - joinTargetNode($constraint-name, $constraint-name-Target, $constraint-name-Node) + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) +- name: Constraint should be hidden before name + from: constraint-name-Node + kind: Precedence + to: constraint-Node + query: + - $constraint-name[Type] = '*scpb.ConstraintWithoutIndexName' + - $constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.CheckConstraintUnvalidated', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.UniqueWithoutIndexConstraint', '*scpb.UniqueWithoutIndexConstraintUnvalidated'] + - joinOnConstraintID($constraint-name, $constraint, $table-id, $constraint-id) + - transient($constraint-name-Target, $constraint-Target) + - $constraint-name-Node[CurrentStatus] = TRANSIENT_ABSENT + - $constraint-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($constraint-name, $constraint-name-Target, $constraint-name-Node) + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) +- name: Constraint should be hidden before name + from: constraint-name-Node + kind: Precedence + to: constraint-Node + query: + - $constraint-name[Type] = '*scpb.ConstraintWithoutIndexName' + - $constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.CheckConstraintUnvalidated', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.UniqueWithoutIndexConstraint', '*scpb.UniqueWithoutIndexConstraintUnvalidated'] + - joinOnConstraintID($constraint-name, $constraint, $table-id, $constraint-id) + - $constraint-name-Target[TargetStatus] = TRANSIENT_ABSENT + - $constraint-name-Node[CurrentStatus] = TRANSIENT_ABSENT + - $constraint-Target[TargetStatus] = ABSENT + - $constraint-Node[CurrentStatus] = ABSENT + - joinTargetNode($constraint-name, $constraint-name-Target, $constraint-name-Node) + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) +- name: Constraint should be hidden before name + from: constraint-name-Node + kind: Precedence + to: constraint-Node + query: + - $constraint-name[Type] = '*scpb.ConstraintWithoutIndexName' + - $constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.CheckConstraintUnvalidated', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.UniqueWithoutIndexConstraint', '*scpb.UniqueWithoutIndexConstraintUnvalidated'] + - joinOnConstraintID($constraint-name, $constraint, $table-id, $constraint-id) + - $constraint-name-Target[TargetStatus] = ABSENT + - $constraint-name-Node[CurrentStatus] = ABSENT + - $constraint-Target[TargetStatus] = TRANSIENT_ABSENT + - $constraint-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($constraint-name, $constraint-name-Target, $constraint-name-Node) + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) +- name: Constraint should be hidden before name + from: constraint-Node + kind: Precedence + to: constraint-name-Node + query: + - $constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.CheckConstraintUnvalidated', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.UniqueWithoutIndexConstraint', '*scpb.UniqueWithoutIndexConstraintUnvalidated'] + - $constraint-name[Type] = '*scpb.ConstraintWithoutIndexName' + - joinOnConstraintID($constraint, $constraint-name, $table-id, $constraint-id) + - toAbsent($constraint-Target, $constraint-name-Target) + - $constraint-Node[CurrentStatus] = VALIDATED + - $constraint-name-Node[CurrentStatus] = ABSENT + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) + - joinTargetNode($constraint-name, $constraint-name-Target, $constraint-name-Node) +- name: Constraint should be hidden before name + from: constraint-Node + kind: Precedence + to: constraint-name-Node + query: + - $constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.CheckConstraintUnvalidated', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.UniqueWithoutIndexConstraint', '*scpb.UniqueWithoutIndexConstraintUnvalidated'] + - $constraint-name[Type] = '*scpb.ConstraintWithoutIndexName' + - joinOnConstraintID($constraint, $constraint-name, $table-id, $constraint-id) + - transient($constraint-Target, $constraint-name-Target) + - $constraint-Node[CurrentStatus] = TRANSIENT_VALIDATED + - $constraint-name-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) + - joinTargetNode($constraint-name, $constraint-name-Target, $constraint-name-Node) +- name: Constraint should be hidden before name + from: constraint-Node + kind: Precedence + to: constraint-name-Node + query: + - $constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.CheckConstraintUnvalidated', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.UniqueWithoutIndexConstraint', '*scpb.UniqueWithoutIndexConstraintUnvalidated'] + - $constraint-name[Type] = '*scpb.ConstraintWithoutIndexName' + - joinOnConstraintID($constraint, $constraint-name, $table-id, $constraint-id) + - $constraint-Target[TargetStatus] = TRANSIENT_ABSENT + - $constraint-Node[CurrentStatus] = TRANSIENT_VALIDATED + - $constraint-name-Target[TargetStatus] = ABSENT + - $constraint-name-Node[CurrentStatus] = ABSENT + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) + - joinTargetNode($constraint-name, $constraint-name-Target, $constraint-name-Node) +- name: Constraint should be hidden before name + from: constraint-Node + kind: Precedence + to: constraint-name-Node + query: + - $constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.CheckConstraintUnvalidated', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.UniqueWithoutIndexConstraint', '*scpb.UniqueWithoutIndexConstraintUnvalidated'] + - $constraint-name[Type] = '*scpb.ConstraintWithoutIndexName' + - joinOnConstraintID($constraint, $constraint-name, $table-id, $constraint-id) + - $constraint-Target[TargetStatus] = ABSENT + - $constraint-Node[CurrentStatus] = VALIDATED + - $constraint-name-Target[TargetStatus] = TRANSIENT_ABSENT + - $constraint-name-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) + - joinTargetNode($constraint-name, $constraint-name-Target, $constraint-name-Node) +- name: DEFAULT or ON UPDATE existence precedes writes to column, except if they are added as part of a alter column type + from: expr-Node + kind: Precedence + to: column-Node + query: + - $expr[Type] IN ['*scpb.ColumnDefaultExpression', '*scpb.ColumnOnUpdateExpression'] + - $column[Type] = '*scpb.Column' + - joinOnColumnID($expr, $column, $table-id, $col-id) + - no column type alteration in progress($table-id, $col-id) + - ToPublicOrTransient($expr-Target, $column-Target) + - $expr-Node[CurrentStatus] = PUBLIC + - $column-Node[CurrentStatus] = WRITE_ONLY + - joinTargetNode($expr, $expr-Target, $expr-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: DEFAULT or ON UPDATE expressions is public after transient compute expression transitions to absent + from: transient-compute-expression-Node + kind: SameStagePrecedence + to: column-expr-Node + query: + - $transient-compute-expression[Type] = '*scpb.ColumnComputeExpression' + - $column-expr[Type] IN ['*scpb.ColumnDefaultExpression', '*scpb.ColumnOnUpdateExpression'] + - joinOnColumnID($transient-compute-expression, $column-expr, $table-id, $col-id) + - ToPublicOrTransient($transient-compute-expression-Target, $column-expr-Target) + - $transient-compute-expression-Node[CurrentStatus] = TRANSIENT_ABSENT + - $column-expr-Node[CurrentStatus] = PUBLIC + - joinTargetNode($transient-compute-expression, $transient-compute-expression-Target, $transient-compute-expression-Node) + - joinTargetNode($column-expr, $column-expr-Target, $column-expr-Node) +- name: Final compute expression is always added after transient compute expression + from: transient-compute-expression-Node + kind: SameStagePrecedence + to: final-compute-expression-Node + query: + - $transient-compute-expression[Type] = '*scpb.ColumnComputeExpression' + - $final-compute-expression[Type] = '*scpb.ColumnComputeExpression' + - joinOnColumnID($transient-compute-expression, $final-compute-expression, $table-id, $col-id) + - $transient-compute-expression[Usage] = ALTER_TYPE_USING + - $final-compute-expression[Usage] = REGULAR + - ToPublicOrTransient($transient-compute-expression-Target, $final-compute-expression-Target) + - $transient-compute-expression-Node[CurrentStatus] = TRANSIENT_ABSENT + - $final-compute-expression-Node[CurrentStatus] = PUBLIC + - joinTargetNode($transient-compute-expression, $transient-compute-expression-Target, $transient-compute-expression-Node) + - joinTargetNode($final-compute-expression, $final-compute-expression-Target, $final-compute-expression-Node) +- name: 'ForeignKeyConstraint transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.ForeignKeyConstraint' + - $next[Type] = '*scpb.ForeignKeyConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = PUBLIC + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'ForeignKeyConstraint transitions to ABSENT uphold 2-version invariant: VALIDATED->ABSENT' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.ForeignKeyConstraint' + - $next[Type] = '*scpb.ForeignKeyConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = VALIDATED + - $next-Node[CurrentStatus] = ABSENT + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - nodeNotExistsWithStatusIn_WRITE_ONLY($prev-Target) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'ForeignKeyConstraint transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.ForeignKeyConstraint' + - $next[Type] = '*scpb.ForeignKeyConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = WRITE_ONLY + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'ForeignKeyConstraint transitions to PUBLIC uphold 2-version invariant: ABSENT->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.ForeignKeyConstraint' + - $next[Type] = '*scpb.ForeignKeyConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = ABSENT + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'ForeignKeyConstraint transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.ForeignKeyConstraint' + - $next[Type] = '*scpb.ForeignKeyConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = VALIDATED + - $next-Node[CurrentStatus] = PUBLIC + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'ForeignKeyConstraint transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.ForeignKeyConstraint' + - $next[Type] = '*scpb.ForeignKeyConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = WRITE_ONLY + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: New primary index for alter column type should go public in the same stage as dropped column + from: column-Node + kind: SameStagePrecedence + to: new-primary-index-Node + query: + - $column[Type] = '*scpb.Column' + - $new-primary-index[Type] = '*scpb.PrimaryIndex' + - ColumnInSourcePrimaryIndex($index-column, $new-primary-index, $table-id, $old-column-id, $index-id) + - joinOnColumnID($index-column, $column, $table-id, $old-column-id) + - $column-Target[TargetStatus] = ABSENT + - $column-Node[CurrentStatus] = WRITE_ONLY + - $new-primary-index-Target[TargetStatus] = PUBLIC + - $new-primary-index-Node[CurrentStatus] = PUBLIC + - $old-column-name[Type] = '*scpb.ColumnName' + - $new-column-name[Type] = '*scpb.ColumnName' + - joinOnColumnName($old-column-name, $new-column-name, $table-id, $column-name) + - $old-column-name[ColumnID] = $old-column-id + - $old-column-name-Target[TargetStatus] = ABSENT + - $new-column-name-Target[TargetStatus] = PUBLIC + - $compute-expression[Type] = '*scpb.ColumnComputeExpression' + - joinOnColumnID($new-column-name, $compute-expression, $table-id, $new-column-id) + - $compute-expression[Usage] = ALTER_TYPE_USING + - joinTargetNode($old-column-name, $old-column-name-Target, $old-column-name-Node) + - joinTargetNode($new-column-name, $new-column-name-Target, $new-column-name-Node) + - joinTargetNode($compute-expression, $compute-expression-Target, $compute-expression-Node) + - joinTargetNode($column, $column-Target, $column-Node) + - joinTargetNode($new-primary-index, $new-primary-index-Target, $new-primary-index-Node) +- name: New primary index should go public only after columns being dropped move to WRITE_ONLY + from: column-Node + kind: Precedence + to: new-primary-index-Node + query: + - $column[Type] = '*scpb.Column' + - $new-primary-index[Type] = '*scpb.PrimaryIndex' + - ColumnInSourcePrimaryIndex($index-column, $new-primary-index, $table-id, $old-column-id, $index-id) + - joinOnColumnID($index-column, $column, $table-id, $old-column-id) + - $column-Target[TargetStatus] = ABSENT + - $column-Node[CurrentStatus] = WRITE_ONLY + - $new-primary-index-Target[TargetStatus] = PUBLIC + - $new-primary-index-Node[CurrentStatus] = PUBLIC + - dropped column is not part of column type operation($table-id, $old-column-id) + - joinTargetNode($column, $column-Target, $column-Node) + - joinTargetNode($new-primary-index, $new-primary-index-Target, $new-primary-index-Node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILLED->DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = BACKFILLED + - $next-Node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = BACKFILL_ONLY + - $next-Node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = DELETE_ONLY + - $next-Node[CurrentStatus] = ABSENT + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - nodeNotExistsWithStatusIn_TRANSIENT_DELETE_ONLY_BACKFILLED_TRANSIENT_BACKFILLED_BACKFILL_ONLY_TRANSIENT_BACKFILL_ONLY($prev-Target) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: MERGED->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = MERGED + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = MERGE_ONLY + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = PUBLIC + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_ABSENT->ABSENT' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_ABSENT + - $next-Node[CurrentStatus] = ABSENT + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_BACKFILLED->DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_BACKFILLED + - $next-Node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_BACKFILL_ONLY->DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_BACKFILL_ONLY + - $next-Node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - $next-Node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_MERGED->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_MERGED + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_MERGE_ONLY->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_MERGE_ONLY + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_VALIDATED->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_VALIDATED + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_WRITE_ONLY->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = VALIDATED + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - nodeNotExistsWithStatusIn_TRANSIENT_VALIDATED($prev-Target) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = WRITE_ONLY + - $next-Node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - nodeNotExistsWithStatusIn_VALIDATED_TRANSIENT_WRITE_ONLY_MERGE_ONLY_TRANSIENT_MERGE_ONLY_MERGED_TRANSIENT_MERGED($prev-Target) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: ABSENT->BACKFILL_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = ABSENT + - $next-Node[CurrentStatus] = BACKFILL_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILLED->DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = BACKFILLED + - $next-Node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = BACKFILL_ONLY + - $next-Node[CurrentStatus] = BACKFILLED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = DELETE_ONLY + - $next-Node[CurrentStatus] = MERGE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGED->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = MERGED + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: MERGE_ONLY->MERGED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = MERGE_ONLY + - $next-Node[CurrentStatus] = MERGED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = VALIDATED + - $next-Node[CurrentStatus] = PUBLIC + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = WRITE_ONLY + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->BACKFILL_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = ABSENT + - $next-Node[CurrentStatus] = BACKFILL_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: BACKFILLED->DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = BACKFILLED + - $next-Node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = BACKFILL_ONLY + - $next-Node[CurrentStatus] = BACKFILLED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = DELETE_ONLY + - $next-Node[CurrentStatus] = MERGE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: MERGED->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = MERGED + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: MERGE_ONLY->MERGED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = MERGE_ONLY + - $next-Node[CurrentStatus] = MERGED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: PUBLIC->TRANSIENT_VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = PUBLIC + - $next-Node[CurrentStatus] = TRANSIENT_VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_BACKFILLED->TRANSIENT_DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_BACKFILLED + - $next-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_BACKFILL_ONLY->TRANSIENT_DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_BACKFILL_ONLY + - $next-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - $next-Node[CurrentStatus] = TRANSIENT_ABSENT + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - nodeNotExistsWithStatusIn_TRANSIENT_BACKFILLED_TRANSIENT_BACKFILL_ONLY($prev-Target) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_MERGED->TRANSIENT_WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_MERGED + - $next-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_MERGE_ONLY->TRANSIENT_WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_MERGE_ONLY + - $next-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_VALIDATED->TRANSIENT_WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_VALIDATED + - $next-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_WRITE_ONLY->TRANSIENT_DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - $next-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - nodeNotExistsWithStatusIn_TRANSIENT_VALIDATED_TRANSIENT_MERGE_ONLY_TRANSIENT_MERGED($prev-Target) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: VALIDATED->PUBLIC' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = VALIDATED + - $next-Node[CurrentStatus] = PUBLIC + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'PrimaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.PrimaryIndex' + - $next[Type] = '*scpb.PrimaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = WRITE_ONLY + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILLED->DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = BACKFILLED + - $next-Node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: BACKFILL_ONLY->DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = BACKFILL_ONLY + - $next-Node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = DELETE_ONLY + - $next-Node[CurrentStatus] = ABSENT + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - nodeNotExistsWithStatusIn_BACKFILLED_BACKFILL_ONLY($prev-Target) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: MERGED->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = MERGED + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: MERGE_ONLY->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = MERGE_ONLY + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = PUBLIC + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = VALIDATED + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'SecondaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = WRITE_ONLY + - $next-Node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - nodeNotExistsWithStatusIn_VALIDATED_MERGE_ONLY_MERGED($prev-Target) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: ABSENT->BACKFILL_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = ABSENT + - $next-Node[CurrentStatus] = BACKFILL_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILLED->DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = BACKFILLED + - $next-Node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: BACKFILL_ONLY->BACKFILLED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = BACKFILL_ONLY + - $next-Node[CurrentStatus] = BACKFILLED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: DELETE_ONLY->MERGE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = DELETE_ONLY + - $next-Node[CurrentStatus] = MERGE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: MERGED->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = MERGED + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: MERGE_ONLY->MERGED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = MERGE_ONLY + - $next-Node[CurrentStatus] = MERGED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = VALIDATED + - $next-Node[CurrentStatus] = PUBLIC + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'SecondaryIndex transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.SecondaryIndex' + - $next[Type] = '*scpb.SecondaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = WRITE_ONLY + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.TemporaryIndex' + - $next[Type] = '*scpb.TemporaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = DELETE_ONLY + - $next-Node[CurrentStatus] = ABSENT + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - nodeNotExistsWithStatusIn_TRANSIENT_DELETE_ONLY($prev-Target) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'TemporaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_ABSENT->ABSENT' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.TemporaryIndex' + - $next[Type] = '*scpb.TemporaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_ABSENT + - $next-Node[CurrentStatus] = ABSENT + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'TemporaryIndex transitions to ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.TemporaryIndex' + - $next[Type] = '*scpb.TemporaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - $next-Node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.TemporaryIndex' + - $next[Type] = '*scpb.TemporaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = WRITE_ONLY + - $next-Node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: ABSENT->DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.TemporaryIndex' + - $next[Type] = '*scpb.TemporaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = ABSENT + - $next-Node[CurrentStatus] = DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: DELETE_ONLY->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.TemporaryIndex' + - $next[Type] = '*scpb.TemporaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = DELETE_ONLY + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: TRANSIENT_DELETE_ONLY->TRANSIENT_ABSENT' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.TemporaryIndex' + - $next[Type] = '*scpb.TemporaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - $next-Node[CurrentStatus] = TRANSIENT_ABSENT + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'TemporaryIndex transitions to TRANSIENT_ABSENT uphold 2-version invariant: WRITE_ONLY->TRANSIENT_DELETE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.TemporaryIndex' + - $next[Type] = '*scpb.TemporaryIndex' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = TRANSIENT_ABSENT + - $prev-Node[CurrentStatus] = WRITE_ONLY + - $next-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'UniqueWithoutIndexConstraint transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.UniqueWithoutIndexConstraint' + - $next[Type] = '*scpb.UniqueWithoutIndexConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = PUBLIC + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'UniqueWithoutIndexConstraint transitions to ABSENT uphold 2-version invariant: VALIDATED->ABSENT' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.UniqueWithoutIndexConstraint' + - $next[Type] = '*scpb.UniqueWithoutIndexConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = VALIDATED + - $next-Node[CurrentStatus] = ABSENT + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - nodeNotExistsWithStatusIn_WRITE_ONLY($prev-Target) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'UniqueWithoutIndexConstraint transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.UniqueWithoutIndexConstraint' + - $next[Type] = '*scpb.UniqueWithoutIndexConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = ABSENT + - $prev-Node[CurrentStatus] = WRITE_ONLY + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'UniqueWithoutIndexConstraint transitions to PUBLIC uphold 2-version invariant: ABSENT->WRITE_ONLY' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.UniqueWithoutIndexConstraint' + - $next[Type] = '*scpb.UniqueWithoutIndexConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = ABSENT + - $next-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'UniqueWithoutIndexConstraint transitions to PUBLIC uphold 2-version invariant: VALIDATED->PUBLIC' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.UniqueWithoutIndexConstraint' + - $next[Type] = '*scpb.UniqueWithoutIndexConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = VALIDATED + - $next-Node[CurrentStatus] = PUBLIC + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: 'UniqueWithoutIndexConstraint transitions to PUBLIC uphold 2-version invariant: WRITE_ONLY->VALIDATED' + from: prev-Node + kind: PreviousTransactionPrecedence + to: next-Node + query: + - $prev[Type] = '*scpb.UniqueWithoutIndexConstraint' + - $next[Type] = '*scpb.UniqueWithoutIndexConstraint' + - $prev[DescID] = $descID + - $prev[Self] = $next + - $prev-Target[Self] = $next-Target + - $prev-Target[TargetStatus] = PUBLIC + - $prev-Node[CurrentStatus] = WRITE_ONLY + - $next-Node[CurrentStatus] = VALIDATED + - descriptorIsNotBeingDropped-25.1($prev) + - $descriptor-data[Type] = '*scpb.TableData' + - joinTargetNode($descriptor-data, $descriptor-data-Target, $descriptor-data-Node) + - $descriptor-data-Node[CurrentStatus] = PUBLIC + - $descriptor-data[DescID] = $descID + - descriptorIsDataNotBeingAdded-25.1($descID) + - joinTargetNode($prev, $prev-Target, $prev-Node) + - joinTargetNode($next, $next-Target, $next-Node) +- name: adding a transient column compute expression moves to 'absent' after PK validation to ensures it's there for the backfill + from: primary-index-Node + kind: Precedence + to: transient-column-compute-Node + query: + - $primary-index[Type] = '*scpb.PrimaryIndex' + - $transient-column-compute[Type] = '*scpb.ColumnComputeExpression' + - joinOnDescID($primary-index, $transient-column-compute, $table-id) + - $primary-index-Target[TargetStatus] = PUBLIC + - $transient-column-compute-Target[TargetStatus] = TRANSIENT_ABSENT + - $primary-index-Node[CurrentStatus] = VALIDATED + - $transient-column-compute-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($primary-index, $primary-index-Target, $primary-index-Node) + - joinTargetNode($transient-column-compute, $transient-column-compute-Target, $transient-column-compute-Node) +- name: all adding indexes reached BACKFILL_ONLY before any of their columns disappear + from: index-Node + kind: Precedence + to: column-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex'] + - $column[Type] = '*scpb.Column' + - ColumnInIndex($index-column, $index, $table-id, $column-id, $index-id) + - joinOnColumnID($index-column, $column, $table-id, $column-id) + - $index-Target[TargetStatus] IN [PUBLIC, TRANSIENT_ABSENT] + - $index-Node[CurrentStatus] = BACKFILL_ONLY + - $column-Target[TargetStatus] = ABSENT + - $column-Node[CurrentStatus] = WRITE_ONLY + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: back-reference in parent descriptor is removed before parent descriptor is dropped + from: back-reference-in-parent-descriptor-Node + kind: Precedence + to: parent-descriptor-Node + query: + - $back-reference-in-parent-descriptor[Type] IN ['*scpb.SchemaChild', '*scpb.SchemaParent'] + - $parent-descriptor[Type] IN ['*scpb.AliasType', '*scpb.CompositeType', '*scpb.Database', '*scpb.EnumType', '*scpb.Function', '*scpb.Schema', '*scpb.Sequence', '*scpb.Table', '*scpb.View'] + - joinReferencedDescID($back-reference-in-parent-descriptor, $parent-descriptor, $desc-id) + - toAbsent($back-reference-in-parent-descriptor-Target, $parent-descriptor-Target) + - $back-reference-in-parent-descriptor-Node[CurrentStatus] = ABSENT + - $parent-descriptor-Node[CurrentStatus] = DROPPED + - joinTargetNode($back-reference-in-parent-descriptor, $back-reference-in-parent-descriptor-Target, $back-reference-in-parent-descriptor-Node) + - joinTargetNode($parent-descriptor, $parent-descriptor-Target, $parent-descriptor-Node) +- name: column constraint removed right before column reaches write only + from: column-constraint-Node + kind: Precedence + to: column-Node + query: + - $column-constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.UniqueWithoutIndexConstraint'] + - $column[Type] = '*scpb.Column' + - joinOnColumnID($column-constraint, $column, $table-id, $col-id) + - toAbsent($column-constraint-Target, $column-Target) + - $column-constraint-Node[CurrentStatus] = ABSENT + - $column-Node[CurrentStatus] = WRITE_ONLY + - joinTargetNode($column-constraint, $column-constraint-Target, $column-constraint-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: column constraint removed right before column reaches write only + from: column-constraint-Node + kind: Precedence + to: column-Node + query: + - $column-constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.UniqueWithoutIndexConstraint'] + - $column[Type] = '*scpb.Column' + - joinOnColumnID($column-constraint, $column, $table-id, $col-id) + - transient($column-constraint-Target, $column-Target) + - $column-constraint-Node[CurrentStatus] = TRANSIENT_ABSENT + - $column-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - joinTargetNode($column-constraint, $column-constraint-Target, $column-constraint-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: column constraint removed right before column reaches write only + from: column-constraint-Node + kind: Precedence + to: column-Node + query: + - $column-constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.UniqueWithoutIndexConstraint'] + - $column[Type] = '*scpb.Column' + - joinOnColumnID($column-constraint, $column, $table-id, $col-id) + - $column-constraint-Target[TargetStatus] = TRANSIENT_ABSENT + - $column-constraint-Node[CurrentStatus] = TRANSIENT_ABSENT + - $column-Target[TargetStatus] = ABSENT + - $column-Node[CurrentStatus] = WRITE_ONLY + - joinTargetNode($column-constraint, $column-constraint-Target, $column-constraint-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: column constraint removed right before column reaches write only + from: column-constraint-Node + kind: Precedence + to: column-Node + query: + - $column-constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.UniqueWithoutIndexConstraint'] + - $column[Type] = '*scpb.Column' + - joinOnColumnID($column-constraint, $column, $table-id, $col-id) + - $column-constraint-Target[TargetStatus] = ABSENT + - $column-constraint-Node[CurrentStatus] = ABSENT + - $column-Target[TargetStatus] = TRANSIENT_ABSENT + - $column-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - joinTargetNode($column-constraint, $column-constraint-Target, $column-constraint-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: column dependents exist before column becomes public + from: dependent-Node + kind: Precedence + to: column-Node + query: + - $dependent[Type] IN ['*scpb.ColumnComment', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnName', '*scpb.ColumnNotNull', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.IndexColumn', '*scpb.SequenceOwner'] + - $column[Type] = '*scpb.Column' + - joinOnColumnID($dependent, $column, $table-id, $col-id) + - ToPublicOrTransient($dependent-Target, $column-Target) + - $dependent-Node[CurrentStatus] = PUBLIC + - $column-Node[CurrentStatus] = PUBLIC + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: column existence precedes column dependents + from: column-Node + kind: Precedence + to: dependent-Node + query: + - $column[Type] = '*scpb.Column' + - $dependent[Type] IN ['*scpb.ColumnComment', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnName', '*scpb.ColumnNotNull', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.IndexColumn', '*scpb.SequenceOwner'] + - joinOnColumnID($column, $dependent, $table-id, $col-id) + - ToPublicOrTransient($column-Target, $dependent-Target) + - $column-Node[CurrentStatus] = DELETE_ONLY + - $dependent-Node[CurrentStatus] = PUBLIC + - no column type alteration in progress($table-id, $col-id) + - joinTargetNode($column, $column-Target, $column-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: column existence precedes column dependents during an alter column type + from: column-Node + kind: Precedence + to: dependent-Node + query: + - $column[Type] = '*scpb.Column' + - $dependent[Type] IN ['*scpb.ColumnComment', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnNotNull', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.IndexColumn', '*scpb.SequenceOwner'] + - joinOnColumnID($column, $dependent, $table-id, $col-id) + - ToPublicOrTransient($column-Target, $dependent-Target) + - $column-Node[CurrentStatus] = DELETE_ONLY + - $dependent-Node[CurrentStatus] = PUBLIC + - $column[Type] = '*scpb.Column' + - $compute-expression[Type] = '*scpb.ColumnComputeExpression' + - joinOnColumnID($column, $compute-expression, $table-id, $col-id) + - $compute-expression[Usage] = ALTER_TYPE_USING + - joinTargetNode($column, $column-Target, $column-Node) + - joinTargetNode($compute-expression, $compute-expression-Target, $compute-expression-Node) + - joinTargetNode($column, $column-Target, $column-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: column existence precedes index existence + from: column-Node + kind: Precedence + to: index-Node + query: + - $column[Type] = '*scpb.Column' + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex'] + - joinOnColumnID($column, $index-column, $table-id, $column-id) + - ColumnInIndex($index-column, $index, $table-id, $column-id, $index-id) + - ToPublicOrTransient($column-Target, $index-Target) + - $column-Node[CurrentStatus] = DELETE_ONLY + - $index-Node[CurrentStatus] = BACKFILL_ONLY + - joinTargetNode($column, $column-Target, $column-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: column existence precedes temp index existence + from: column-Node + kind: Precedence + to: index-Node + query: + - $column[Type] = '*scpb.Column' + - $index[Type] = '*scpb.TemporaryIndex' + - joinOnColumnID($index-column, $column, $table-id, $column-id) + - ColumnInIndex($index-column, $index, $table-id, $column-id, $index-id) + - ToPublicOrTransient($column-Target, $index-Target) + - $column-Node[CurrentStatus] = DELETE_ONLY + - $index-Node[CurrentStatus] = DELETE_ONLY + - joinTargetNode($column, $column-Target, $column-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: column is WRITE_ONLY before temporary index is WRITE_ONLY + from: column-Node + kind: Precedence + to: index-Node + query: + - $column[Type] = '*scpb.Column' + - $index[Type] = '*scpb.TemporaryIndex' + - joinOnColumnID($index-column, $column, $table-id, $column-id) + - ColumnInIndex($index-column, $index, $table-id, $column-id, $index-id) + - ToPublicOrTransient($column-Target, $index-Target) + - $column-Node[CurrentStatus] = WRITE_ONLY + - $index-Node[CurrentStatus] = WRITE_ONLY + - joinTargetNode($column, $column-Target, $column-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: column name set right after column existence, except for alter column type + from: column-Node + kind: SameStagePrecedence + to: column-name-or-type-Node + query: + - $column[Type] = '*scpb.Column' + - $column-name-or-type[Type] = '*scpb.ColumnName' + - ToPublicOrTransient($column-Target, $column-name-or-type-Target) + - $column-Node[CurrentStatus] = DELETE_ONLY + - $column-name-or-type-Node[CurrentStatus] = PUBLIC + - joinOnColumnID($column, $column-name-or-type, $table-id, $col-id) + - no column type alteration in progress($table-id, $col-id) + - joinTargetNode($column, $column-Target, $column-Node) + - joinTargetNode($column-name-or-type, $column-name-or-type-Target, $column-name-or-type-Node) +- name: column no longer public before dependents + from: column-Node + kind: Precedence + to: dependent-Node + query: + - $column[Type] = '*scpb.Column' + - $dependent[Type] IN ['*scpb.ColumnComment', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnName', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.IndexColumn', '*scpb.SequenceOwner'] + - joinOnColumnID($column, $dependent, $table-id, $col-id) + - toAbsent($column-Target, $dependent-Target) + - $column-Node[CurrentStatus] = WRITE_ONLY + - $dependent-Node[CurrentStatus] = ABSENT + - joinTargetNode($column, $column-Target, $column-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: column no longer public before dependents + from: column-Node + kind: Precedence + to: dependent-Node + query: + - $column[Type] = '*scpb.Column' + - $dependent[Type] IN ['*scpb.ColumnComment', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnName', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.IndexColumn', '*scpb.SequenceOwner'] + - joinOnColumnID($column, $dependent, $table-id, $col-id) + - transient($column-Target, $dependent-Target) + - $column-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - $dependent-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($column, $column-Target, $column-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: column no longer public before dependents + from: column-Node + kind: Precedence + to: dependent-Node + query: + - $column[Type] = '*scpb.Column' + - $dependent[Type] IN ['*scpb.ColumnComment', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnName', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.IndexColumn', '*scpb.SequenceOwner'] + - joinOnColumnID($column, $dependent, $table-id, $col-id) + - $column-Target[TargetStatus] = TRANSIENT_ABSENT + - $column-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - $dependent-Target[TargetStatus] = ABSENT + - $dependent-Node[CurrentStatus] = ABSENT + - joinTargetNode($column, $column-Target, $column-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: column no longer public before dependents + from: column-Node + kind: Precedence + to: dependent-Node + query: + - $column[Type] = '*scpb.Column' + - $dependent[Type] IN ['*scpb.ColumnComment', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnName', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.IndexColumn', '*scpb.SequenceOwner'] + - joinOnColumnID($column, $dependent, $table-id, $col-id) + - $column-Target[TargetStatus] = ABSENT + - $column-Node[CurrentStatus] = WRITE_ONLY + - $dependent-Target[TargetStatus] = TRANSIENT_ABSENT + - $dependent-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($column, $column-Target, $column-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: column public before non-index-backed constraint (including hash-sharded) is created + from: column-Node + kind: Precedence + to: constraint-Node + query: + - $column[Type] = '*scpb.Column' + - $constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.CheckConstraintUnvalidated', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.UniqueWithoutIndexConstraint', '*scpb.UniqueWithoutIndexConstraintUnvalidated'] + - $column[ColumnID] = $columnID + - $constraint[ReferencedColumnIDs] CONTAINS $columnID + - joinOnDescID($column, $constraint, $table-id) + - ToPublicOrTransient($column-Target, $constraint-Target) + - $column-Node[CurrentStatus] = PUBLIC + - $constraint-Node[CurrentStatus] = WRITE_ONLY + - joinTargetNode($column, $column-Target, $column-Node) + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) +- name: 'column type dependents removed right before column type, except if part of a column type alteration ' + from: dependent-Node + kind: SameStagePrecedence + to: column-type-Node + query: + - $dependent[Type] IN ['*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnOnUpdateExpression', '*scpb.SequenceOwner'] + - $column-type[Type] = '*scpb.ColumnType' + - joinOnColumnID($dependent, $column-type, $table-id, $col-id) + - no column type alteration in progress($table-id, $col-id) + - toAbsent($dependent-Target, $column-type-Target) + - $dependent-Node[CurrentStatus] = ABSENT + - $column-type-Node[CurrentStatus] = ABSENT + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($column-type, $column-type-Target, $column-type-Node) +- name: column type is changed to public after doing validation of a transient check constraint + from: transient-check-constraint-Node + kind: SameStagePrecedence + to: column-type-Node + query: + - $transient-check-constraint[Type] = '*scpb.CheckConstraint' + - $column-type[Type] = '*scpb.ColumnType' + - joinOnDescID($transient-check-constraint, $column-type, $table-id) + - $column-type[ColumnID] = $columnID + - $transient-check-constraint[ReferencedColumnIDs] CONTAINS $columnID + - $transient-check-constraint-Target[TargetStatus] = TRANSIENT_ABSENT + - $column-type-Target[TargetStatus] = PUBLIC + - $transient-check-constraint-Node[CurrentStatus] = TRANSIENT_VALIDATED + - $column-type-Node[CurrentStatus] = PUBLIC + - joinTargetNode($transient-check-constraint, $transient-check-constraint-Target, $transient-check-constraint-Node) + - joinTargetNode($column-type, $column-type-Target, $column-type-Node) +- name: column type removed before column family + from: column-type-Node + kind: Precedence + to: column-family-Node + query: + - $column-type[Type] = '*scpb.ColumnType' + - $column-family[Type] = '*scpb.ColumnFamily' + - joinOnColumnFamilyID($column-type, $column-family, $table-id, $family-id) + - toAbsent($column-type-Target, $column-family-Target) + - $column-type-Node[CurrentStatus] = ABSENT + - $column-family-Node[CurrentStatus] = ABSENT + - joinTargetNode($column-type, $column-type-Target, $column-type-Node) + - joinTargetNode($column-family, $column-family-Target, $column-family-Node) +- name: column type removed right before column when not dropping relation + from: column-type-Node + kind: SameStagePrecedence + to: column-Node + query: + - $column-type[Type] = '*scpb.ColumnType' + - descriptorIsNotBeingDropped-25.1($column-type) + - $column[Type] = '*scpb.Column' + - joinOnColumnID($column-type, $column, $table-id, $col-id) + - toAbsent($column-type-Target, $column-Target) + - $column-type-Node[CurrentStatus] = ABSENT + - $column-Node[CurrentStatus] = ABSENT + - joinTargetNode($column-type, $column-type-Target, $column-type-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: column type set right after column existence + from: column-Node + kind: SameStagePrecedence + to: column-type-Node + query: + - $column[Type] = '*scpb.Column' + - $column-type[Type] = '*scpb.ColumnType' + - ToPublicOrTransient($column-Target, $column-type-Target) + - $column-Node[CurrentStatus] = DELETE_ONLY + - $column-type-Node[CurrentStatus] = PUBLIC + - joinOnColumnID($column, $column-type, $table-id, $col-id) + - joinTargetNode($column, $column-Target, $column-Node) + - joinTargetNode($column-type, $column-type-Target, $column-type-Node) +- name: column type update is decomposed as a drop then add + from: old-column-type-Node + kind: Precedence + to: new-column-type-Node + query: + - $old-column-type[Type] = '*scpb.ColumnType' + - $new-column-type[Type] = '*scpb.ColumnType' + - joinOnColumnID($old-column-type, $new-column-type, $table-id, $col-id) + - $old-column-type-Target[TargetStatus] = ABSENT + - $old-column-type-Node[CurrentStatus] = PUBLIC + - $new-column-type-Target[TargetStatus] = PUBLIC + - $new-column-type-Node[CurrentStatus] = ABSENT + - joinTargetNode($old-column-type, $old-column-type-Target, $old-column-type-Node) + - joinTargetNode($new-column-type, $new-column-type-Target, $new-column-type-Node) +- name: column writable right before column constraint is enforced. + from: column-Node + kind: SameStagePrecedence + to: column-constraint-Node + query: + - $column[Type] = '*scpb.Column' + - $column-constraint[Type] = '*scpb.ColumnNotNull' + - joinOnColumnID($column, $column-constraint, $table-id, $col-id) + - ToPublicOrTransient($column-Target, $column-constraint-Target) + - $column-Node[CurrentStatus] = WRITE_ONLY + - $column-constraint-Node[CurrentStatus] = WRITE_ONLY + - joinTargetNode($column, $column-Target, $column-Node) + - joinTargetNode($column-constraint, $column-constraint-Target, $column-constraint-Node) +- name: constraint dependent public right before complex constraint + from: dependent-Node + kind: SameStagePrecedence + to: complex-constraint-Node + query: + - $dependent[Type] = '*scpb.ConstraintComment' + - $complex-constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.UniqueWithoutIndexConstraint'] + - joinOnConstraintID($dependent, $complex-constraint, $table-id, $constraint-id) + - ToPublicOrTransient($dependent-Target, $complex-constraint-Target) + - $dependent-Node[CurrentStatus] = PUBLIC + - $complex-constraint-Node[CurrentStatus] = PUBLIC + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($complex-constraint, $complex-constraint-Target, $complex-constraint-Node) +- name: constraint no longer public before dependents + from: constraint-Node + kind: Precedence + to: dependent-Node + query: + - $constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.UniqueWithoutIndexConstraint'] + - $dependent[Type] = '*scpb.ConstraintComment' + - joinOnConstraintID($constraint, $dependent, $table-id, $constraint-id) + - toAbsent($constraint-Target, $dependent-Target) + - $constraint-Node[CurrentStatus] = VALIDATED + - $dependent-Node[CurrentStatus] = ABSENT + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: constraint no longer public before dependents + from: constraint-Node + kind: Precedence + to: dependent-Node + query: + - $constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.UniqueWithoutIndexConstraint'] + - $dependent[Type] = '*scpb.ConstraintComment' + - joinOnConstraintID($constraint, $dependent, $table-id, $constraint-id) + - transient($constraint-Target, $dependent-Target) + - $constraint-Node[CurrentStatus] = TRANSIENT_VALIDATED + - $dependent-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: constraint no longer public before dependents + from: constraint-Node + kind: Precedence + to: dependent-Node + query: + - $constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.UniqueWithoutIndexConstraint'] + - $dependent[Type] = '*scpb.ConstraintComment' + - joinOnConstraintID($constraint, $dependent, $table-id, $constraint-id) + - $constraint-Target[TargetStatus] = TRANSIENT_ABSENT + - $constraint-Node[CurrentStatus] = TRANSIENT_VALIDATED + - $dependent-Target[TargetStatus] = ABSENT + - $dependent-Node[CurrentStatus] = ABSENT + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: constraint no longer public before dependents + from: constraint-Node + kind: Precedence + to: dependent-Node + query: + - $constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.UniqueWithoutIndexConstraint'] + - $dependent[Type] = '*scpb.ConstraintComment' + - joinOnConstraintID($constraint, $dependent, $table-id, $constraint-id) + - $constraint-Target[TargetStatus] = ABSENT + - $constraint-Node[CurrentStatus] = VALIDATED + - $dependent-Target[TargetStatus] = TRANSIENT_ABSENT + - $dependent-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: cross-descriptor constraint is absent before referenced descriptor is dropped + from: cross-desc-constraint-Node + kind: Precedence + to: referenced-descriptor-Node + query: + - $cross-desc-constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.ForeignKeyConstraint', '*scpb.UniqueWithoutIndexConstraint'] + - $referenced-descriptor[Type] IN ['*scpb.AliasType', '*scpb.CompositeType', '*scpb.Database', '*scpb.EnumType', '*scpb.Function', '*scpb.Schema', '*scpb.Sequence', '*scpb.Table', '*scpb.View'] + - joinReferencedDescID($cross-desc-constraint, $referenced-descriptor, $desc-id) + - toAbsent($cross-desc-constraint-Target, $referenced-descriptor-Target) + - $cross-desc-constraint-Node[CurrentStatus] = ABSENT + - $referenced-descriptor-Node[CurrentStatus] = DROPPED + - joinTargetNode($cross-desc-constraint, $cross-desc-constraint-Target, $cross-desc-constraint-Node) + - joinTargetNode($referenced-descriptor, $referenced-descriptor-Target, $referenced-descriptor-Node) +- name: cross-descriptor constraint is absent before referencing descriptor is dropped + from: cross-desc-constraint-Node + kind: Precedence + to: referencing-descriptor-Node + query: + - $cross-desc-constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.ForeignKeyConstraint', '*scpb.UniqueWithoutIndexConstraint'] + - $referencing-descriptor[Type] IN ['*scpb.AliasType', '*scpb.CompositeType', '*scpb.Database', '*scpb.EnumType', '*scpb.Function', '*scpb.Schema', '*scpb.Sequence', '*scpb.Table', '*scpb.View'] + - joinOnDescID($cross-desc-constraint, $referencing-descriptor, $desc-id) + - toAbsent($cross-desc-constraint-Target, $referencing-descriptor-Target) + - $cross-desc-constraint-Node[CurrentStatus] = ABSENT + - $referencing-descriptor-Node[CurrentStatus] = DROPPED + - joinTargetNode($cross-desc-constraint, $cross-desc-constraint-Target, $cross-desc-constraint-Node) + - joinTargetNode($referencing-descriptor, $referencing-descriptor-Target, $referencing-descriptor-Node) +- name: dependent view absent before secondary index + from: view-Node + kind: Precedence + to: index-Node + query: + - $view[Type] = '*scpb.View' + - $index[Type] = '*scpb.SecondaryIndex' + - viewReferencesIndex(*scpb.View, *scpb.SecondaryIndex)($view, $index) + - toAbsent($view-Target, $index-Target) + - $view-Node[CurrentStatus] = ABSENT + - $index-Node[CurrentStatus] = ABSENT + - joinTargetNode($view, $view-Target, $view-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: dependent view absent before secondary index + from: view-Node + kind: Precedence + to: index-Node + query: + - $view[Type] = '*scpb.View' + - $index[Type] = '*scpb.SecondaryIndex' + - viewReferencesIndex(*scpb.View, *scpb.SecondaryIndex)($view, $index) + - transient($view-Target, $index-Target) + - $view-Node[CurrentStatus] = TRANSIENT_ABSENT + - $index-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($view, $view-Target, $view-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: dependent view absent before secondary index + from: view-Node + kind: Precedence + to: index-Node + query: + - $view[Type] = '*scpb.View' + - $index[Type] = '*scpb.SecondaryIndex' + - viewReferencesIndex(*scpb.View, *scpb.SecondaryIndex)($view, $index) + - $view-Target[TargetStatus] = TRANSIENT_ABSENT + - $view-Node[CurrentStatus] = TRANSIENT_ABSENT + - $index-Target[TargetStatus] = ABSENT + - $index-Node[CurrentStatus] = ABSENT + - joinTargetNode($view, $view-Target, $view-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: dependent view absent before secondary index + from: view-Node + kind: Precedence + to: index-Node + query: + - $view[Type] = '*scpb.View' + - $index[Type] = '*scpb.SecondaryIndex' + - viewReferencesIndex(*scpb.View, *scpb.SecondaryIndex)($view, $index) + - $view-Target[TargetStatus] = ABSENT + - $view-Node[CurrentStatus] = ABSENT + - $index-Target[TargetStatus] = TRANSIENT_ABSENT + - $index-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($view, $view-Target, $view-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: dependent view no longer public before secondary index + from: view-Node + kind: Precedence + to: index-Node + query: + - $view[Type] = '*scpb.View' + - $index[Type] = '*scpb.SecondaryIndex' + - viewReferencesIndex(*scpb.View, *scpb.SecondaryIndex)($view, $index) + - toAbsent($view-Target, $index-Target) + - $view-Node[CurrentStatus] = DROPPED + - $index-Node[CurrentStatus] = VALIDATED + - joinTargetNode($view, $view-Target, $view-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: dependent view no longer public before secondary index + from: view-Node + kind: Precedence + to: index-Node + query: + - $view[Type] = '*scpb.View' + - $index[Type] = '*scpb.SecondaryIndex' + - viewReferencesIndex(*scpb.View, *scpb.SecondaryIndex)($view, $index) + - transient($view-Target, $index-Target) + - $view-Node[CurrentStatus] = TRANSIENT_DROPPED + - $index-Node[CurrentStatus] = TRANSIENT_VALIDATED + - joinTargetNode($view, $view-Target, $view-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: dependent view no longer public before secondary index + from: view-Node + kind: Precedence + to: index-Node + query: + - $view[Type] = '*scpb.View' + - $index[Type] = '*scpb.SecondaryIndex' + - viewReferencesIndex(*scpb.View, *scpb.SecondaryIndex)($view, $index) + - $view-Target[TargetStatus] = TRANSIENT_ABSENT + - $view-Node[CurrentStatus] = TRANSIENT_DROPPED + - $index-Target[TargetStatus] = ABSENT + - $index-Node[CurrentStatus] = VALIDATED + - joinTargetNode($view, $view-Target, $view-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: dependent view no longer public before secondary index + from: view-Node + kind: Precedence + to: index-Node + query: + - $view[Type] = '*scpb.View' + - $index[Type] = '*scpb.SecondaryIndex' + - viewReferencesIndex(*scpb.View, *scpb.SecondaryIndex)($view, $index) + - $view-Target[TargetStatus] = ABSENT + - $view-Node[CurrentStatus] = DROPPED + - $index-Target[TargetStatus] = TRANSIENT_ABSENT + - $index-Node[CurrentStatus] = TRANSIENT_VALIDATED + - joinTargetNode($view, $view-Target, $view-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: dependents added after policy + from: policy-Node + kind: SameStagePrecedence + to: dependent-Node + query: + - $policy[Type] = '*scpb.Policy' + - $dependent[Type] = '*scpb.PolicyName' + - joinOnPolicyID($policy, $dependent, $table-id, $policy-id) + - ToPublicOrTransient($policy-Target, $dependent-Target) + - $policy-Node[CurrentStatus] = PUBLIC + - $dependent-Node[CurrentStatus] = PUBLIC + - joinTargetNode($policy, $policy-Target, $policy-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: dependents exist before descriptor becomes public + from: dependent-Node + kind: Precedence + to: relation-Node + query: + - $dependent[Type] IN ['*scpb.CheckConstraint', '*scpb.CheckConstraintUnvalidated', '*scpb.Column', '*scpb.ColumnComment', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnFamily', '*scpb.ColumnName', '*scpb.ColumnNotNull', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.CompositeTypeAttrName', '*scpb.CompositeTypeAttrType', '*scpb.ConstraintComment', '*scpb.ConstraintWithoutIndexName', '*scpb.DatabaseComment', '*scpb.DatabaseRegionConfig', '*scpb.DatabaseRoleSetting', '*scpb.DatabaseZoneConfig', '*scpb.EnumTypeValue', '*scpb.ForeignKeyConstraint', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.FunctionBody', '*scpb.FunctionLeakProof', '*scpb.FunctionName', '*scpb.FunctionNullInputBehavior', '*scpb.FunctionSecurity', '*scpb.FunctionVolatility', '*scpb.IndexColumn', '*scpb.IndexComment', '*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.IndexZoneConfig', '*scpb.LDRJobIDs', '*scpb.NamedRangeZoneConfig', '*scpb.Namespace', '*scpb.Owner', '*scpb.PartitionZoneConfig', '*scpb.Policy', '*scpb.PolicyName', '*scpb.PolicyRole', '*scpb.PrimaryIndex', '*scpb.RowLevelTTL', '*scpb.SchemaChild', '*scpb.SchemaComment', '*scpb.SchemaParent', '*scpb.SecondaryIndex', '*scpb.SecondaryIndexPartial', '*scpb.SequenceOption', '*scpb.SequenceOwner', '*scpb.TableComment', '*scpb.TableLocalityGlobal', '*scpb.TableLocalityPrimaryRegion', '*scpb.TableLocalityRegionalByRow', '*scpb.TableLocalitySecondaryRegion', '*scpb.TablePartitioning', '*scpb.TableSchemaLocked', '*scpb.TableZoneConfig', '*scpb.TemporaryIndex', '*scpb.Trigger', '*scpb.TriggerDeps', '*scpb.TriggerEnabled', '*scpb.TriggerEvents', '*scpb.TriggerFunctionCall', '*scpb.TriggerName', '*scpb.TriggerTiming', '*scpb.TriggerTransition', '*scpb.TriggerWhen', '*scpb.TypeComment', '*scpb.UniqueWithoutIndexConstraint', '*scpb.UniqueWithoutIndexConstraintUnvalidated', '*scpb.UserPrivileges'] + - $relation[Type] IN ['*scpb.AliasType', '*scpb.CompositeType', '*scpb.Database', '*scpb.EnumType', '*scpb.Function', '*scpb.Schema', '*scpb.Sequence', '*scpb.Table', '*scpb.View'] + - joinOnDescID($dependent, $relation, $relation-id) + - ToPublicOrTransient($dependent-Target, $relation-Target) + - $dependent-Node[CurrentStatus] = PUBLIC + - $relation-Node[CurrentStatus] = PUBLIC + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($relation, $relation-Target, $relation-Node) +- name: dependents removed before column + from: dependent-Node + kind: Precedence + to: column-Node + query: + - $dependent[Type] IN ['*scpb.ColumnComment', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnName', '*scpb.ColumnNotNull', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.IndexColumn', '*scpb.SequenceOwner'] + - $column[Type] = '*scpb.Column' + - joinOnColumnID($dependent, $column, $table-id, $col-id) + - toAbsent($dependent-Target, $column-Target) + - $dependent-Node[CurrentStatus] = ABSENT + - $column-Node[CurrentStatus] = ABSENT + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: dependents removed before column + from: dependent-Node + kind: Precedence + to: column-Node + query: + - $dependent[Type] IN ['*scpb.ColumnComment', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnName', '*scpb.ColumnNotNull', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.IndexColumn', '*scpb.SequenceOwner'] + - $column[Type] = '*scpb.Column' + - joinOnColumnID($dependent, $column, $table-id, $col-id) + - transient($dependent-Target, $column-Target) + - $dependent-Node[CurrentStatus] = TRANSIENT_ABSENT + - $column-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: dependents removed before column + from: dependent-Node + kind: Precedence + to: column-Node + query: + - $dependent[Type] IN ['*scpb.ColumnComment', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnName', '*scpb.ColumnNotNull', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.IndexColumn', '*scpb.SequenceOwner'] + - $column[Type] = '*scpb.Column' + - joinOnColumnID($dependent, $column, $table-id, $col-id) + - $dependent-Target[TargetStatus] = TRANSIENT_ABSENT + - $dependent-Node[CurrentStatus] = TRANSIENT_ABSENT + - $column-Target[TargetStatus] = ABSENT + - $column-Node[CurrentStatus] = ABSENT + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: dependents removed before column + from: dependent-Node + kind: Precedence + to: column-Node + query: + - $dependent[Type] IN ['*scpb.ColumnComment', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnName', '*scpb.ColumnNotNull', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.IndexColumn', '*scpb.SequenceOwner'] + - $column[Type] = '*scpb.Column' + - joinOnColumnID($dependent, $column, $table-id, $col-id) + - $dependent-Target[TargetStatus] = ABSENT + - $dependent-Node[CurrentStatus] = ABSENT + - $column-Target[TargetStatus] = TRANSIENT_ABSENT + - $column-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: dependents removed before constraint + from: dependents-Node + kind: Precedence + to: constraint-Node + query: + - $dependents[Type] = '*scpb.ConstraintComment' + - $constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.UniqueWithoutIndexConstraint'] + - joinOnConstraintID($dependents, $constraint, $table-id, $constraint-id) + - toAbsent($dependents-Target, $constraint-Target) + - $dependents-Node[CurrentStatus] = ABSENT + - $constraint-Node[CurrentStatus] = ABSENT + - joinTargetNode($dependents, $dependents-Target, $dependents-Node) + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) +- name: dependents removed before constraint + from: dependents-Node + kind: Precedence + to: constraint-Node + query: + - $dependents[Type] = '*scpb.ConstraintComment' + - $constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.UniqueWithoutIndexConstraint'] + - joinOnConstraintID($dependents, $constraint, $table-id, $constraint-id) + - transient($dependents-Target, $constraint-Target) + - $dependents-Node[CurrentStatus] = TRANSIENT_ABSENT + - $constraint-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($dependents, $dependents-Target, $dependents-Node) + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) +- name: dependents removed before constraint + from: dependents-Node + kind: Precedence + to: constraint-Node + query: + - $dependents[Type] = '*scpb.ConstraintComment' + - $constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.UniqueWithoutIndexConstraint'] + - joinOnConstraintID($dependents, $constraint, $table-id, $constraint-id) + - $dependents-Target[TargetStatus] = TRANSIENT_ABSENT + - $dependents-Node[CurrentStatus] = TRANSIENT_ABSENT + - $constraint-Target[TargetStatus] = ABSENT + - $constraint-Node[CurrentStatus] = ABSENT + - joinTargetNode($dependents, $dependents-Target, $dependents-Node) + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) +- name: dependents removed before constraint + from: dependents-Node + kind: Precedence + to: constraint-Node + query: + - $dependents[Type] = '*scpb.ConstraintComment' + - $constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.UniqueWithoutIndexConstraint'] + - joinOnConstraintID($dependents, $constraint, $table-id, $constraint-id) + - $dependents-Target[TargetStatus] = ABSENT + - $dependents-Node[CurrentStatus] = ABSENT + - $constraint-Target[TargetStatus] = TRANSIENT_ABSENT + - $constraint-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($dependents, $dependents-Target, $dependents-Node) + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) +- name: dependents removed before index + from: dependent-Node + kind: Precedence + to: index-Node + query: + - $dependent[Type] IN ['*scpb.IndexColumn', '*scpb.IndexComment', '*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.IndexZoneConfig', '*scpb.PartitionZoneConfig', '*scpb.SecondaryIndexPartial'] + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - joinOnIndexID($dependent, $index, $table-id, $index-id) + - toAbsent($dependent-Target, $index-Target) + - $dependent-Node[CurrentStatus] = ABSENT + - $index-Node[CurrentStatus] = ABSENT + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: dependents removed before index + from: dependent-Node + kind: Precedence + to: index-Node + query: + - $dependent[Type] IN ['*scpb.IndexColumn', '*scpb.IndexComment', '*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.IndexZoneConfig', '*scpb.PartitionZoneConfig', '*scpb.SecondaryIndexPartial'] + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - joinOnIndexID($dependent, $index, $table-id, $index-id) + - transient($dependent-Target, $index-Target) + - $dependent-Node[CurrentStatus] = TRANSIENT_ABSENT + - $index-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: dependents removed before index + from: dependent-Node + kind: Precedence + to: index-Node + query: + - $dependent[Type] IN ['*scpb.IndexColumn', '*scpb.IndexComment', '*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.IndexZoneConfig', '*scpb.PartitionZoneConfig', '*scpb.SecondaryIndexPartial'] + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - joinOnIndexID($dependent, $index, $table-id, $index-id) + - $dependent-Target[TargetStatus] = TRANSIENT_ABSENT + - $dependent-Node[CurrentStatus] = TRANSIENT_ABSENT + - $index-Target[TargetStatus] = ABSENT + - $index-Node[CurrentStatus] = ABSENT + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: dependents removed before index + from: dependent-Node + kind: Precedence + to: index-Node + query: + - $dependent[Type] IN ['*scpb.IndexColumn', '*scpb.IndexComment', '*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.IndexZoneConfig', '*scpb.PartitionZoneConfig', '*scpb.SecondaryIndexPartial'] + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - joinOnIndexID($dependent, $index, $table-id, $index-id) + - $dependent-Target[TargetStatus] = ABSENT + - $dependent-Node[CurrentStatus] = ABSENT + - $index-Target[TargetStatus] = TRANSIENT_ABSENT + - $index-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: dependents removed before policy + from: dependent-Node + kind: SameStagePrecedence + to: policy-Node + query: + - $dependent[Type] = '*scpb.PolicyName' + - $policy[Type] = '*scpb.Policy' + - joinOnPolicyID($dependent, $policy, $table-id, $policy-id) + - toAbsent($dependent-Target, $policy-Target) + - $dependent-Node[CurrentStatus] = ABSENT + - $policy-Node[CurrentStatus] = ABSENT + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($policy, $policy-Target, $policy-Node) +- name: dependents removed before policy + from: dependent-Node + kind: SameStagePrecedence + to: policy-Node + query: + - $dependent[Type] = '*scpb.PolicyName' + - $policy[Type] = '*scpb.Policy' + - joinOnPolicyID($dependent, $policy, $table-id, $policy-id) + - transient($dependent-Target, $policy-Target) + - $dependent-Node[CurrentStatus] = TRANSIENT_ABSENT + - $policy-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($policy, $policy-Target, $policy-Node) +- name: dependents removed before policy + from: dependent-Node + kind: SameStagePrecedence + to: policy-Node + query: + - $dependent[Type] = '*scpb.PolicyName' + - $policy[Type] = '*scpb.Policy' + - joinOnPolicyID($dependent, $policy, $table-id, $policy-id) + - $dependent-Target[TargetStatus] = TRANSIENT_ABSENT + - $dependent-Node[CurrentStatus] = TRANSIENT_ABSENT + - $policy-Target[TargetStatus] = ABSENT + - $policy-Node[CurrentStatus] = ABSENT + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($policy, $policy-Target, $policy-Node) +- name: dependents removed before policy + from: dependent-Node + kind: SameStagePrecedence + to: policy-Node + query: + - $dependent[Type] = '*scpb.PolicyName' + - $policy[Type] = '*scpb.Policy' + - joinOnPolicyID($dependent, $policy, $table-id, $policy-id) + - $dependent-Target[TargetStatus] = ABSENT + - $dependent-Node[CurrentStatus] = ABSENT + - $policy-Target[TargetStatus] = TRANSIENT_ABSENT + - $policy-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($policy, $policy-Target, $policy-Node) +- name: dependents removed right before simple constraint + from: dependents-Node + kind: SameStagePrecedence + to: constraint-Node + query: + - $dependents[Type] = '*scpb.ConstraintComment' + - $constraint[Type] IN ['*scpb.CheckConstraintUnvalidated', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.UniqueWithoutIndexConstraintUnvalidated'] + - joinOnConstraintID($dependents, $constraint, $table-id, $constraint-id) + - toAbsent($dependents-Target, $constraint-Target) + - $dependents-Node[CurrentStatus] = ABSENT + - $constraint-Node[CurrentStatus] = ABSENT + - joinTargetNode($dependents, $dependents-Target, $dependents-Node) + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) +- name: dependents removed right before simple constraint + from: dependents-Node + kind: SameStagePrecedence + to: constraint-Node + query: + - $dependents[Type] = '*scpb.ConstraintComment' + - $constraint[Type] IN ['*scpb.CheckConstraintUnvalidated', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.UniqueWithoutIndexConstraintUnvalidated'] + - joinOnConstraintID($dependents, $constraint, $table-id, $constraint-id) + - transient($dependents-Target, $constraint-Target) + - $dependents-Node[CurrentStatus] = TRANSIENT_ABSENT + - $constraint-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($dependents, $dependents-Target, $dependents-Node) + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) +- name: dependents removed right before simple constraint + from: dependents-Node + kind: SameStagePrecedence + to: constraint-Node + query: + - $dependents[Type] = '*scpb.ConstraintComment' + - $constraint[Type] IN ['*scpb.CheckConstraintUnvalidated', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.UniqueWithoutIndexConstraintUnvalidated'] + - joinOnConstraintID($dependents, $constraint, $table-id, $constraint-id) + - $dependents-Target[TargetStatus] = TRANSIENT_ABSENT + - $dependents-Node[CurrentStatus] = TRANSIENT_ABSENT + - $constraint-Target[TargetStatus] = ABSENT + - $constraint-Node[CurrentStatus] = ABSENT + - joinTargetNode($dependents, $dependents-Target, $dependents-Node) + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) +- name: dependents removed right before simple constraint + from: dependents-Node + kind: SameStagePrecedence + to: constraint-Node + query: + - $dependents[Type] = '*scpb.ConstraintComment' + - $constraint[Type] IN ['*scpb.CheckConstraintUnvalidated', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.UniqueWithoutIndexConstraintUnvalidated'] + - joinOnConstraintID($dependents, $constraint, $table-id, $constraint-id) + - $dependents-Target[TargetStatus] = ABSENT + - $dependents-Node[CurrentStatus] = ABSENT + - $constraint-Target[TargetStatus] = TRANSIENT_ABSENT + - $constraint-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($dependents, $dependents-Target, $dependents-Node) + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) +- name: descriptor drop right before removing dependent between types + from: referenced-descriptor-Node + kind: SameStagePrecedence + to: referencing-via-type-Node + query: + - $referenced-descriptor[Type] IN ['*scpb.AliasType', '*scpb.CompositeType', '*scpb.EnumType'] + - $referenced-descriptor[DescID] = $fromDescID + - $referencing-via-type[ReferencedTypeIDs] CONTAINS $fromDescID + - $referencing-via-type[Type] = '*scpb.ColumnType' + - toAbsent($referenced-descriptor-Target, $referencing-via-type-Target) + - $referenced-descriptor-Node[CurrentStatus] = DROPPED + - $referencing-via-type-Node[CurrentStatus] = ABSENT + - joinTargetNode($referenced-descriptor, $referenced-descriptor-Target, $referenced-descriptor-Node) + - joinTargetNode($referencing-via-type, $referencing-via-type-Target, $referencing-via-type-Node) +- name: descriptor drop right before removing dependent with attr ref + from: referenced-descriptor-Node + kind: SameStagePrecedence + to: referencing-via-attr-Node + query: + - $referenced-descriptor[Type] IN ['*scpb.AliasType', '*scpb.CompositeType', '*scpb.Database', '*scpb.EnumType', '*scpb.Function', '*scpb.Schema', '*scpb.Sequence', '*scpb.Table', '*scpb.View'] + - $referencing-via-attr[Type] IN ['*scpb.CheckConstraintUnvalidated', '*scpb.ColumnComment', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnFamily', '*scpb.ColumnName', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.CompositeTypeAttrName', '*scpb.CompositeTypeAttrType', '*scpb.ConstraintComment', '*scpb.ConstraintWithoutIndexName', '*scpb.DatabaseComment', '*scpb.DatabaseRegionConfig', '*scpb.DatabaseRoleSetting', '*scpb.DatabaseZoneConfig', '*scpb.EnumTypeValue', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.FunctionBody', '*scpb.FunctionLeakProof', '*scpb.FunctionName', '*scpb.FunctionNullInputBehavior', '*scpb.FunctionSecurity', '*scpb.FunctionVolatility', '*scpb.IndexColumn', '*scpb.IndexComment', '*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.IndexZoneConfig', '*scpb.LDRJobIDs', '*scpb.NamedRangeZoneConfig', '*scpb.Namespace', '*scpb.Owner', '*scpb.PartitionZoneConfig', '*scpb.Policy', '*scpb.PolicyName', '*scpb.PolicyRole', '*scpb.RowLevelTTL', '*scpb.SchemaComment', '*scpb.SecondaryIndexPartial', '*scpb.SequenceOption', '*scpb.SequenceOwner', '*scpb.TableComment', '*scpb.TableLocalityGlobal', '*scpb.TableLocalityPrimaryRegion', '*scpb.TableLocalityRegionalByRow', '*scpb.TableLocalitySecondaryRegion', '*scpb.TablePartitioning', '*scpb.TableSchemaLocked', '*scpb.TableZoneConfig', '*scpb.Trigger', '*scpb.TriggerDeps', '*scpb.TriggerEnabled', '*scpb.TriggerEvents', '*scpb.TriggerFunctionCall', '*scpb.TriggerName', '*scpb.TriggerTiming', '*scpb.TriggerTransition', '*scpb.TriggerWhen', '*scpb.TypeComment', '*scpb.UniqueWithoutIndexConstraintUnvalidated', '*scpb.UserPrivileges'] + - joinReferencedDescID($referencing-via-attr, $referenced-descriptor, $desc-id) + - toAbsent($referenced-descriptor-Target, $referencing-via-attr-Target) + - $referenced-descriptor-Node[CurrentStatus] = DROPPED + - $referencing-via-attr-Node[CurrentStatus] = ABSENT + - joinTargetNode($referenced-descriptor, $referenced-descriptor-Target, $referenced-descriptor-Node) + - joinTargetNode($referencing-via-attr, $referencing-via-attr-Target, $referencing-via-attr-Node) +- name: descriptor drop right before removing dependent with expr ref to sequence + from: referenced-descriptor-Node + kind: SameStagePrecedence + to: referencing-via-expr-Node + query: + - $referenced-descriptor[Type] = '*scpb.Sequence' + - $referenced-descriptor[DescID] = $seqID + - $referencing-via-expr[ReferencedSequenceIDs] CONTAINS $seqID + - $referencing-via-expr[Type] IN ['*scpb.CheckConstraintUnvalidated', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.SecondaryIndexPartial'] + - toAbsent($referenced-descriptor-Target, $referencing-via-expr-Target) + - $referenced-descriptor-Node[CurrentStatus] = DROPPED + - $referencing-via-expr-Node[CurrentStatus] = ABSENT + - joinTargetNode($referenced-descriptor, $referenced-descriptor-Target, $referenced-descriptor-Node) + - joinTargetNode($referencing-via-expr, $referencing-via-expr-Target, $referencing-via-expr-Node) +- name: descriptor drop right before removing dependent with function refs in columns + from: referenced-descriptor-Node + kind: SameStagePrecedence + to: referencing-via-function-Node + query: + - $referenced-descriptor[Type] = '*scpb.Function' + - $referenced-descriptor[DescID] = $fromDescID + - $referencing-via-function[ReferencedFunctionIDs] CONTAINS $fromDescID + - $referencing-via-function[Type] IN ['*scpb.CheckConstraintUnvalidated', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.SecondaryIndexPartial'] + - toAbsent($referenced-descriptor-Target, $referencing-via-function-Target) + - $referenced-descriptor-Node[CurrentStatus] = DROPPED + - $referencing-via-function-Node[CurrentStatus] = ABSENT + - joinTargetNode($referenced-descriptor, $referenced-descriptor-Target, $referenced-descriptor-Node) + - joinTargetNode($referencing-via-function, $referencing-via-function-Target, $referencing-via-function-Node) +- name: descriptor drop right before removing dependent with type refs in expressions + from: referenced-descriptor-Node + kind: SameStagePrecedence + to: referencing-via-type-Node + query: + - $referenced-descriptor[Type] IN ['*scpb.AliasType', '*scpb.CompositeType', '*scpb.EnumType'] + - $referenced-descriptor[DescID] = $fromDescID + - $referencing-via-type[ReferencedTypeIDs] CONTAINS $fromDescID + - descriptorIsNotBeingDropped-25.1($referencing-via-type) + - $referencing-via-type[Type] IN ['*scpb.CheckConstraintUnvalidated', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.SecondaryIndexPartial'] + - toAbsent($referenced-descriptor-Target, $referencing-via-type-Target) + - $referenced-descriptor-Node[CurrentStatus] = DROPPED + - $referencing-via-type-Node[CurrentStatus] = ABSENT + - joinTargetNode($referenced-descriptor, $referenced-descriptor-Target, $referenced-descriptor-Node) + - joinTargetNode($referencing-via-type, $referencing-via-type-Target, $referencing-via-type-Node) +- name: descriptor dropped before dependent element removal + from: descriptor-Node + kind: Precedence + to: dependent-Node + query: + - $descriptor[Type] IN ['*scpb.AliasType', '*scpb.CompositeType', '*scpb.Database', '*scpb.EnumType', '*scpb.Function', '*scpb.Schema', '*scpb.Sequence', '*scpb.Table', '*scpb.View'] + - $dependent[Type] IN ['*scpb.CheckConstraintUnvalidated', '*scpb.ColumnComment', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnFamily', '*scpb.ColumnName', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.CompositeTypeAttrName', '*scpb.CompositeTypeAttrType', '*scpb.DatabaseComment', '*scpb.DatabaseRegionConfig', '*scpb.DatabaseRoleSetting', '*scpb.DatabaseZoneConfig', '*scpb.EnumTypeValue', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.FunctionBody', '*scpb.FunctionLeakProof', '*scpb.FunctionName', '*scpb.FunctionNullInputBehavior', '*scpb.FunctionSecurity', '*scpb.FunctionVolatility', '*scpb.IndexColumn', '*scpb.IndexComment', '*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.IndexZoneConfig', '*scpb.LDRJobIDs', '*scpb.NamedRangeZoneConfig', '*scpb.Namespace', '*scpb.Owner', '*scpb.PartitionZoneConfig', '*scpb.Policy', '*scpb.PolicyName', '*scpb.PolicyRole', '*scpb.RowLevelTTL', '*scpb.SchemaChild', '*scpb.SchemaComment', '*scpb.SchemaParent', '*scpb.SecondaryIndexPartial', '*scpb.SequenceOption', '*scpb.SequenceOwner', '*scpb.TableComment', '*scpb.TableLocalityGlobal', '*scpb.TableLocalityPrimaryRegion', '*scpb.TableLocalityRegionalByRow', '*scpb.TableLocalitySecondaryRegion', '*scpb.TablePartitioning', '*scpb.TableSchemaLocked', '*scpb.TableZoneConfig', '*scpb.Trigger', '*scpb.TriggerDeps', '*scpb.TriggerEnabled', '*scpb.TriggerEvents', '*scpb.TriggerFunctionCall', '*scpb.TriggerName', '*scpb.TriggerTiming', '*scpb.TriggerTransition', '*scpb.TriggerWhen', '*scpb.TypeComment', '*scpb.UniqueWithoutIndexConstraintUnvalidated', '*scpb.UserPrivileges'] + - joinOnDescID($descriptor, $dependent, $desc-id) + - toAbsent($descriptor-Target, $dependent-Target) + - $descriptor-Node[CurrentStatus] = DROPPED + - $dependent-Node[CurrentStatus] = ABSENT + - joinTargetNode($descriptor, $descriptor-Target, $descriptor-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: descriptor dropped in transaction before removal + from: dropped-Node + kind: PreviousTransactionPrecedence + to: absent-Node + query: + - $dropped[Type] IN ['*scpb.AliasType', '*scpb.CompositeType', '*scpb.Database', '*scpb.EnumType', '*scpb.Function', '*scpb.Schema', '*scpb.Sequence', '*scpb.Table', '*scpb.View'] + - $dropped[DescID] = $_ + - $dropped[Self] = $absent + - toAbsent($dropped-Target, $absent-Target) + - $dropped-Node[CurrentStatus] = DROPPED + - $absent-Node[CurrentStatus] = ABSENT + - joinTargetNode($dropped, $dropped-Target, $dropped-Node) + - joinTargetNode($absent, $absent-Target, $absent-Node) +- name: descriptor dropped right before removing back-reference in its parent descriptor + from: descriptor-Node + kind: SameStagePrecedence + to: back-reference-in-parent-descriptor-Node + query: + - $descriptor[Type] IN ['*scpb.AliasType', '*scpb.CompositeType', '*scpb.Database', '*scpb.EnumType', '*scpb.Function', '*scpb.Schema', '*scpb.Sequence', '*scpb.Table', '*scpb.View'] + - $back-reference-in-parent-descriptor[Type] IN ['*scpb.SchemaChild', '*scpb.SchemaParent'] + - joinOnDescID($descriptor, $back-reference-in-parent-descriptor, $desc-id) + - toAbsent($descriptor-Target, $back-reference-in-parent-descriptor-Target) + - $descriptor-Node[CurrentStatus] = DROPPED + - $back-reference-in-parent-descriptor-Node[CurrentStatus] = ABSENT + - joinTargetNode($descriptor, $descriptor-Target, $descriptor-Node) + - joinTargetNode($back-reference-in-parent-descriptor, $back-reference-in-parent-descriptor-Target, $back-reference-in-parent-descriptor-Node) +- name: descriptor existence precedes dependents + from: relation-Node + kind: Precedence + to: dependent-Node + query: + - $relation[Type] IN ['*scpb.AliasType', '*scpb.CompositeType', '*scpb.Database', '*scpb.EnumType', '*scpb.Function', '*scpb.Schema', '*scpb.Sequence', '*scpb.Table', '*scpb.View'] + - $dependent[Type] IN ['*scpb.CheckConstraint', '*scpb.CheckConstraintUnvalidated', '*scpb.Column', '*scpb.ColumnComment', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnFamily', '*scpb.ColumnName', '*scpb.ColumnNotNull', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.CompositeTypeAttrName', '*scpb.CompositeTypeAttrType', '*scpb.ConstraintComment', '*scpb.ConstraintWithoutIndexName', '*scpb.DatabaseComment', '*scpb.DatabaseData', '*scpb.DatabaseRegionConfig', '*scpb.DatabaseRoleSetting', '*scpb.DatabaseZoneConfig', '*scpb.EnumTypeValue', '*scpb.ForeignKeyConstraint', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.FunctionBody', '*scpb.FunctionLeakProof', '*scpb.FunctionName', '*scpb.FunctionNullInputBehavior', '*scpb.FunctionSecurity', '*scpb.FunctionVolatility', '*scpb.IndexColumn', '*scpb.IndexComment', '*scpb.IndexData', '*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.IndexZoneConfig', '*scpb.LDRJobIDs', '*scpb.NamedRangeZoneConfig', '*scpb.Namespace', '*scpb.Owner', '*scpb.PartitionZoneConfig', '*scpb.Policy', '*scpb.PolicyName', '*scpb.PolicyRole', '*scpb.PrimaryIndex', '*scpb.RowLevelTTL', '*scpb.SchemaChild', '*scpb.SchemaComment', '*scpb.SchemaParent', '*scpb.SecondaryIndex', '*scpb.SecondaryIndexPartial', '*scpb.SequenceOption', '*scpb.SequenceOwner', '*scpb.TableComment', '*scpb.TableData', '*scpb.TableLocalityGlobal', '*scpb.TableLocalityPrimaryRegion', '*scpb.TableLocalityRegionalByRow', '*scpb.TableLocalitySecondaryRegion', '*scpb.TablePartitioning', '*scpb.TableSchemaLocked', '*scpb.TableZoneConfig', '*scpb.TemporaryIndex', '*scpb.Trigger', '*scpb.TriggerDeps', '*scpb.TriggerEnabled', '*scpb.TriggerEvents', '*scpb.TriggerFunctionCall', '*scpb.TriggerName', '*scpb.TriggerTiming', '*scpb.TriggerTransition', '*scpb.TriggerWhen', '*scpb.TypeComment', '*scpb.UniqueWithoutIndexConstraint', '*scpb.UniqueWithoutIndexConstraintUnvalidated', '*scpb.UserPrivileges'] + - joinOnDescID($relation, $dependent, $relation-id) + - ToPublicOrTransient($relation-Target, $dependent-Target) + - $relation-Node[CurrentStatus] = DESCRIPTOR_ADDED + - $dependent-Node[CurrentStatus] = PUBLIC + - joinTargetNode($relation, $relation-Target, $relation-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: descriptor removed right before garbage collection + from: database-Node + kind: SameStagePrecedence + to: data-Node + query: + - $database[Type] IN ['*scpb.AliasType', '*scpb.CompositeType', '*scpb.Database', '*scpb.EnumType', '*scpb.Function', '*scpb.Schema', '*scpb.Sequence', '*scpb.Table', '*scpb.View'] + - $data[Type] = '*scpb.DatabaseData' + - joinOnDescID($database, $data, $db-id) + - toAbsent($database-Target, $data-Target) + - $database-Node[CurrentStatus] = ABSENT + - $data-Node[CurrentStatus] = DROPPED + - joinTargetNode($database, $database-Target, $database-Node) + - joinTargetNode($data, $data-Target, $data-Node) +- name: during a column type alterations, column type dependents removed before column type + from: dependent-Node + kind: Precedence + to: column-type-Node + query: + - $dependent[Type] IN ['*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnOnUpdateExpression', '*scpb.SequenceOwner'] + - $column-type[Type] = '*scpb.ColumnType' + - joinOnColumnID($dependent, $column-type, $table-id, $col-id) + - $column[Type] = '*scpb.Column' + - $compute-expression[Type] = '*scpb.ColumnComputeExpression' + - joinOnColumnID($column, $compute-expression, $table-id, $col-id) + - $compute-expression[Usage] = ALTER_TYPE_USING + - joinTargetNode($column, $column-Target, $column-Node) + - joinTargetNode($compute-expression, $compute-expression-Target, $compute-expression-Node) + - toAbsent($dependent-Target, $column-type-Target) + - $dependent-Node[CurrentStatus] = ABSENT + - $column-type-Node[CurrentStatus] = ABSENT + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($column-type, $column-type-Target, $column-type-Node) +- name: during alter column type, column names for old and new columns are swapped in the same stage + from: old-column-name-Node + kind: SameStagePrecedence + to: new-column-name-Node + query: + - $old-column-name[Type] = '*scpb.ColumnName' + - $new-column-name[Type] = '*scpb.ColumnName' + - $old-column-name-Target[TargetStatus] = ABSENT + - $old-column-name-Node[CurrentStatus] = ABSENT + - $new-column-name-Target[TargetStatus] = PUBLIC + - $new-column-name-Node[CurrentStatus] = PUBLIC + - joinOnDescID($old-column-name, $new-column-name, $table-id) + - $new-column-name[ColumnID] = $new-col-id + - $column[Type] = '*scpb.Column' + - $compute-expression[Type] = '*scpb.ColumnComputeExpression' + - joinOnColumnID($column, $compute-expression, $table-id, $new-col-id) + - $compute-expression[Usage] = ALTER_TYPE_USING + - joinTargetNode($column, $column-Target, $column-Node) + - joinTargetNode($compute-expression, $compute-expression-Target, $compute-expression-Node) + - joinTargetNode($old-column-name, $old-column-name-Target, $old-column-name-Node) + - joinTargetNode($new-column-name, $new-column-name-Target, $new-column-name-Node) +- name: ensure columns are in increasing order + from: later-column-Node + kind: Precedence + to: earlier-column-Node + query: + - $later-column[Type] = '*scpb.Column' + - joinTargetNode($later-column, $later-column-Target, $later-column-Node) + - $earlier-column[Type] = '*scpb.Column' + - joinOnDescID($later-column, $earlier-column, $table-id) + - ToPublicOrTransient($later-column-Target, $earlier-column-Target) + - $status IN [WRITE_ONLY, PUBLIC] + - $later-column-Node[CurrentStatus] = $status + - $earlier-column-Node[CurrentStatus] = $status + - SmallerColumnIDFirst(*scpb.Column, *scpb.Column)($later-column, $earlier-column) + - joinTargetNode($later-column, $later-column-Target, $later-column-Node) + - joinTargetNode($earlier-column, $earlier-column-Target, $earlier-column-Node) +- name: function name should be set before parent ids + from: function-name-Node + kind: Precedence + to: function-parent-Node + query: + - $function-name[Type] = '*scpb.FunctionName' + - $function-parent[Type] = '*scpb.SchemaChild' + - joinOnDescID($function-name, $function-parent, $function-id) + - ToPublicOrTransient($function-name-Target, $function-parent-Target) + - $function-name-Node[CurrentStatus] = PUBLIC + - $function-parent-Node[CurrentStatus] = PUBLIC + - joinTargetNode($function-name, $function-name-Target, $function-name-Node) + - joinTargetNode($function-parent, $function-parent-Target, $function-parent-Node) +- name: index data exists as soon as index accepts backfills + from: index-name-Node + kind: SameStagePrecedence + to: index-Node + query: + - $index-name[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex'] + - $index[Type] = '*scpb.IndexData' + - joinOnIndexID($index-name, $index, $table-id, $index-id) + - ToPublicOrTransient($index-name-Target, $index-Target) + - $index-name-Node[CurrentStatus] = BACKFILL_ONLY + - $index-Node[CurrentStatus] = PUBLIC + - joinTargetNode($index-name, $index-name-Target, $index-name-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: index dependents exist before index becomes public + from: dependent-Node + kind: Precedence + to: index-Node + query: + - $dependent[Type] IN ['*scpb.IndexColumn', '*scpb.IndexComment', '*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.IndexZoneConfig', '*scpb.PartitionZoneConfig', '*scpb.SecondaryIndexPartial'] + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - joinOnIndexID($dependent, $index, $table-id, $index-id) + - ToPublicOrTransient($dependent-Target, $index-Target) + - $dependent-Node[CurrentStatus] = PUBLIC + - $index-Node[CurrentStatus] = PUBLIC + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: index drop mutation visible before cleaning up index columns + from: index-Node + kind: Precedence + to: dependent-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - $dependent[Type] = '*scpb.IndexColumn' + - joinOnIndexID($index, $dependent, $table-id, $index-id) + - toAbsent($index-Target, $dependent-Target) + - $index-Node[CurrentStatus] = DELETE_ONLY + - $dependent-Node[CurrentStatus] = ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: index drop mutation visible before cleaning up index columns + from: index-Node + kind: Precedence + to: dependent-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - $dependent[Type] = '*scpb.IndexColumn' + - joinOnIndexID($index, $dependent, $table-id, $index-id) + - transient($index-Target, $dependent-Target) + - $index-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - $dependent-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: index drop mutation visible before cleaning up index columns + from: index-Node + kind: Precedence + to: dependent-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - $dependent[Type] = '*scpb.IndexColumn' + - joinOnIndexID($index, $dependent, $table-id, $index-id) + - $index-Target[TargetStatus] = TRANSIENT_ABSENT + - $index-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - $dependent-Target[TargetStatus] = ABSENT + - $dependent-Node[CurrentStatus] = ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: index drop mutation visible before cleaning up index columns + from: index-Node + kind: Precedence + to: dependent-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - $dependent[Type] = '*scpb.IndexColumn' + - joinOnIndexID($index, $dependent, $table-id, $index-id) + - $index-Target[TargetStatus] = ABSENT + - $index-Node[CurrentStatus] = DELETE_ONLY + - $dependent-Target[TargetStatus] = TRANSIENT_ABSENT + - $dependent-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: index existence precedes index dependents + from: index-Node + kind: Precedence + to: dependent-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex'] + - $dependent[Type] IN ['*scpb.IndexColumn', '*scpb.IndexComment', '*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.IndexZoneConfig', '*scpb.PartitionZoneConfig', '*scpb.SecondaryIndexPartial'] + - joinOnIndexID($index, $dependent, $table-id, $index-id) + - ToPublicOrTransient($index-Target, $dependent-Target) + - $index-Node[CurrentStatus] = BACKFILL_ONLY + - $dependent-Node[CurrentStatus] = PUBLIC + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: index is MERGED before its temp index starts to disappear + from: index-Node + kind: Precedence + to: temp-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex'] + - $temp[Type] = '*scpb.TemporaryIndex' + - joinOnDescID($index, $temp, $table-id) + - $index[TemporaryIndexID] = $temp-index-id + - $temp[IndexID] = $temp-index-id + - $index-Target[TargetStatus] IN [PUBLIC, TRANSIENT_ABSENT] + - $index-Node[CurrentStatus] = MERGED + - $temp-Target[TargetStatus] = TRANSIENT_ABSENT + - $temp-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($temp, $temp-Target, $temp-Node) +- name: index is ready to be validated before we validate constraint on it + from: index-Node + kind: Precedence + to: constraint-Node + query: + - $index[Type] = '*scpb.PrimaryIndex' + - $constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.UniqueWithoutIndexConstraint'] + - joinOnDescID($index, $constraint, $table-id) + - $index[IndexID] = $index-id-for-validation + - $constraint[IndexID] = $index-id-for-validation + - ToPublicOrTransient($index-Target, $constraint-Target) + - $index-Node[CurrentStatus] = VALIDATED + - $constraint-Node[CurrentStatus] = VALIDATED + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) +- name: index no longer public before dependents, excluding columns + from: index-Node + kind: Precedence + to: dependent-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - $dependent[Type] IN ['*scpb.IndexComment', '*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.IndexZoneConfig', '*scpb.PartitionZoneConfig', '*scpb.SecondaryIndexPartial'] + - joinOnIndexID($index, $dependent, $table-id, $index-id) + - toAbsent($index-Target, $dependent-Target) + - $index-Node[CurrentStatus] = VALIDATED + - $dependent-Node[CurrentStatus] = ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: index no longer public before dependents, excluding columns + from: index-Node + kind: Precedence + to: dependent-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - $dependent[Type] IN ['*scpb.IndexComment', '*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.IndexZoneConfig', '*scpb.PartitionZoneConfig', '*scpb.SecondaryIndexPartial'] + - joinOnIndexID($index, $dependent, $table-id, $index-id) + - transient($index-Target, $dependent-Target) + - $index-Node[CurrentStatus] = TRANSIENT_VALIDATED + - $dependent-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: index no longer public before dependents, excluding columns + from: index-Node + kind: Precedence + to: dependent-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - $dependent[Type] IN ['*scpb.IndexComment', '*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.IndexZoneConfig', '*scpb.PartitionZoneConfig', '*scpb.SecondaryIndexPartial'] + - joinOnIndexID($index, $dependent, $table-id, $index-id) + - $index-Target[TargetStatus] = TRANSIENT_ABSENT + - $index-Node[CurrentStatus] = TRANSIENT_VALIDATED + - $dependent-Target[TargetStatus] = ABSENT + - $dependent-Node[CurrentStatus] = ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: index no longer public before dependents, excluding columns + from: index-Node + kind: Precedence + to: dependent-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - $dependent[Type] IN ['*scpb.IndexComment', '*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.IndexZoneConfig', '*scpb.PartitionZoneConfig', '*scpb.SecondaryIndexPartial'] + - joinOnIndexID($index, $dependent, $table-id, $index-id) + - $index-Target[TargetStatus] = ABSENT + - $index-Node[CurrentStatus] = VALIDATED + - $dependent-Target[TargetStatus] = TRANSIENT_ABSENT + - $dependent-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: index no longer public before index name + from: index-Node + kind: Precedence + to: name-Node + query: + - $index[Type] = '*scpb.SecondaryIndex' + - $name[Type] = '*scpb.IndexName' + - joinOnIndexID($index, $name, $table-id, $index-id) + - toAbsent($index-Target, $name-Target) + - $index-Node[CurrentStatus] = DELETE_ONLY + - $name-Node[CurrentStatus] = ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($name, $name-Target, $name-Node) +- name: index no longer public before index name + from: index-Node + kind: Precedence + to: name-Node + query: + - $index[Type] = '*scpb.SecondaryIndex' + - $name[Type] = '*scpb.IndexName' + - joinOnIndexID($index, $name, $table-id, $index-id) + - transient($index-Target, $name-Target) + - $index-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - $name-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($name, $name-Target, $name-Node) +- name: index no longer public before index name + from: index-Node + kind: Precedence + to: name-Node + query: + - $index[Type] = '*scpb.SecondaryIndex' + - $name[Type] = '*scpb.IndexName' + - joinOnIndexID($index, $name, $table-id, $index-id) + - $index-Target[TargetStatus] = TRANSIENT_ABSENT + - $index-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - $name-Target[TargetStatus] = ABSENT + - $name-Node[CurrentStatus] = ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($name, $name-Target, $name-Node) +- name: index no longer public before index name + from: index-Node + kind: Precedence + to: name-Node + query: + - $index[Type] = '*scpb.SecondaryIndex' + - $name[Type] = '*scpb.IndexName' + - joinOnIndexID($index, $name, $table-id, $index-id) + - $index-Target[TargetStatus] = ABSENT + - $index-Node[CurrentStatus] = DELETE_ONLY + - $name-Target[TargetStatus] = TRANSIENT_ABSENT + - $name-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($name, $name-Target, $name-Node) +- name: index removed before garbage collection + from: index-Node + kind: Precedence + to: index-data-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - $index-data[Type] = '*scpb.IndexData' + - joinOnIndexID($index, $index-data, $table-id, $index-id) + - toAbsent($index-Target, $index-data-Target) + - $index-Node[CurrentStatus] = ABSENT + - $index-data-Node[CurrentStatus] = DROPPED + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($index-data, $index-data-Target, $index-data-Node) +- name: index removed before garbage collection + from: index-Node + kind: Precedence + to: index-data-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - $index-data[Type] = '*scpb.IndexData' + - joinOnIndexID($index, $index-data, $table-id, $index-id) + - transient($index-Target, $index-data-Target) + - $index-Node[CurrentStatus] = TRANSIENT_ABSENT + - $index-data-Node[CurrentStatus] = TRANSIENT_DROPPED + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($index-data, $index-data-Target, $index-data-Node) +- name: index removed before garbage collection + from: index-Node + kind: Precedence + to: index-data-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - $index-data[Type] = '*scpb.IndexData' + - joinOnIndexID($index, $index-data, $table-id, $index-id) + - $index-Target[TargetStatus] = TRANSIENT_ABSENT + - $index-Node[CurrentStatus] = TRANSIENT_ABSENT + - $index-data-Target[TargetStatus] = ABSENT + - $index-data-Node[CurrentStatus] = DROPPED + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($index-data, $index-data-Target, $index-data-Node) +- name: index removed before garbage collection + from: index-Node + kind: Precedence + to: index-data-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - $index-data[Type] = '*scpb.IndexData' + - joinOnIndexID($index, $index-data, $table-id, $index-id) + - $index-Target[TargetStatus] = ABSENT + - $index-Node[CurrentStatus] = ABSENT + - $index-data-Target[TargetStatus] = TRANSIENT_ABSENT + - $index-data-Node[CurrentStatus] = TRANSIENT_DROPPED + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($index-data, $index-data-Target, $index-data-Node) +- name: index-column added to index before index is backfilled + from: index-column-Node + kind: Precedence + to: index-Node + query: + - $index-column[Type] = '*scpb.IndexColumn' + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex'] + - joinOnIndexID($index-column, $index, $table-id, $index-id) + - ToPublicOrTransient($index-column-Target, $index-Target) + - $index-column-Node[CurrentStatus] = PUBLIC + - $index-Node[CurrentStatus] = BACKFILLED + - joinTargetNode($index-column, $index-column-Target, $index-column-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: index-column added to index before temp index receives writes + from: index-column-Node + kind: Precedence + to: index-Node + query: + - $index-column[Type] = '*scpb.IndexColumn' + - $index[Type] = '*scpb.TemporaryIndex' + - joinOnIndexID($index-column, $index, $table-id, $index-id) + - transient($index-column-Target, $index-Target) + - $index-column-Node[CurrentStatus] = PUBLIC + - $index-Node[CurrentStatus] = WRITE_ONLY + - joinTargetNode($index-column, $index-column-Target, $index-column-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: indexes containing column reach absent before column + from: index-Node + kind: Precedence + to: column-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex'] + - $column[Type] = '*scpb.Column' + - ColumnInIndex($index-column, $index, $table-id, $column-id, $index-id) + - joinOnColumnID($index-column, $column, $table-id, $column-id) + - descriptorIsNotBeingDropped-25.1($index-column) + - toAbsent($index-Target, $column-Target) + - $index-Node[CurrentStatus] = ABSENT + - $column-Node[CurrentStatus] = ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: indexes containing column reach absent before column + from: index-Node + kind: Precedence + to: column-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex'] + - $column[Type] = '*scpb.Column' + - ColumnInIndex($index-column, $index, $table-id, $column-id, $index-id) + - joinOnColumnID($index-column, $column, $table-id, $column-id) + - descriptorIsNotBeingDropped-25.1($index-column) + - transient($index-Target, $column-Target) + - $index-Node[CurrentStatus] = TRANSIENT_ABSENT + - $column-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: indexes containing column reach absent before column + from: index-Node + kind: Precedence + to: column-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex'] + - $column[Type] = '*scpb.Column' + - ColumnInIndex($index-column, $index, $table-id, $column-id, $index-id) + - joinOnColumnID($index-column, $column, $table-id, $column-id) + - descriptorIsNotBeingDropped-25.1($index-column) + - $index-Target[TargetStatus] = TRANSIENT_ABSENT + - $index-Node[CurrentStatus] = TRANSIENT_ABSENT + - $column-Target[TargetStatus] = ABSENT + - $column-Node[CurrentStatus] = ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: indexes containing column reach absent before column + from: index-Node + kind: Precedence + to: column-Node + query: + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex'] + - $column[Type] = '*scpb.Column' + - ColumnInIndex($index-column, $index, $table-id, $column-id, $index-id) + - joinOnColumnID($index-column, $column, $table-id, $column-id) + - descriptorIsNotBeingDropped-25.1($index-column) + - $index-Target[TargetStatus] = ABSENT + - $index-Node[CurrentStatus] = ABSENT + - $column-Target[TargetStatus] = TRANSIENT_ABSENT + - $column-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: namespace exist before schema parent + from: dependent-Node + kind: Precedence + to: relation-Node + query: + - $dependent[Type] = '*scpb.Namespace' + - $relation[Type] = '*scpb.SchemaParent' + - joinOnDescID($dependent, $relation, $schema-id) + - ToPublicOrTransient($dependent-Target, $relation-Target) + - $dependent-Node[CurrentStatus] = PUBLIC + - $relation-Node[CurrentStatus] = PUBLIC + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($relation, $relation-Target, $relation-Node) +- name: non-data dependents removed before descriptor + from: dependent-Node + kind: Precedence + to: descriptor-Node + query: + - $dependent[Type] IN ['*scpb.CheckConstraint', '*scpb.CheckConstraintUnvalidated', '*scpb.Column', '*scpb.ColumnComment', '*scpb.ColumnComputeExpression', '*scpb.ColumnDefaultExpression', '*scpb.ColumnFamily', '*scpb.ColumnName', '*scpb.ColumnNotNull', '*scpb.ColumnOnUpdateExpression', '*scpb.ColumnType', '*scpb.CompositeTypeAttrName', '*scpb.CompositeTypeAttrType', '*scpb.ConstraintComment', '*scpb.ConstraintWithoutIndexName', '*scpb.DatabaseComment', '*scpb.DatabaseRegionConfig', '*scpb.DatabaseRoleSetting', '*scpb.DatabaseZoneConfig', '*scpb.EnumTypeValue', '*scpb.ForeignKeyConstraint', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.FunctionBody', '*scpb.FunctionLeakProof', '*scpb.FunctionName', '*scpb.FunctionNullInputBehavior', '*scpb.FunctionSecurity', '*scpb.FunctionVolatility', '*scpb.IndexColumn', '*scpb.IndexComment', '*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.IndexZoneConfig', '*scpb.LDRJobIDs', '*scpb.NamedRangeZoneConfig', '*scpb.Namespace', '*scpb.Owner', '*scpb.PartitionZoneConfig', '*scpb.Policy', '*scpb.PolicyName', '*scpb.PolicyRole', '*scpb.PrimaryIndex', '*scpb.RowLevelTTL', '*scpb.SchemaChild', '*scpb.SchemaComment', '*scpb.SchemaParent', '*scpb.SecondaryIndex', '*scpb.SecondaryIndexPartial', '*scpb.SequenceOption', '*scpb.SequenceOwner', '*scpb.TableComment', '*scpb.TableLocalityGlobal', '*scpb.TableLocalityPrimaryRegion', '*scpb.TableLocalityRegionalByRow', '*scpb.TableLocalitySecondaryRegion', '*scpb.TablePartitioning', '*scpb.TableSchemaLocked', '*scpb.TableZoneConfig', '*scpb.TemporaryIndex', '*scpb.Trigger', '*scpb.TriggerDeps', '*scpb.TriggerEnabled', '*scpb.TriggerEvents', '*scpb.TriggerFunctionCall', '*scpb.TriggerName', '*scpb.TriggerTiming', '*scpb.TriggerTransition', '*scpb.TriggerWhen', '*scpb.TypeComment', '*scpb.UniqueWithoutIndexConstraint', '*scpb.UniqueWithoutIndexConstraintUnvalidated', '*scpb.UserPrivileges'] + - $descriptor[Type] IN ['*scpb.AliasType', '*scpb.CompositeType', '*scpb.Database', '*scpb.EnumType', '*scpb.Function', '*scpb.Schema', '*scpb.Sequence', '*scpb.Table', '*scpb.View'] + - joinOnDescID($dependent, $descriptor, $desc-id) + - toAbsent($dependent-Target, $descriptor-Target) + - $dependent-Node[CurrentStatus] = ABSENT + - $descriptor-Node[CurrentStatus] = ABSENT + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) + - joinTargetNode($descriptor, $descriptor-Target, $descriptor-Node) +- name: old index absent before new index public when swapping with transient + from: old-primary-index-Node + kind: Precedence + to: new-primary-index-Node + query: + - $old-primary-index[Type] = '*scpb.PrimaryIndex' + - $transient-primary-index[Type] = '*scpb.PrimaryIndex' + - $new-primary-index[Type] = '*scpb.PrimaryIndex' + - joinOnDescID($old-primary-index, $transient-primary-index, $table-id) + - $old-primary-index[IndexID] = $old-index-id + - $transient-primary-index[SourceIndexID] = $old-index-id + - joinOnDescID($transient-primary-index, $new-primary-index, $table-id) + - $transient-primary-index[IndexID] = $transient-index-id + - $new-primary-index[SourceIndexID] = $transient-index-id + - $old-primary-index-Target[TargetStatus] = ABSENT + - $old-primary-index-Node[CurrentStatus] = ABSENT + - $new-primary-index-Target[TargetStatus] = PUBLIC + - $new-primary-index-Node[CurrentStatus] = PUBLIC + - joinTargetNode($old-primary-index, $old-primary-index-Target, $old-primary-index-Node) + - joinTargetNode($new-primary-index, $new-primary-index-Target, $new-primary-index-Node) +- name: partial predicate removed right before secondary index when not dropping relation + from: partial-predicate-Node + kind: SameStagePrecedence + to: index-Node + query: + - $partial-predicate[Type] = '*scpb.SecondaryIndexPartial' + - descriptorIsNotBeingDropped-25.1($partial-predicate) + - $index[Type] = '*scpb.SecondaryIndex' + - joinOnIndexID($partial-predicate, $index, $table-id, $index-id) + - toAbsent($partial-predicate-Target, $index-Target) + - $partial-predicate-Node[CurrentStatus] = ABSENT + - $index-Node[CurrentStatus] = ABSENT + - joinTargetNode($partial-predicate, $partial-predicate-Target, $partial-predicate-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: partial predicate removed right before secondary index when not dropping relation + from: partial-predicate-Node + kind: SameStagePrecedence + to: index-Node + query: + - $partial-predicate[Type] = '*scpb.SecondaryIndexPartial' + - descriptorIsNotBeingDropped-25.1($partial-predicate) + - $index[Type] = '*scpb.SecondaryIndex' + - joinOnIndexID($partial-predicate, $index, $table-id, $index-id) + - transient($partial-predicate-Target, $index-Target) + - $partial-predicate-Node[CurrentStatus] = TRANSIENT_ABSENT + - $index-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($partial-predicate, $partial-predicate-Target, $partial-predicate-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: partial predicate removed right before secondary index when not dropping relation + from: partial-predicate-Node + kind: SameStagePrecedence + to: index-Node + query: + - $partial-predicate[Type] = '*scpb.SecondaryIndexPartial' + - descriptorIsNotBeingDropped-25.1($partial-predicate) + - $index[Type] = '*scpb.SecondaryIndex' + - joinOnIndexID($partial-predicate, $index, $table-id, $index-id) + - $partial-predicate-Target[TargetStatus] = TRANSIENT_ABSENT + - $partial-predicate-Node[CurrentStatus] = TRANSIENT_ABSENT + - $index-Target[TargetStatus] = ABSENT + - $index-Node[CurrentStatus] = ABSENT + - joinTargetNode($partial-predicate, $partial-predicate-Target, $partial-predicate-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: partial predicate removed right before secondary index when not dropping relation + from: partial-predicate-Node + kind: SameStagePrecedence + to: index-Node + query: + - $partial-predicate[Type] = '*scpb.SecondaryIndexPartial' + - descriptorIsNotBeingDropped-25.1($partial-predicate) + - $index[Type] = '*scpb.SecondaryIndex' + - joinOnIndexID($partial-predicate, $index, $table-id, $index-id) + - $partial-predicate-Target[TargetStatus] = ABSENT + - $partial-predicate-Node[CurrentStatus] = ABSENT + - $index-Target[TargetStatus] = TRANSIENT_ABSENT + - $index-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($partial-predicate, $partial-predicate-Target, $partial-predicate-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: primary index named right before index becomes public + from: index-name-Node + kind: SameStagePrecedence + to: index-Node + query: + - $index-name[Type] = '*scpb.IndexName' + - $index[Type] = '*scpb.PrimaryIndex' + - joinOnIndexID($index-name, $index, $table-id, $index-id) + - ToPublicOrTransient($index-name-Target, $index-Target) + - $index-name-Node[CurrentStatus] = PUBLIC + - $index-Node[CurrentStatus] = PUBLIC + - joinTargetNode($index-name, $index-name-Target, $index-name-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: primary index swap + from: old-index-Node + kind: SameStagePrecedence + to: new-index-Node + query: + - $old-index[Type] = '*scpb.PrimaryIndex' + - $new-index[Type] = '*scpb.PrimaryIndex' + - joinOnDescID($old-index, $new-index, $table-id) + - $old-index[IndexID] = $old-index-id + - $new-index[SourceIndexID] = $old-index-id + - $old-index-Target[TargetStatus] = ABSENT + - $old-index-Node[CurrentStatus] = VALIDATED + - $new-index-Target[TargetStatus] IN [PUBLIC, TRANSIENT_ABSENT] + - $new-index-Node[CurrentStatus] = PUBLIC + - joinTargetNode($old-index, $old-index-Target, $old-index-Node) + - joinTargetNode($new-index, $new-index-Target, $new-index-Node) +- name: primary index swap + from: old-index-Node + kind: SameStagePrecedence + to: new-index-Node + query: + - $old-index[Type] = '*scpb.PrimaryIndex' + - $new-index[Type] = '*scpb.PrimaryIndex' + - joinOnDescID($old-index, $new-index, $table-id) + - $old-index[IndexID] = $old-index-id + - $new-index[SourceIndexID] = $old-index-id + - $old-index-Target[TargetStatus] = TRANSIENT_ABSENT + - $old-index-Node[CurrentStatus] = TRANSIENT_VALIDATED + - $new-index-Target[TargetStatus] IN [PUBLIC, TRANSIENT_ABSENT] + - $new-index-Node[CurrentStatus] = PUBLIC + - joinTargetNode($old-index, $old-index-Target, $old-index-Node) + - joinTargetNode($new-index, $new-index-Target, $new-index-Node) +- name: primary index swap + from: new-index-Node + kind: SameStagePrecedence + to: old-index-Node + query: + - $new-index[Type] = '*scpb.PrimaryIndex' + - $old-index[Type] = '*scpb.PrimaryIndex' + - joinOnDescID($new-index, $old-index, $table-id) + - $new-index[SourceIndexID] = $old-index-id + - $old-index[IndexID] = $old-index-id + - $new-index-Target[TargetStatus] = ABSENT + - $new-index-Node[CurrentStatus] = VALIDATED + - $old-index-Target[TargetStatus] = PUBLIC + - $old-index-Node[CurrentStatus] = PUBLIC + - joinTargetNode($new-index, $new-index-Target, $new-index-Node) + - joinTargetNode($old-index, $old-index-Target, $old-index-Node) +- name: primary index with new columns should exist before secondary indexes + from: primary-index-Node + kind: Precedence + to: secondary-index-Node + query: + - $primary-index[Type] = '*scpb.PrimaryIndex' + - $secondary-index[Type] = '*scpb.SecondaryIndex' + - joinOnDescID($primary-index, $secondary-index, $table-id) + - $primary-index[IndexID] = $primary-index-id + - $secondary-index[SourceIndexID] = $primary-index-id + - ToPublicOrTransient($primary-index-Target, $secondary-index-Target) + - $primary-index-Node[CurrentStatus] = PUBLIC + - $secondary-index-Node[CurrentStatus] = BACKFILL_ONLY + - joinTargetNode($primary-index, $primary-index-Target, $primary-index-Node) + - joinTargetNode($secondary-index, $secondary-index-Target, $secondary-index-Node) +- name: primary index with new columns should exist before temp indexes + from: primary-index-Node + kind: Precedence + to: temp-index-Node + query: + - $primary-index[Type] = '*scpb.PrimaryIndex' + - $temp-index[Type] = '*scpb.TemporaryIndex' + - joinOnDescID($primary-index, $temp-index, $table-id) + - $primary-index[IndexID] = $primary-index-id + - $temp-index[SourceIndexID] = $primary-index-id + - ToPublicOrTransient($primary-index-Target, $temp-index-Target) + - $primary-index-Node[CurrentStatus] = PUBLIC + - $temp-index-Node[CurrentStatus] = DELETE_ONLY + - joinTargetNode($primary-index, $primary-index-Target, $primary-index-Node) + - joinTargetNode($temp-index, $temp-index-Target, $temp-index-Node) +- name: relation dropped before dependent column + from: descriptor-Node + kind: Precedence + to: column-Node + query: + - $descriptor[Type] IN ['*scpb.Table', '*scpb.View', '*scpb.Sequence'] + - $column[Type] = '*scpb.Column' + - joinOnDescID($descriptor, $column, $desc-id) + - toAbsent($descriptor-Target, $column-Target) + - $descriptor-Node[CurrentStatus] = DROPPED + - $column-Node[CurrentStatus] = WRITE_ONLY + - joinTargetNode($descriptor, $descriptor-Target, $descriptor-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: relation dropped before dependent constraint + from: descriptor-Node + kind: Precedence + to: constraint-Node + query: + - $descriptor[Type] = '*scpb.Table' + - $constraint[Type] = '*scpb.ColumnNotNull' + - joinOnDescID($descriptor, $constraint, $desc-id) + - toAbsent($descriptor-Target, $constraint-Target) + - $descriptor-Node[CurrentStatus] = DROPPED + - $constraint-Node[CurrentStatus] = VALIDATED + - joinTargetNode($descriptor, $descriptor-Target, $descriptor-Node) + - joinTargetNode($constraint, $constraint-Target, $constraint-Node) +- name: relation dropped before dependent index + from: descriptor-Node + kind: Precedence + to: index-Node + query: + - $descriptor[Type] IN ['*scpb.Table', '*scpb.View'] + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - joinOnDescID($descriptor, $index, $desc-id) + - toAbsent($descriptor-Target, $index-Target) + - $descriptor-Node[CurrentStatus] = DROPPED + - $index-Node[CurrentStatus] = VALIDATED + - joinTargetNode($descriptor, $descriptor-Target, $descriptor-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: remove columns from index right before removing index + from: index-column-Node + kind: Precedence + to: index-Node + query: + - $index-column[Type] = '*scpb.IndexColumn' + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - joinOnIndexID($index-column, $index, $table-id, $index-id) + - toAbsent($index-column-Target, $index-Target) + - $index-column-Node[CurrentStatus] = DELETE_ONLY + - $index-Node[CurrentStatus] = ABSENT + - joinTargetNode($index-column, $index-column-Target, $index-column-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: remove columns from index right before removing index + from: index-column-Node + kind: Precedence + to: index-Node + query: + - $index-column[Type] = '*scpb.IndexColumn' + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - joinOnIndexID($index-column, $index, $table-id, $index-id) + - transient($index-column-Target, $index-Target) + - $index-column-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - $index-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($index-column, $index-column-Target, $index-column-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: remove columns from index right before removing index + from: index-column-Node + kind: Precedence + to: index-Node + query: + - $index-column[Type] = '*scpb.IndexColumn' + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - joinOnIndexID($index-column, $index, $table-id, $index-id) + - $index-column-Target[TargetStatus] = TRANSIENT_ABSENT + - $index-column-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - $index-Target[TargetStatus] = ABSENT + - $index-Node[CurrentStatus] = ABSENT + - joinTargetNode($index-column, $index-column-Target, $index-column-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: remove columns from index right before removing index + from: index-column-Node + kind: Precedence + to: index-Node + query: + - $index-column[Type] = '*scpb.IndexColumn' + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex', '*scpb.TemporaryIndex'] + - joinOnIndexID($index-column, $index, $table-id, $index-id) + - $index-column-Target[TargetStatus] = ABSENT + - $index-column-Node[CurrentStatus] = DELETE_ONLY + - $index-Target[TargetStatus] = TRANSIENT_ABSENT + - $index-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($index-column, $index-column-Target, $index-column-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: replacement secondary index should be validated before the old one becomes invisible + from: new-index-Node + kind: Precedence + to: old-index-Node + query: + - $old-index[Type] = '*scpb.SecondaryIndex' + - $new-index[Type] = '*scpb.SecondaryIndex' + - $old-index-Target[TargetStatus] = ABSENT + - $new-index-Target[TargetStatus] IN [PUBLIC, TRANSIENT_ABSENT] + - joinOnDescID($old-index, $new-index, $table-id) + - $new-index[IndexID] = $index-id + - $old-index[IndexID] = $old-index-id + - $new-index[RecreateSourceIndexID] = $old-index-id + - joinTargetNode($old-index, $old-index-Target, $old-index-Node) + - joinTargetNode($new-index, $new-index-Target, $new-index-Node) + - $new-index-Node[CurrentStatus] = PUBLIC + - $old-index-Node[CurrentStatus] = VALIDATED + - joinTargetNode($new-index, $new-index-Target, $new-index-Node) + - joinTargetNode($old-index, $old-index-Target, $old-index-Node) +- name: schedule all GC jobs for a descriptor in the same stage + from: data-a-Node + kind: SameStagePrecedence + to: data-b-Node + query: + - $data-a[Type] IN ['*scpb.DatabaseData', '*scpb.IndexData', '*scpb.TableData'] + - $data-b[Type] IN ['*scpb.DatabaseData', '*scpb.IndexData', '*scpb.TableData'] + - joinOnDescID($data-a, $data-b, $desc-id) + - SmallerIDsFirst(scpb.Element, scpb.Element)($data-a, $data-b) + - toAbsent($data-a-Target, $data-b-Target) + - $data-a-Node[CurrentStatus] = DROPPED + - $data-b-Node[CurrentStatus] = DROPPED + - joinTargetNode($data-a, $data-a-Target, $data-a-Node) + - joinTargetNode($data-b, $data-b-Target, $data-b-Node) +- name: schedule all GC jobs for a descriptor in the same stage + from: data-a-Node + kind: SameStagePrecedence + to: data-b-Node + query: + - $data-a[Type] IN ['*scpb.DatabaseData', '*scpb.IndexData', '*scpb.TableData'] + - $data-b[Type] IN ['*scpb.DatabaseData', '*scpb.IndexData', '*scpb.TableData'] + - joinOnDescID($data-a, $data-b, $desc-id) + - SmallerIDsFirst(scpb.Element, scpb.Element)($data-a, $data-b) + - transient($data-a-Target, $data-b-Target) + - $data-a-Node[CurrentStatus] = TRANSIENT_DROPPED + - $data-b-Node[CurrentStatus] = TRANSIENT_DROPPED + - joinTargetNode($data-a, $data-a-Target, $data-a-Node) + - joinTargetNode($data-b, $data-b-Target, $data-b-Node) +- name: schedule all GC jobs for a descriptor in the same stage + from: data-a-Node + kind: SameStagePrecedence + to: data-b-Node + query: + - $data-a[Type] IN ['*scpb.DatabaseData', '*scpb.IndexData', '*scpb.TableData'] + - $data-b[Type] IN ['*scpb.DatabaseData', '*scpb.IndexData', '*scpb.TableData'] + - joinOnDescID($data-a, $data-b, $desc-id) + - SmallerIDsFirst(scpb.Element, scpb.Element)($data-a, $data-b) + - $data-a-Target[TargetStatus] = TRANSIENT_ABSENT + - $data-a-Node[CurrentStatus] = TRANSIENT_DROPPED + - $data-b-Target[TargetStatus] = ABSENT + - $data-b-Node[CurrentStatus] = DROPPED + - joinTargetNode($data-a, $data-a-Target, $data-a-Node) + - joinTargetNode($data-b, $data-b-Target, $data-b-Node) +- name: schedule all GC jobs for a descriptor in the same stage + from: data-a-Node + kind: SameStagePrecedence + to: data-b-Node + query: + - $data-a[Type] IN ['*scpb.DatabaseData', '*scpb.IndexData', '*scpb.TableData'] + - $data-b[Type] IN ['*scpb.DatabaseData', '*scpb.IndexData', '*scpb.TableData'] + - joinOnDescID($data-a, $data-b, $desc-id) + - SmallerIDsFirst(scpb.Element, scpb.Element)($data-a, $data-b) + - $data-a-Target[TargetStatus] = ABSENT + - $data-a-Node[CurrentStatus] = DROPPED + - $data-b-Target[TargetStatus] = TRANSIENT_ABSENT + - $data-b-Node[CurrentStatus] = TRANSIENT_DROPPED + - joinTargetNode($data-a, $data-a-Target, $data-a-Node) + - joinTargetNode($data-b, $data-b-Target, $data-b-Node) +- name: secondary index named before public (with index swap) + from: index-Node + kind: Precedence + to: index-name-Node + query: + - $index-name[Type] = '*scpb.IndexName' + - $index[Type] = '*scpb.SecondaryIndex' + - joinOnIndexID($index, $index-name, $table-id, $index-id) + - ToPublicOrTransient($index-Target, $index-name-Target) + - $index-Node[CurrentStatus] = VALIDATED + - $index-name-Node[CurrentStatus] = PUBLIC + - $old-index[Type] = '*scpb.SecondaryIndex' + - $new-index[Type] = '*scpb.SecondaryIndex' + - $old-index-Target[TargetStatus] = ABSENT + - $new-index-Target[TargetStatus] IN [PUBLIC, TRANSIENT_ABSENT] + - joinOnDescID($old-index, $new-index, $table-id) + - $new-index[IndexID] = $index-id + - $old-index[IndexID] = $old-index-id + - $new-index[RecreateSourceIndexID] = $old-index-id + - joinTargetNode($old-index, $old-index-Target, $old-index-Node) + - joinTargetNode($new-index, $new-index-Target, $new-index-Node) + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($index-name, $index-name-Target, $index-name-Node) +- name: secondary index named before validation (without index swap) + from: index-name-Node + kind: Precedence + to: index-Node + query: + - $index-name[Type] = '*scpb.IndexName' + - $index[Type] = '*scpb.SecondaryIndex' + - joinOnIndexID($index-name, $index, $table-id, $index-id) + - no secondary index swap is on going($table-id, $index-id) + - ToPublicOrTransient($index-name-Target, $index-Target) + - $index-name-Node[CurrentStatus] = PUBLIC + - $index-Node[CurrentStatus] = VALIDATED + - joinTargetNode($index-name, $index-name-Target, $index-name-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: secondary index partial no longer public before referenced column + from: secondary-partial-index-Node + kind: Precedence + to: column-Node + query: + - $secondary-partial-index[Type] = '*scpb.SecondaryIndex' + - $column[Type] = '*scpb.Column' + - joinOnDescID($secondary-partial-index, $column, $table-id) + - descriptorIsNotBeingDropped-25.1($secondary-partial-index) + - secondaryIndexReferencesColumn(*scpb.SecondaryIndex, *scpb.Column)($secondary-partial-index, $column) + - toAbsent($secondary-partial-index-Target, $column-Target) + - $secondary-partial-index-Node[CurrentStatus] = DELETE_ONLY + - $column-Node[CurrentStatus] = WRITE_ONLY + - joinTargetNode($secondary-partial-index, $secondary-partial-index-Target, $secondary-partial-index-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: secondary index partial no longer public before referenced column + from: secondary-partial-index-Node + kind: Precedence + to: column-Node + query: + - $secondary-partial-index[Type] = '*scpb.SecondaryIndex' + - $column[Type] = '*scpb.Column' + - joinOnDescID($secondary-partial-index, $column, $table-id) + - descriptorIsNotBeingDropped-25.1($secondary-partial-index) + - secondaryIndexReferencesColumn(*scpb.SecondaryIndex, *scpb.Column)($secondary-partial-index, $column) + - transient($secondary-partial-index-Target, $column-Target) + - $secondary-partial-index-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - $column-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - joinTargetNode($secondary-partial-index, $secondary-partial-index-Target, $secondary-partial-index-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: secondary index partial no longer public before referenced column + from: secondary-partial-index-Node + kind: Precedence + to: column-Node + query: + - $secondary-partial-index[Type] = '*scpb.SecondaryIndex' + - $column[Type] = '*scpb.Column' + - joinOnDescID($secondary-partial-index, $column, $table-id) + - descriptorIsNotBeingDropped-25.1($secondary-partial-index) + - secondaryIndexReferencesColumn(*scpb.SecondaryIndex, *scpb.Column)($secondary-partial-index, $column) + - $secondary-partial-index-Target[TargetStatus] = TRANSIENT_ABSENT + - $secondary-partial-index-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - $column-Target[TargetStatus] = ABSENT + - $column-Node[CurrentStatus] = WRITE_ONLY + - joinTargetNode($secondary-partial-index, $secondary-partial-index-Target, $secondary-partial-index-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: secondary index partial no longer public before referenced column + from: secondary-partial-index-Node + kind: Precedence + to: column-Node + query: + - $secondary-partial-index[Type] = '*scpb.SecondaryIndex' + - $column[Type] = '*scpb.Column' + - joinOnDescID($secondary-partial-index, $column, $table-id) + - descriptorIsNotBeingDropped-25.1($secondary-partial-index) + - secondaryIndexReferencesColumn(*scpb.SecondaryIndex, *scpb.Column)($secondary-partial-index, $column) + - $secondary-partial-index-Target[TargetStatus] = ABSENT + - $secondary-partial-index-Node[CurrentStatus] = DELETE_ONLY + - $column-Target[TargetStatus] = TRANSIENT_ABSENT + - $column-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - joinTargetNode($secondary-partial-index, $secondary-partial-index-Target, $secondary-partial-index-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: secondary index partial no longer public before referenced column + from: secondary-partial-index-Node + kind: Precedence + to: column-Node + query: + - $secondary-partial-index[Type] = '*scpb.SecondaryIndexPartial' + - $column[Type] = '*scpb.Column' + - joinOnDescID($secondary-partial-index, $column, $table-id) + - descriptorIsNotBeingDropped-25.1($secondary-partial-index) + - secondaryIndexReferencesColumn(*scpb.SecondaryIndexPartial, *scpb.Column)($secondary-partial-index, $column) + - toAbsent($secondary-partial-index-Target, $column-Target) + - $secondary-partial-index-Node[CurrentStatus] = ABSENT + - $column-Node[CurrentStatus] = WRITE_ONLY + - joinTargetNode($secondary-partial-index, $secondary-partial-index-Target, $secondary-partial-index-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: secondary index partial no longer public before referenced column + from: secondary-partial-index-Node + kind: Precedence + to: column-Node + query: + - $secondary-partial-index[Type] = '*scpb.SecondaryIndexPartial' + - $column[Type] = '*scpb.Column' + - joinOnDescID($secondary-partial-index, $column, $table-id) + - descriptorIsNotBeingDropped-25.1($secondary-partial-index) + - secondaryIndexReferencesColumn(*scpb.SecondaryIndexPartial, *scpb.Column)($secondary-partial-index, $column) + - transient($secondary-partial-index-Target, $column-Target) + - $secondary-partial-index-Node[CurrentStatus] = TRANSIENT_ABSENT + - $column-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - joinTargetNode($secondary-partial-index, $secondary-partial-index-Target, $secondary-partial-index-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: secondary index partial no longer public before referenced column + from: secondary-partial-index-Node + kind: Precedence + to: column-Node + query: + - $secondary-partial-index[Type] = '*scpb.SecondaryIndexPartial' + - $column[Type] = '*scpb.Column' + - joinOnDescID($secondary-partial-index, $column, $table-id) + - descriptorIsNotBeingDropped-25.1($secondary-partial-index) + - secondaryIndexReferencesColumn(*scpb.SecondaryIndexPartial, *scpb.Column)($secondary-partial-index, $column) + - $secondary-partial-index-Target[TargetStatus] = TRANSIENT_ABSENT + - $secondary-partial-index-Node[CurrentStatus] = TRANSIENT_ABSENT + - $column-Target[TargetStatus] = ABSENT + - $column-Node[CurrentStatus] = WRITE_ONLY + - joinTargetNode($secondary-partial-index, $secondary-partial-index-Target, $secondary-partial-index-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: secondary index partial no longer public before referenced column + from: secondary-partial-index-Node + kind: Precedence + to: column-Node + query: + - $secondary-partial-index[Type] = '*scpb.SecondaryIndexPartial' + - $column[Type] = '*scpb.Column' + - joinOnDescID($secondary-partial-index, $column, $table-id) + - descriptorIsNotBeingDropped-25.1($secondary-partial-index) + - secondaryIndexReferencesColumn(*scpb.SecondaryIndexPartial, *scpb.Column)($secondary-partial-index, $column) + - $secondary-partial-index-Target[TargetStatus] = ABSENT + - $secondary-partial-index-Node[CurrentStatus] = ABSENT + - $column-Target[TargetStatus] = TRANSIENT_ABSENT + - $column-Node[CurrentStatus] = TRANSIENT_WRITE_ONLY + - joinTargetNode($secondary-partial-index, $secondary-partial-index-Target, $secondary-partial-index-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: secondary index should be validated before dependent view can be absent + from: index-Node + kind: Precedence + to: view-Node + query: + - $index[Type] = '*scpb.SecondaryIndex' + - $view[Type] = '*scpb.View' + - viewReferencesIndex(*scpb.SecondaryIndex, *scpb.View)($index, $view) + - toAbsent($index-Target, $view-Target) + - $index-Node[CurrentStatus] = VALIDATED + - $view-Node[CurrentStatus] = ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($view, $view-Target, $view-Node) +- name: secondary index should be validated before dependent view can be absent + from: index-Node + kind: Precedence + to: view-Node + query: + - $index[Type] = '*scpb.SecondaryIndex' + - $view[Type] = '*scpb.View' + - viewReferencesIndex(*scpb.SecondaryIndex, *scpb.View)($index, $view) + - transient($index-Target, $view-Target) + - $index-Node[CurrentStatus] = TRANSIENT_VALIDATED + - $view-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($view, $view-Target, $view-Node) +- name: secondary index should be validated before dependent view can be absent + from: index-Node + kind: Precedence + to: view-Node + query: + - $index[Type] = '*scpb.SecondaryIndex' + - $view[Type] = '*scpb.View' + - viewReferencesIndex(*scpb.SecondaryIndex, *scpb.View)($index, $view) + - $index-Target[TargetStatus] = TRANSIENT_ABSENT + - $index-Node[CurrentStatus] = TRANSIENT_VALIDATED + - $view-Target[TargetStatus] = ABSENT + - $view-Node[CurrentStatus] = ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($view, $view-Target, $view-Node) +- name: secondary index should be validated before dependent view can be absent + from: index-Node + kind: Precedence + to: view-Node + query: + - $index[Type] = '*scpb.SecondaryIndex' + - $view[Type] = '*scpb.View' + - viewReferencesIndex(*scpb.SecondaryIndex, *scpb.View)($index, $view) + - $index-Target[TargetStatus] = ABSENT + - $index-Node[CurrentStatus] = VALIDATED + - $view-Target[TargetStatus] = TRANSIENT_ABSENT + - $view-Node[CurrentStatus] = TRANSIENT_ABSENT + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($view, $view-Target, $view-Node) +- name: secondary indexes containing column as key reach write-only before column + from: index-Node + kind: Precedence + to: column-Node + query: + - $index[Type] = '*scpb.SecondaryIndex' + - $column[Type] = '*scpb.Column' + - ColumnInIndex($index-column, $index, $table-id, $column-id, $index-id) + - joinOnColumnID($index-column, $column, $table-id, $column-id) + - toAbsent($index-Target, $column-Target) + - $index-Node[CurrentStatus] = VALIDATED + - $column-Node[CurrentStatus] = WRITE_ONLY + - descriptorIsNotBeingDropped-25.1($index-column) + - isIndexKeyColumnKey(*scpb.IndexColumn)($index-column) + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: simple constraint public right before its dependents + from: simple-constraint-Node + kind: SameStagePrecedence + to: dependent-Node + query: + - $simple-constraint[Type] = '*scpb.ColumnNotNull' + - $dependent[Type] IN ['*scpb.ConstraintComment', '*scpb.ConstraintWithoutIndexName'] + - joinOnConstraintID($simple-constraint, $dependent, $table-id, $constraint-id) + - ToPublicOrTransient($simple-constraint-Target, $dependent-Target) + - $simple-constraint-Node[CurrentStatus] = PUBLIC + - $dependent-Node[CurrentStatus] = PUBLIC + - joinTargetNode($simple-constraint, $simple-constraint-Target, $simple-constraint-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: simple constraint visible before name + from: simple-constraint-Node + kind: Precedence + to: constraint-name-Node + query: + - $simple-constraint[Type] IN ['*scpb.CheckConstraint', '*scpb.CheckConstraintUnvalidated', '*scpb.ColumnNotNull', '*scpb.ForeignKeyConstraint', '*scpb.ForeignKeyConstraintUnvalidated', '*scpb.UniqueWithoutIndexConstraint', '*scpb.UniqueWithoutIndexConstraintUnvalidated'] + - $constraint-name[Type] = '*scpb.ConstraintWithoutIndexName' + - joinOnConstraintID($simple-constraint, $constraint-name, $table-id, $constraint-id) + - ToPublicOrTransient($simple-constraint-Target, $constraint-name-Target) + - $simple-constraint-Node[CurrentStatus] = WRITE_ONLY + - $constraint-name-Node[CurrentStatus] = PUBLIC + - joinTargetNode($simple-constraint, $simple-constraint-Target, $simple-constraint-Node) + - joinTargetNode($constraint-name, $constraint-name-Target, $constraint-name-Node) +- name: swapped primary index public before column + from: index-Node + kind: Precedence + to: column-Node + query: + - $index[Type] = '*scpb.PrimaryIndex' + - $column[Type] = '*scpb.Column' + - ColumnInSwappedInPrimaryIndex($index-column, $index, $table-id, $column-id, $index-id) + - joinOnColumnID($index-column, $column, $table-id, $column-id) + - ToPublicOrTransient($index-Target, $column-Target) + - $index-Node[CurrentStatus] = PUBLIC + - $column-Node[CurrentStatus] = PUBLIC + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($column, $column-Target, $column-Node) +- name: table added right before data element + from: table-Node + kind: Precedence + to: data-Node + query: + - $table[Type] IN ['*scpb.AliasType', '*scpb.CompositeType', '*scpb.Database', '*scpb.EnumType', '*scpb.Function', '*scpb.Schema', '*scpb.Sequence', '*scpb.Table', '*scpb.View'] + - $data[Type] IN ['*scpb.DatabaseData', '*scpb.IndexData', '*scpb.TableData'] + - joinOnDescID($table, $data, $table-id) + - ToPublicOrTransient($table-Target, $data-Target) + - $table-Node[CurrentStatus] = PUBLIC + - $data-Node[CurrentStatus] = PUBLIC + - joinTargetNode($table, $table-Target, $table-Node) + - joinTargetNode($data, $data-Target, $data-Node) +- name: table removed right before garbage collection + from: table-Node + kind: SameStagePrecedence + to: data-Node + query: + - $table[Type] IN ['*scpb.AliasType', '*scpb.CompositeType', '*scpb.Database', '*scpb.EnumType', '*scpb.Function', '*scpb.Schema', '*scpb.Sequence', '*scpb.Table', '*scpb.View'] + - $data[Type] = '*scpb.TableData' + - joinOnDescID($table, $data, $table-id) + - toAbsent($table-Target, $data-Target) + - $table-Node[CurrentStatus] = ABSENT + - $data-Node[CurrentStatus] = DROPPED + - joinTargetNode($table, $table-Target, $table-Node) + - joinTargetNode($data, $data-Target, $data-Node) +- name: temp index data exists as soon as temp index accepts writes + from: temp-index-Node + kind: SameStagePrecedence + to: temp-index-data-Node + query: + - $temp-index[Type] = '*scpb.TemporaryIndex' + - $temp-index-data[Type] = '*scpb.IndexData' + - joinOnIndexID($temp-index, $temp-index-data, $table-id, $index-id) + - ToPublicOrTransient($temp-index-Target, $temp-index-data-Target) + - $temp-index-Node[CurrentStatus] = WRITE_ONLY + - $temp-index-data-Node[CurrentStatus] = PUBLIC + - joinTargetNode($temp-index, $temp-index-Target, $temp-index-Node) + - joinTargetNode($temp-index-data, $temp-index-data-Target, $temp-index-data-Node) +- name: temp index disappeared before its master index reaches WRITE_ONLY + from: temp-Node + kind: Precedence + to: index-Node + query: + - $temp[Type] = '*scpb.TemporaryIndex' + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex'] + - joinOnDescID($temp, $index, $table-id) + - $temp[IndexID] = $temp-index-id + - $index[TemporaryIndexID] = $temp-index-id + - $temp-Target[TargetStatus] = TRANSIENT_ABSENT + - $temp-Node[CurrentStatus] = TRANSIENT_DELETE_ONLY + - $index-Target[TargetStatus] IN [PUBLIC, TRANSIENT_ABSENT] + - $index-Node[CurrentStatus] = WRITE_ONLY + - joinTargetNode($temp, $temp-Target, $temp-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: temp index existence precedes index dependents + from: index-Node + kind: Precedence + to: dependent-Node + query: + - $index[Type] = '*scpb.TemporaryIndex' + - $dependent[Type] IN ['*scpb.IndexColumn', '*scpb.IndexComment', '*scpb.IndexName', '*scpb.IndexPartitioning', '*scpb.IndexZoneConfig', '*scpb.PartitionZoneConfig', '*scpb.SecondaryIndexPartial'] + - joinOnIndexID($index, $dependent, $table-id, $index-id) + - ToPublicOrTransient($index-Target, $dependent-Target) + - $index-Node[CurrentStatus] = DELETE_ONLY + - $dependent-Node[CurrentStatus] = PUBLIC + - joinTargetNode($index, $index-Target, $index-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: temp index is WRITE_ONLY before backfill + from: temp-Node + kind: Precedence + to: index-Node + query: + - $temp[Type] = '*scpb.TemporaryIndex' + - $index[Type] IN ['*scpb.PrimaryIndex', '*scpb.SecondaryIndex'] + - joinOnDescID($temp, $index, $table-id) + - $temp[IndexID] = $temp-index-id + - $index[TemporaryIndexID] = $temp-index-id + - $temp-Target[TargetStatus] = TRANSIENT_ABSENT + - $index-Target[TargetStatus] IN [PUBLIC, TRANSIENT_ABSENT] + - $temp-Node[CurrentStatus] = WRITE_ONLY + - $index-Node[CurrentStatus] = BACKFILLED + - joinTargetNode($temp, $temp-Target, $temp-Node) + - joinTargetNode($index, $index-Target, $index-Node) +- name: trigger public before its dependents + from: trigger-Node + kind: Precedence + to: dependent-Node + query: + - $trigger[Type] = '*scpb.Trigger' + - $dependent[Type] IN ['*scpb.TriggerDeps', '*scpb.TriggerEnabled', '*scpb.TriggerEvents', '*scpb.TriggerFunctionCall', '*scpb.TriggerName', '*scpb.TriggerTiming', '*scpb.TriggerTransition', '*scpb.TriggerWhen'] + - joinOnTriggerID($trigger, $dependent, $table-id, $trigger-id) + - ToPublicOrTransient($trigger-Target, $dependent-Target) + - $trigger-Node[CurrentStatus] = PUBLIC + - $dependent-Node[CurrentStatus] = PUBLIC + - joinTargetNode($trigger, $trigger-Target, $trigger-Node) + - joinTargetNode($dependent, $dependent-Target, $dependent-Node) +- name: trigger removed before dependents + from: trigger-Node + kind: Precedence + to: dependents-Node + query: + - $dependents[Type] = '*scpb.Trigger' + - $trigger[Type] IN ['*scpb.TriggerDeps', '*scpb.TriggerEnabled', '*scpb.TriggerEvents', '*scpb.TriggerFunctionCall', '*scpb.TriggerName', '*scpb.TriggerTiming', '*scpb.TriggerTransition', '*scpb.TriggerWhen'] + - joinOnTriggerID($trigger, $dependents, $table-id, $trigger-id) + - toAbsent($trigger-Target, $dependents-Target) + - $trigger-Node[CurrentStatus] = ABSENT + - $dependents-Node[CurrentStatus] = PUBLIC + - joinTargetNode($trigger, $trigger-Target, $trigger-Node) + - joinTargetNode($dependents, $dependents-Target, $dependents-Node) +- name: trigger removed before dependents + from: trigger-Node + kind: Precedence + to: dependents-Node + query: + - $dependents[Type] = '*scpb.Trigger' + - $trigger[Type] IN ['*scpb.TriggerDeps', '*scpb.TriggerEnabled', '*scpb.TriggerEvents', '*scpb.TriggerFunctionCall', '*scpb.TriggerName', '*scpb.TriggerTiming', '*scpb.TriggerTransition', '*scpb.TriggerWhen'] + - joinOnTriggerID($trigger, $dependents, $table-id, $trigger-id) + - transient($trigger-Target, $dependents-Target) + - $trigger-Node[CurrentStatus] = TRANSIENT_ABSENT + - $dependents-Node[CurrentStatus] = TRANSIENT_PUBLIC + - joinTargetNode($trigger, $trigger-Target, $trigger-Node) + - joinTargetNode($dependents, $dependents-Target, $dependents-Node) +- name: trigger removed before dependents + from: trigger-Node + kind: Precedence + to: dependents-Node + query: + - $dependents[Type] = '*scpb.Trigger' + - $trigger[Type] IN ['*scpb.TriggerDeps', '*scpb.TriggerEnabled', '*scpb.TriggerEvents', '*scpb.TriggerFunctionCall', '*scpb.TriggerName', '*scpb.TriggerTiming', '*scpb.TriggerTransition', '*scpb.TriggerWhen'] + - joinOnTriggerID($trigger, $dependents, $table-id, $trigger-id) + - $trigger-Target[TargetStatus] = TRANSIENT_ABSENT + - $trigger-Node[CurrentStatus] = TRANSIENT_ABSENT + - $dependents-Target[TargetStatus] = ABSENT + - $dependents-Node[CurrentStatus] = PUBLIC + - joinTargetNode($trigger, $trigger-Target, $trigger-Node) + - joinTargetNode($dependents, $dependents-Target, $dependents-Node) +- name: trigger removed before dependents + from: trigger-Node + kind: Precedence + to: dependents-Node + query: + - $dependents[Type] = '*scpb.Trigger' + - $trigger[Type] IN ['*scpb.TriggerDeps', '*scpb.TriggerEnabled', '*scpb.TriggerEvents', '*scpb.TriggerFunctionCall', '*scpb.TriggerName', '*scpb.TriggerTiming', '*scpb.TriggerTransition', '*scpb.TriggerWhen'] + - joinOnTriggerID($trigger, $dependents, $table-id, $trigger-id) + - $trigger-Target[TargetStatus] = ABSENT + - $trigger-Node[CurrentStatus] = ABSENT + - $dependents-Target[TargetStatus] = TRANSIENT_ABSENT + - $dependents-Node[CurrentStatus] = TRANSIENT_PUBLIC + - joinTargetNode($trigger, $trigger-Target, $trigger-Node) + - joinTargetNode($dependents, $dependents-Target, $dependents-Node) diff --git a/pkg/sql/schemachanger/scplan/plan.go b/pkg/sql/schemachanger/scplan/plan.go index 5d92c524931c..1f7b43f9b765 100644 --- a/pkg/sql/schemachanger/scplan/plan.go +++ b/pkg/sql/schemachanger/scplan/plan.go @@ -17,6 +17,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/rules" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/rules/current" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/rules/release_24_3" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/rules/release_25_1" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/scgraph" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/scstage" "github.com/cockroachdb/cockroach/pkg/util/log" @@ -155,6 +156,7 @@ type rulesForRelease struct { // with the newest supported version first. var rulesForReleases = []rulesForRelease{ {activeVersion: clusterversion.Latest, rulesRegistry: current.GetRegistry()}, + {activeVersion: clusterversion.V25_1, rulesRegistry: release_25_1.GetRegistry()}, {activeVersion: clusterversion.V24_3, rulesRegistry: release_24_3.GetRegistry()}, } diff --git a/pkg/sql/schemachanger/screl/scalars.go b/pkg/sql/schemachanger/screl/scalars.go index 77f9fa84da02..fe37f82993c1 100644 --- a/pkg/sql/schemachanger/screl/scalars.go +++ b/pkg/sql/schemachanger/screl/scalars.go @@ -130,7 +130,10 @@ func VersionSupportsElementUse(el scpb.Element, version clusterversion.ClusterVe *scpb.TriggerWhen, *scpb.TriggerFunctionCall, *scpb.TriggerDeps: // These elements need v24.3 so they can be used without checking any version gates. return true - case *scpb.NamedRangeZoneConfig, *scpb.Policy, *scpb.PolicyName, *scpb.PolicyRole: + case *scpb.NamedRangeZoneConfig, *scpb.Policy, *scpb.PolicyName: + return version.IsActive(clusterversion.V25_1) + case *scpb.PolicyRole: + // TODO(spilchen): switch this to V25_2 when it is available return version.IsActive(clusterversion.V25_1) default: panic(errors.AssertionFailedf("unknown element %T", el))