steel scripts

This commit is contained in:
filipriec
2025-03-07 10:45:35 +01:00
parent 0e0578d158
commit b01eeddfe0
11 changed files with 102 additions and 233 deletions

View File

@@ -3,9 +3,11 @@ CREATE TABLE table_scripts (
id BIGSERIAL PRIMARY KEY,
table_definitions_id BIGINT NOT NULL REFERENCES table_definitions(id),
target_column TEXT NOT NULL,
rhai_script TEXT NOT NULL,
compiled_script BYTEA NOT NULL,
created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
script TEXT NOT NULL,
source_tables TEXT[] NOT NULL, -- Added to track which tables are used in calculation
source_columns TEXT[] NOT NULL, -- Added to track which columns are used in calculation
description TEXT, -- Optional description of what the script does
created_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP,
UNIQUE(table_definitions_id, target_column)
);