Files
komp_ac/server/src/steel/docs/script_refering_different_table.txt
2025-07-25 18:18:00 +02:00

30 lines
1.3 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Creation of the tables:
grpcurl -plaintext -d '{
"table_name": "department",
"columns": [
{"name": "yearly_goal", "field_type": "text"}
],
"profile_name": "finance"
}' localhost:50051 komp_ac.table_definition.TableDefinition/PostTableDefinition
{
"success": true,
"sql": "CREATE TABLE \"2025_department\" (\n id BIGSERIAL PRIMARY KEY,\n deleted BOOLEAN NOT NULL DEFAULT FALSE,\n \"yearly_goal\" TEXT,\n created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP\n)\n"
}
grpcurl -plaintext -d '{
"table_name": "project",
"columns": [
{"name": "name", "field_type": "TEXT"},
{"name": "budget_estimate", "field_type": "TEXT"}
],
"indexes": ["name"],
"profile_name": "finance",
"links": [
{"linked_table_name": "2025_department", "required": true}
]
}' localhost:50051 komp_ac.table_definition.TableDefinition/PostTableDefinition
{
"success": true,
"sql": "CREATE TABLE \"2025_project\" (\n id BIGSERIAL PRIMARY KEY,\n deleted BOOLEAN NOT NULL DEFAULT FALSE,\n \"department_id\" BIGINT NOT NULL REFERENCES \"2025_department\"(id),\n \"name\" TEXT,\n \"budget_estimate\" TEXT,\n created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP\n)\nCREATE INDEX idx_2025_project_department_fk ON \"2025_project\" (\"department_id\")\nCREATE INDEX idx_2025_project_name ON \"2025_project\" (\"name\")"
}