Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions app/graphql/types/input/reference_value_input_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ class ReferenceValueInputType < Types::BaseInputObject
required: true, description: 'The paths associated with this reference value'

argument :node_function_id, GlobalIdType[::NodeFunction], required: true, description: 'The referenced value'

argument :data_type_identifier, Types::Input::DataTypeIdentifierInputType,
required: true, description: 'The identifier of the data type this reference value belongs to'

argument :depth, Int, required: true, description: 'The depth of the reference value'
argument :node, Int, required: true, description: 'The node of the reference'
argument :scope, [Int], required: true, description: 'The scope of the reference value'
end
end
end
7 changes: 0 additions & 7 deletions app/graphql/types/reference_value_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@ class ReferenceValueType < Types::BaseObject

field :node_function_id, GlobalIdType[::NodeFunction], null: false, description: 'The referenced value.'

field :data_type_identifier, Types::DataTypeIdentifierType,
null: false, description: 'The identifier of the data type this reference value belongs to.'

field :depth, Int, null: false, description: 'The depth of the reference value.'
field :node, Int, null: false, description: 'The node of the reference value.'
field :scope, [Int], null: false, description: 'The scope of the reference value.'

field :reference_path, [Types::ReferencePathType],
null: false,
description: 'The paths associated with this reference value.',
Expand Down
1 change: 0 additions & 1 deletion app/models/reference_value.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

class ReferenceValue < ApplicationRecord
belongs_to :node_function # real value association
belongs_to :data_type_identifier
has_many :reference_paths, inverse_of: :reference_value, autosave: true, dependent: :destroy
has_many :node_parameters, inverse_of: :reference_value

Expand Down
10 changes: 0 additions & 10 deletions app/services/namespaces/projects/flows/update_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,6 @@ def update_node_parameters(t, current_node, current_node_input, all_nodes)
end

if parameter.value.reference_value.present?
data_type_identifier = get_data_type_identifier(
flow.project.primary_runtime,
parameter.value.reference_value.data_type_identifier,
t
)

referenced_node = all_nodes.find do |n|
n[:input].id == parameter.value.reference_value.node_function_id
end
Expand All @@ -229,11 +223,7 @@ def update_node_parameters(t, current_node, current_node_input, all_nodes)
end

reference_value.assign_attributes(
data_type_identifier: data_type_identifier,
node_function: referenced_node[:node],
depth: parameter.value.reference_value.depth,
node: parameter.value.reference_value.node,
scope: parameter.value.reference_value.scope,
reference_paths: reference_paths
)
else
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

class DropFrontendFieldsFromReferenceValue < Code0::ZeroTrack::Database::Migration[1.0]
def change
remove_reference :reference_values, :data_type_identifier, null: false, foreign_key: {
to_table: :data_type_identifiers, on_delete: :restrict
}

remove_column :reference_values, :scope, :integer, array: true, null: false, default: []
remove_column :reference_values, :node, :integer, null: false, default: 0
remove_column :reference_values, :depth, :integer, null: false, default: 0
end
end
1 change: 1 addition & 0 deletions db/schema_migrations/20260209200852
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6ad01c08408e467d3ff1ac8470da7ab77a852632896297e05d1dc2cc77e190b9
11 changes: 1 addition & 10 deletions db/structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -668,11 +668,7 @@ CREATE TABLE reference_values (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
node_function_id bigint NOT NULL,
depth integer DEFAULT 0 NOT NULL,
node integer DEFAULT 0 NOT NULL,
scope integer[] DEFAULT '{}'::integer[] NOT NULL,
data_type_identifier_id bigint NOT NULL
node_function_id bigint NOT NULL
);

CREATE SEQUENCE reference_values_id_seq
Expand Down Expand Up @@ -1213,8 +1209,6 @@ CREATE INDEX index_parameter_definitions_on_runtime_parameter_definition_id ON p

CREATE INDEX index_reference_paths_on_reference_value_id ON reference_paths USING btree (reference_value_id);

CREATE INDEX index_reference_values_on_data_type_identifier_id ON reference_values USING btree (data_type_identifier_id);

CREATE INDEX index_reference_values_on_node_function_id ON reference_values USING btree (node_function_id);

CREATE INDEX index_runtime_function_definitions_on_return_type_id ON runtime_function_definitions USING btree (return_type_id);
Expand Down Expand Up @@ -1375,9 +1369,6 @@ ALTER TABLE ONLY flow_type_settings
ALTER TABLE ONLY flows
ADD CONSTRAINT fk_rails_ab927e0ecb FOREIGN KEY (project_id) REFERENCES namespace_projects(id) ON DELETE CASCADE;

ALTER TABLE ONLY reference_values
ADD CONSTRAINT fk_rails_bb34a5d62c FOREIGN KEY (data_type_identifier_id) REFERENCES data_type_identifiers(id) ON DELETE RESTRICT;

ALTER TABLE ONLY flows
ADD CONSTRAINT fk_rails_bb587eff6a FOREIGN KEY (input_type_id) REFERENCES data_types(id) ON DELETE RESTRICT;

Expand Down
13 changes: 0 additions & 13 deletions docs/graphql/input_object/datatypeidentifierinput.md

This file was deleted.

12 changes: 0 additions & 12 deletions docs/graphql/input_object/genericmapperinput.md

This file was deleted.

12 changes: 0 additions & 12 deletions docs/graphql/input_object/generictypeinput.md

This file was deleted.

4 changes: 0 additions & 4 deletions docs/graphql/input_object/referencevalueinput.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,5 @@ Input type for reference value

| Name | Type | Description |
|------|------|-------------|
| `dataTypeIdentifier` | [`DataTypeIdentifierInput!`](../input_object/datatypeidentifierinput.md) | The identifier of the data type this reference value belongs to |
| `depth` | [`Int!`](../scalar/int.md) | The depth of the reference value |
| `node` | [`Int!`](../scalar/int.md) | The node of the reference |
| `nodeFunctionId` | [`NodeFunctionID!`](../scalar/nodefunctionid.md) | The referenced value |
| `referencePath` | [`[ReferencePathInput!]!`](../input_object/referencepathinput.md) | The paths associated with this reference value |
| `scope` | [`[Int!]!`](../scalar/int.md) | The scope of the reference value |
4 changes: 0 additions & 4 deletions docs/graphql/object/referencevalue.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@ Represents a reference value in the system.
| Name | Type | Description |
|------|------|-------------|
| `createdAt` | [`Time!`](../scalar/time.md) | Time when this ReferenceValue was created |
| `dataTypeIdentifier` | [`DataTypeIdentifier!`](../object/datatypeidentifier.md) | The identifier of the data type this reference value belongs to. |
| `depth` | [`Int!`](../scalar/int.md) | The depth of the reference value. |
| `id` | [`ReferenceValueID!`](../scalar/referencevalueid.md) | Global ID of this ReferenceValue |
| `node` | [`Int!`](../scalar/int.md) | The node of the reference value. |
| `nodeFunctionId` | [`NodeFunctionID!`](../scalar/nodefunctionid.md) | The referenced value. |
| `referencePath` | [`[ReferencePath!]!`](../object/referencepath.md) | The paths associated with this reference value. |
| `scope` | [`[Int!]!`](../scalar/int.md) | The scope of the reference value. |
| `updatedAt` | [`Time!`](../scalar/time.md) | Time when this ReferenceValue was last updated |

4 changes: 0 additions & 4 deletions spec/factories/reference_values.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,5 @@
FactoryBot.define do
factory :reference_value do
node_function
data_type_identifier { association(:data_type_identifier, data_type: association(:data_type)) }
depth { 1 }
node { 1 }
scope { [] }
end
end
1 change: 0 additions & 1 deletion spec/models/reference_value_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

describe 'associations' do
it { is_expected.to belong_to(:node_function) }
it { is_expected.to belong_to(:data_type_identifier) }
it { is_expected.to have_many(:reference_paths) }
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,13 @@
}
...on ReferenceValue {
createdAt
dataTypeIdentifier { id }
depth
id
node
nodeFunctionId
referencePath {
arrayIndex
id
path
}
scope
updatedAt
}
}
Expand Down Expand Up @@ -129,19 +125,13 @@
parameterDefinitionId: function_definition.parameter_definitions.first.to_global_id.to_s,
value: {
referenceValue: {
depth: 1,
node: 1,
scope: [],
referencePath: [
{
arrayIndex: 0,
path: 'some.path',
}
],
nodeFunctionId: 'gid://sagittarius/NodeFunction/2000',
dataTypeIdentifier: {
genericKey: 'K',
},
},
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,13 @@
}
...on ReferenceValue {
createdAt
dataTypeIdentifier { id }
depth
id
node
nodeFunctionId
referencePath {
arrayIndex
id
path
}
scope
updatedAt
}
}
Expand Down Expand Up @@ -132,19 +128,13 @@
parameterDefinitionId: function_definition.parameter_definitions.first.to_global_id.to_s,
value: {
referenceValue: {
depth: 1,
node: 1,
scope: [],
referencePath: [
{
arrayIndex: 0,
path: 'some.path',
}
],
nodeFunctionId: 'gid://sagittarius/NodeFunction/2000',
dataTypeIdentifier: {
dataTypeId: function_definition.parameter_definitions.first.data_type.data_type.to_global_id,
},
},
}
],
Expand Down