Skip to content

Commit 3302bbc

Browse files
committed
drop: removed persistance of flow signature
1 parent e5d1bde commit 3302bbc

18 files changed

Lines changed: 88 additions & 42 deletions

File tree

app/graphql/types/flow_type.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ class FlowType < Types::BaseObject
2323
null: false,
2424
method: :flow_settings,
2525
description: 'The settings of the flow'
26-
field :signature, String,
27-
null: false,
28-
description: 'The signature of the flow'
2926
field :starting_node_id, Types::GlobalIdType[::NodeFunction],
3027
null: true,
3128
description: 'The ID of the starting node of the flow'

app/graphql/types/input/flow_input_type.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ class FlowInputType < Types::BaseInputObject
1717

1818
argument :type, Types::GlobalIdType[::FlowType], required: true,
1919
description: 'The identifier of the flow type'
20-
21-
argument :signature, String, required: false, description: 'The signature of the flow'
2220
end
2321
end
2422
end

app/models/flow.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ class Flow < ApplicationRecord
4141
allow_blank: false,
4242
uniqueness: { case_sensitive: false, scope: :project_id }
4343

44-
validates :signature, presence: true, length: { maximum: 500 }
45-
4644
scope :enabled, -> { where(disabled_reason: nil) }
4745
scope :disabled, -> { where.not(disabled_reason: nil) }
4846

@@ -61,7 +59,7 @@ def to_grpc
6159
settings: flow_settings.map(&:to_grpc),
6260
starting_node_id: starting_node&.id,
6361
node_functions: node_functions.map(&:to_grpc),
64-
signature: signature
62+
signature: flow_type.signature
6563
)
6664
end
6765

app/services/namespaces/projects/flows/create_service.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ def execute
3838
flow = Flow.new(
3939
project: namespace_project,
4040
name: flow_input.name,
41-
flow_type: flow_type,
42-
signature: flow_input.signature.presence || flow_type.signature
41+
flow_type: flow_type
4342
)
4443

4544
unless flow.save

app/services/namespaces/projects/flows/update_service.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ def update_flow(t)
4848

4949
def update_flow_attributes
5050
flow.name = flow_input.name
51-
flow.signature = flow_input.signature if flow_input.signature.present?
5251
flow.validation_status = :unvalidated
5352
end
5453

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# frozen_string_literal: true
2+
3+
class RemoveSignatureFromFlows < Code0::ZeroTrack::Database::Migration[1.0]
4+
def change
5+
remove_column :flows, :signature, :text, if_exists: true
6+
end
7+
end

db/schema_migrations/20260625120000

Lines changed: 0 additions & 1 deletion
This file was deleted.

db/schema_migrations/20260628132040

Lines changed: 0 additions & 1 deletion
This file was deleted.

db/schema_migrations/20260628132041

Lines changed: 0 additions & 1 deletion
This file was deleted.

db/structure.sql

Lines changed: 70 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,47 @@
1+
CREATE FUNCTION delete_data_types_translations() RETURNS trigger
2+
LANGUAGE plpgsql
3+
AS $$ BEGIN DELETE FROM "translations" WHERE "owner_type" = 'DataType' AND "owner_id" IN (SELECT id FROM old_rows); RETURN NULL; END; $$;
4+
5+
CREATE FUNCTION delete_flow_type_settings_translations() RETURNS trigger
6+
LANGUAGE plpgsql
7+
AS $$ BEGIN DELETE FROM "translations" WHERE "owner_type" = 'FlowTypeSetting' AND "owner_id" IN (SELECT id FROM old_rows); RETURN NULL; END; $$;
8+
9+
CREATE FUNCTION delete_flow_types_translations() RETURNS trigger
10+
LANGUAGE plpgsql
11+
AS $$ BEGIN DELETE FROM "translations" WHERE "owner_type" = 'FlowType' AND "owner_id" IN (SELECT id FROM old_rows); RETURN NULL; END; $$;
12+
13+
CREATE FUNCTION delete_function_definitions_translations() RETURNS trigger
14+
LANGUAGE plpgsql
15+
AS $$ BEGIN DELETE FROM "translations" WHERE "owner_type" = 'FunctionDefinition' AND "owner_id" IN (SELECT id FROM old_rows); RETURN NULL; END; $$;
16+
17+
CREATE FUNCTION delete_module_configuration_definitions_translations() RETURNS trigger
18+
LANGUAGE plpgsql
19+
AS $$ BEGIN DELETE FROM "translations" WHERE "owner_type" = 'ModuleConfigurationDefinition' AND "owner_id" IN (SELECT id FROM old_rows); RETURN NULL; END; $$;
20+
21+
CREATE FUNCTION delete_parameter_definitions_translations() RETURNS trigger
22+
LANGUAGE plpgsql
23+
AS $$ BEGIN DELETE FROM "translations" WHERE "owner_type" = 'ParameterDefinition' AND "owner_id" IN (SELECT id FROM old_rows); RETURN NULL; END; $$;
24+
25+
CREATE FUNCTION delete_runtime_flow_type_settings_translations() RETURNS trigger
26+
LANGUAGE plpgsql
27+
AS $$ BEGIN DELETE FROM "translations" WHERE "owner_type" = 'RuntimeFlowTypeSetting' AND "owner_id" IN (SELECT id FROM old_rows); RETURN NULL; END; $$;
28+
29+
CREATE FUNCTION delete_runtime_flow_types_translations() RETURNS trigger
30+
LANGUAGE plpgsql
31+
AS $$ BEGIN DELETE FROM "translations" WHERE "owner_type" = 'RuntimeFlowType' AND "owner_id" IN (SELECT id FROM old_rows); RETURN NULL; END; $$;
32+
33+
CREATE FUNCTION delete_runtime_function_definitions_translations() RETURNS trigger
34+
LANGUAGE plpgsql
35+
AS $$ BEGIN DELETE FROM "translations" WHERE "owner_type" = 'RuntimeFunctionDefinition' AND "owner_id" IN (SELECT id FROM old_rows); RETURN NULL; END; $$;
36+
37+
CREATE FUNCTION delete_runtime_modules_translations() RETURNS trigger
38+
LANGUAGE plpgsql
39+
AS $$ BEGIN DELETE FROM "translations" WHERE "owner_type" = 'RuntimeModule' AND "owner_id" IN (SELECT id FROM old_rows); RETURN NULL; END; $$;
40+
41+
CREATE FUNCTION delete_runtime_parameter_definitions_translations() RETURNS trigger
42+
LANGUAGE plpgsql
43+
AS $$ BEGIN DELETE FROM "translations" WHERE "owner_type" = 'RuntimeParameterDefinition' AND "owner_id" IN (SELECT id FROM old_rows); RETURN NULL; END; $$;
44+
145
CREATE TABLE active_storage_attachments (
246
id bigint NOT NULL,
347
name character varying NOT NULL,
@@ -83,12 +127,12 @@ CREATE TABLE ar_internal_metadata (
83127
CREATE TABLE audit_events (
84128
id bigint NOT NULL,
85129
author_id bigint NOT NULL,
86-
entity_id bigint NOT NULL,
130+
entity_id integer NOT NULL,
87131
entity_type text NOT NULL,
88132
action_type integer NOT NULL,
89133
details jsonb NOT NULL,
90134
ip_address inet,
91-
target_id bigint NOT NULL,
135+
target_id integer NOT NULL,
92136
target_type text NOT NULL,
93137
created_at timestamp with time zone NOT NULL,
94138
updated_at timestamp with time zone NOT NULL
@@ -1698,6 +1742,28 @@ CREATE UNIQUE INDEX "index_users_on_LOWER_username" ON users USING btree (lower(
16981742

16991743
CREATE UNIQUE INDEX index_users_on_totp_secret ON users USING btree (totp_secret) WHERE (totp_secret IS NOT NULL);
17001744

1745+
CREATE TRIGGER trigger_delete_data_types_translations AFTER DELETE ON data_types REFERENCING OLD TABLE AS old_rows FOR EACH STATEMENT EXECUTE FUNCTION delete_data_types_translations();
1746+
1747+
CREATE TRIGGER trigger_delete_flow_type_settings_translations AFTER DELETE ON flow_type_settings REFERENCING OLD TABLE AS old_rows FOR EACH STATEMENT EXECUTE FUNCTION delete_flow_type_settings_translations();
1748+
1749+
CREATE TRIGGER trigger_delete_flow_types_translations AFTER DELETE ON flow_types REFERENCING OLD TABLE AS old_rows FOR EACH STATEMENT EXECUTE FUNCTION delete_flow_types_translations();
1750+
1751+
CREATE TRIGGER trigger_delete_function_definitions_translations AFTER DELETE ON function_definitions REFERENCING OLD TABLE AS old_rows FOR EACH STATEMENT EXECUTE FUNCTION delete_function_definitions_translations();
1752+
1753+
CREATE TRIGGER trigger_delete_module_configuration_definitions_translations AFTER DELETE ON module_configuration_definitions REFERENCING OLD TABLE AS old_rows FOR EACH STATEMENT EXECUTE FUNCTION delete_module_configuration_definitions_translations();
1754+
1755+
CREATE TRIGGER trigger_delete_parameter_definitions_translations AFTER DELETE ON parameter_definitions REFERENCING OLD TABLE AS old_rows FOR EACH STATEMENT EXECUTE FUNCTION delete_parameter_definitions_translations();
1756+
1757+
CREATE TRIGGER trigger_delete_runtime_flow_type_settings_translations AFTER DELETE ON runtime_flow_type_settings REFERENCING OLD TABLE AS old_rows FOR EACH STATEMENT EXECUTE FUNCTION delete_runtime_flow_type_settings_translations();
1758+
1759+
CREATE TRIGGER trigger_delete_runtime_flow_types_translations AFTER DELETE ON runtime_flow_types REFERENCING OLD TABLE AS old_rows FOR EACH STATEMENT EXECUTE FUNCTION delete_runtime_flow_types_translations();
1760+
1761+
CREATE TRIGGER trigger_delete_runtime_function_definitions_translations AFTER DELETE ON runtime_function_definitions REFERENCING OLD TABLE AS old_rows FOR EACH STATEMENT EXECUTE FUNCTION delete_runtime_function_definitions_translations();
1762+
1763+
CREATE TRIGGER trigger_delete_runtime_modules_translations AFTER DELETE ON runtime_modules REFERENCING OLD TABLE AS old_rows FOR EACH STATEMENT EXECUTE FUNCTION delete_runtime_modules_translations();
1764+
1765+
CREATE TRIGGER trigger_delete_runtime_parameter_definitions_translations AFTER DELETE ON runtime_parameter_definitions REFERENCING OLD TABLE AS old_rows FOR EACH STATEMENT EXECUTE FUNCTION delete_runtime_parameter_definitions_translations();
1766+
17011767
ALTER TABLE ONLY node_parameters
17021768
ADD CONSTRAINT fk_rails_0d79310cfa FOREIGN KEY (node_function_id) REFERENCES node_functions(id) ON DELETE CASCADE;
17031769

@@ -1813,7 +1879,7 @@ ALTER TABLE ONLY flow_types
18131879
ADD CONSTRAINT fk_rails_687d671458 FOREIGN KEY (runtime_id) REFERENCES runtimes(id) ON DELETE CASCADE;
18141880

18151881
ALTER TABLE ONLY namespace_role_project_assignments
1816-
ADD CONSTRAINT fk_rails_69066bda8f FOREIGN KEY (project_id) REFERENCES namespace_projects(id) ON DELETE CASCADE;
1882+
ADD CONSTRAINT fk_rails_69066bda8f FOREIGN KEY (project_id) REFERENCES namespace_projects(id);
18171883

18181884
ALTER TABLE ONLY flow_types
18191885
ADD CONSTRAINT fk_rails_69115ada7f FOREIGN KEY (runtime_module_id) REFERENCES runtime_modules(id) ON DELETE CASCADE;
@@ -1915,7 +1981,7 @@ ALTER TABLE ONLY module_configuration_definition_data_type_links
19151981
ADD CONSTRAINT fk_rails_e893387710 FOREIGN KEY (referenced_data_type_id) REFERENCES data_types(id) ON DELETE RESTRICT;
19161982

19171983
ALTER TABLE ONLY runtimes
1918-
ADD CONSTRAINT fk_rails_eeb42116cc FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
1984+
ADD CONSTRAINT fk_rails_eeb42116cc FOREIGN KEY (namespace_id) REFERENCES namespaces(id);
19191985

19201986
ALTER TABLE ONLY flow_data_type_links
19211987
ADD CONSTRAINT fk_rails_f4202724d3 FOREIGN KEY (flow_id) REFERENCES flows(id) ON DELETE CASCADE;

0 commit comments

Comments
 (0)