Custom column names for closure tree table
See original GitHub issueCustom column names for closure tree table
The Problem
Currently @Tree("closure-table")
creates table with fixed name and columns entity_closure
, id_ancestor
, id_descendant
. There is no possibility to customize this naming. This not works with legacy database schema.
The Solution
Append @Tree("closure-table")
with additional options closureTableName
, ancestorColumnName
, descendantColumnName
Relevant Database Driver(s)
- [ +]
postgres
Are you willing to resolve this issue by submitting a Pull Request?
- [+ ] Yes, I have the time, but I don’t know how to start. I would need guidance.
Issue Analytics
- State:
- Created 3 years ago
- Comments:19 (19 by maintainers)
Top Results From Across the Web
Tree Entities - typeorm - GitBook
You can specify the closure table name and/or closure table column names by setting optional parameter options into @Tree("closure-table", options) .
Read more >Unique name constraint accross siblings in a closure tree
With this schema I'm using a unique constraint on the spaces table to verify that no sibling has the same name. The downside...
Read more >Hierarchical Data in SQL: The Ultimate Guide
What is Hierarchical Data? Adjacency List; Nested Set; Flat Table; Bridge Table or Closure Table; Lineage Column or Path Enumeration; Summary of Methods;...
Read more >Hierarchical data using closure table, how to ensure that a ...
I store hierarchical data in a Node-table, combined with a closure table (NodeClosure). Each node has a column "name" that should be unique ......
Read more >Moving Subtrees in Closure Table Hierarchies
In Closure Table, we store every path in a tree, not only direct parent-child references, but also grandparent-grandchild, and every other path, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@nebkat I did first step. This is insert sql
closed by #7120