TypeORM,如何使用前缀创建PrimaryGeneratedColumn

时间:2018-02-10 16:18:23

标签: sql node.js typescript typeorm

我正在使用TypeORM并希望将PrimaryGeneratedColumn创建为带有前缀的zerofill值,如PR000001,PR000002等。我怎么能得到它? 现在我找到了EntityListeners,所以我可以创建一个常规的PrimaryGeneratedColumn,只需添加带有前缀onInstert,onUpdate等的zerofill值,但它看起来不是一个好的解决方案。

1 个答案:

答案 0 :(得分:0)

如果有人好奇,我找到了一个hacky-solution

<div class="our-clients__categories">
  <a href="#technology" class="our-clients__categories--category" data-toggle=".company-brands"><h4>Technology</h4></a>
  <a href="#retail" class="our-clients__categories--category" data-toggle=".company-brands"><h4>Retail</h4></a>
  <a href="#finance" class="our-clients__categories--category" data-toggle=".company-brands"><h4>Finance</h4></a>
</div>

<div class="company-brands" id="technology">
 <h1>Technology</h1>
</div>
<div class="company-brands" id="retail" hidden>
  <h1>retail</h1>
</div>
<div class="company-brands" id="finance" hidden>
  <h1>finance</h1>
</div>

还有相关的机票https://github.com/typeorm/typeorm/issues/1571