public.lease¶
列¶
| 名称 | 类型 | 默认值 | 可空 | 子表 | 父表 | 注释 |
|---|---|---|---|---|---|---|
| claimedAt | timestamp(3) with time zone | true | 持有者申领租约的时间 | |||
| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | |||
| data | json | false | 持有者所需的数据,以规范化 JSON 表示 | |||
| dataHash | varchar(64) | false | 数据的 SHA-256 哈希,sync 通过比较该哈希来发现已变更的租约 | |||
| fencingToken | bigint | 0 | false | 当前或最后持有者的 fencing token | ||
| key | varchar(255) | false | 租约在其类型中的键 | |||
| leaseKind | varchar(24) | false | public.lease_kind | |||
| leaseSessionId | uuid | true | 持有者会话;当租约空闲时为 null。不设外键或唯一索引,以使更新保持 no-key 更新 | |||
| readyAt | timestamp(3) with time zone | true | 持有者报告租约已就绪的时间 | |||
| revokedAt | timestamp(3) with time zone | true | sync 因租约发生变化或消失而将其撤销的时间;未撤销时为 null;移交截止时间从该时刻起算 | |||
| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false |
约束¶
| 名称 | 类型 | 定义 |
|---|---|---|
| CHK_lease_fencingToken | CHECK | CHECK (("fencingToken" >= 0)) |
| FK_lease_leaseKind | FOREIGN KEY | FOREIGN KEY ("leaseKind") REFERENCES lease_kind(kind) ON DELETE CASCADE |
| PK_c9b9277380ffae18103999d14bf | PRIMARY KEY | PRIMARY KEY ("leaseKind", key) |
| lease_createdAt_not_null | n | NOT NULL "createdAt" |
| lease_dataHash_not_null | n | NOT NULL "dataHash" |
| lease_data_not_null | n | NOT NULL data |
| lease_fencingToken_not_null | n | NOT NULL "fencingToken" |
| lease_key_not_null | n | NOT NULL key |
| lease_leaseKind_not_null | n | NOT NULL "leaseKind" |
| lease_updatedAt_not_null | n | NOT NULL "updatedAt" |
索引¶
| 名称 | 定义 |
|---|---|
| IDX_lease_leaseKind_leaseSessionId | CREATE INDEX "IDX_lease_leaseKind_leaseSessionId" ON public.lease USING btree ("leaseKind", "leaseSessionId") |
| PK_c9b9277380ffae18103999d14bf | CREATE UNIQUE INDEX "PK_c9b9277380ffae18103999d14bf" ON public.lease USING btree ("leaseKind", key) |
关系¶
erDiagram
"public.lease" }o--|| "public.lease_kind" : "FOREIGN KEY (#quot;leaseKind#quot;) REFERENCES lease_kind(kind) ON DELETE CASCADE"
"public.lease" {
timestamp_3__with_time_zone claimedAt
timestamp_3__with_time_zone createdAt
json data
varchar_64_ dataHash
bigint fencingToken
varchar_255_ key
varchar_24_ leaseKind FK
uuid leaseSessionId
timestamp_3__with_time_zone readyAt
timestamp_3__with_time_zone revokedAt
timestamp_3__with_time_zone updatedAt
}
"public.lease_kind" {
timestamp_3__with_time_zone createdAt
bigint fencingTokenCounter
varchar_24_ kind
timestamp_3__with_time_zone lastFullSyncAt
timestamp_3__with_time_zone syncLockExpiresAt
uuid syncLockRoundId
timestamp_3__with_time_zone updatedAt
}由 tbls 生成
本页原文 Markdown:在 AtomGit 查看·内容源自开源项目 n8/n8n