rhai migration added
This commit is contained in:
16
server/migrations/20250306132638_create_table_scripts.sql
Normal file
16
server/migrations/20250306132638_create_table_scripts.sql
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
-- Add migration script here
|
||||||
|
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,
|
||||||
|
UNIQUE(table_definitions_id, target_column)
|
||||||
|
);
|
||||||
|
|
||||||
|
-- Add foreign key constraint
|
||||||
|
ALTER TABLE table_scripts
|
||||||
|
ADD CONSTRAINT fk_table_definition
|
||||||
|
FOREIGN KEY (table_definitions_id)
|
||||||
|
REFERENCES table_definitions(id);
|
||||||
Reference in New Issue
Block a user