feat(core): Add Git connection database table (no-changelog) (#36268)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Irénée
2026-08-18 13:54:47 +00:00
committed by GitHub
parent 2435ed5cf0
commit 9c947996da
7 changed files with 455 additions and 0 deletions
+16
View File
@@ -63,6 +63,7 @@ Auto-generated from the PostgreSQL migrations in @n8n/db. Do not edit by hand.
| [public.execution_metadata](public.execution_metadata.md) | 4 | | BASE TABLE |
| [public.folder](public.folder.md) | 6 | | BASE TABLE |
| [public.folder_tag](public.folder_tag.md) | 2 | | BASE TABLE |
| [public.git_connection](public.git_connection.md) | 13 | | BASE TABLE |
| [public.insights_by_period](public.insights_by_period.md) | 6 | | BASE TABLE |
| [public.insights_metadata](public.insights_metadata.md) | 5 | | BASE TABLE |
| [public.insights_raw](public.insights_raw.md) | 5 | | BASE TABLE |
@@ -907,6 +908,21 @@ erDiagram
varchar_36_ folderId FK
varchar_36_ tagId FK
}
"public.git_connection" {
varchar_64_ baseCommit
varchar_255_ branchName
varchar_16_ connectionType
timestamp_3__with_time_zone createdAt
text encryptedPassword
text encryptedPrivateKey
text encryptedUsername
varchar_36_ id
varchar_16_ keyGeneratorType
varchar_128_ name
text publicKey
text repositoryUrl
timestamp_3__with_time_zone updatedAt
}
"public.insights_by_period" {
integer id
integer metaId FK
+68
View File
@@ -0,0 +1,68 @@
# public.git_connection
## Columns
| Name | Type | Default | Nullable | Children | Parents | Comment |
| ---- | ---- | ------- | -------- | -------- | ------- | ------- |
| baseCommit | varchar(64) | | true | | | Last commit successfully reconciled for this connection; the base for three-way reconciliation. |
| branchName | varchar(255) | | true | | | |
| connectionType | varchar(16) | | false | | | GitConnectionType enum: "ssh", "https" |
| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | |
| encryptedPassword | text | | true | | | Encrypted HTTPS password/token; set when connectionType is 'https', null for 'ssh'. |
| encryptedPrivateKey | text | | true | | | Encrypted SSH private key; set when connectionType is 'ssh', null for 'https'. |
| encryptedUsername | text | | true | | | Encrypted HTTPS username; set when connectionType is 'https', null for 'ssh'. |
| id | varchar(36) | | false | | | |
| keyGeneratorType | varchar(16) | | true | | | GitKeyGeneratorType enum: "ed25519", "rsa" |
| name | varchar(128) | | false | | | |
| publicKey | text | | true | | | SSH public key; set when connectionType is 'ssh', null for 'https'. |
| repositoryUrl | text | | false | | | |
| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | |
## Constraints
| Name | Type | Definition |
| ---- | ---- | ---------- |
| CHK_git_connection_connectionType | CHECK | CHECK ((("connectionType")::text = ANY ((ARRAY['ssh'::character varying, 'https'::character varying])::text[]))) |
| CHK_git_connection_https_auth | CHECK | CHECK (((("connectionType")::text <> 'https'::text) OR (("publicKey" IS NULL) AND ("encryptedPrivateKey" IS NULL) AND ("keyGeneratorType" IS NULL)))) |
| CHK_git_connection_keyGeneratorType | CHECK | CHECK ((("keyGeneratorType")::text = ANY ((ARRAY['ed25519'::character varying, 'rsa'::character varying])::text[]))) |
| CHK_git_connection_ssh_auth | CHECK | CHECK (((("connectionType")::text <> 'ssh'::text) OR (("encryptedUsername" IS NULL) AND ("encryptedPassword" IS NULL)))) |
| PK_92966b7ba4ce2cf61a62017a6ff | PRIMARY KEY | PRIMARY KEY (id) |
| git_connection_connectionType_not_null | n | NOT NULL "connectionType" |
| git_connection_createdAt_not_null | n | NOT NULL "createdAt" |
| git_connection_id_not_null | n | NOT NULL id |
| git_connection_name_not_null | n | NOT NULL name |
| git_connection_repositoryUrl_not_null | n | NOT NULL "repositoryUrl" |
| git_connection_updatedAt_not_null | n | NOT NULL "updatedAt" |
## Indexes
| Name | Definition |
| ---- | ---------- |
| PK_92966b7ba4ce2cf61a62017a6ff | CREATE UNIQUE INDEX "PK_92966b7ba4ce2cf61a62017a6ff" ON public.git_connection USING btree (id) |
## Relations
```mermaid
erDiagram
"public.git_connection" {
varchar_64_ baseCommit
varchar_255_ branchName
varchar_16_ connectionType
timestamp_3__with_time_zone createdAt
text encryptedPassword
text encryptedPrivateKey
text encryptedUsername
varchar_36_ id
varchar_16_ keyGeneratorType
varchar_128_ name
text publicKey
text repositoryUrl
timestamp_3__with_time_zone updatedAt
}
```
---
> Generated by [tbls](https://github.com/k1LoW/tbls)
+16
View File
@@ -63,6 +63,7 @@ Auto-generated from the SQLite migrations in @n8n/db. Do not edit by hand.
| [execution_metadata](execution_metadata.md) | 4 | | table |
| [folder](folder.md) | 6 | | table |
| [folder_tag](folder_tag.md) | 2 | | table |
| [git_connection](git_connection.md) | 13 | | table |
| [insights_by_period](insights_by_period.md) | 6 | | table |
| [insights_metadata](insights_metadata.md) | 5 | | table |
| [insights_raw](insights_raw.md) | 5 | | table |
@@ -894,6 +895,21 @@ erDiagram
varchar_36_ folderId PK
varchar_36_ tagId PK
}
"git_connection" {
varchar_64_ baseCommit
varchar_255_ branchName
varchar_16_ connectionType
datetime_3_ createdAt
TEXT encryptedPassword
TEXT encryptedPrivateKey
TEXT encryptedUsername
varchar_36_ id PK
varchar_16_ keyGeneratorType
varchar_128_ name
TEXT publicKey
TEXT repositoryUrl
datetime_3_ updatedAt
}
"insights_by_period" {
INTEGER id
INTEGER metaId FK
+74
View File
@@ -0,0 +1,74 @@
# git_connection
## Description
<details>
<summary><strong>Table Definition</strong></summary>
```sql
CREATE TABLE "git_connection" ("id" varchar(36) PRIMARY KEY NOT NULL, "name" varchar(128) NOT NULL, "repositoryUrl" text NOT NULL, "branchName" varchar(255), "connectionType" varchar(16) NOT NULL, "publicKey" text, "encryptedPrivateKey" text, "encryptedUsername" text, "encryptedPassword" text, "keyGeneratorType" varchar(16), "baseCommit" varchar(64), "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "CHK_git_connection_ssh_auth" CHECK ("connectionType" <> 'ssh' OR ("encryptedUsername" IS NULL AND "encryptedPassword" IS NULL)), CONSTRAINT "CHK_git_connection_https_auth" CHECK ("connectionType" <> 'https' OR ("publicKey" IS NULL AND "encryptedPrivateKey" IS NULL AND "keyGeneratorType" IS NULL)), CONSTRAINT "CHK_git_connection_connectionType" CHECK ("connectionType" IN ('ssh', 'https')), CONSTRAINT "CHK_git_connection_keyGeneratorType" CHECK ("keyGeneratorType" IN ('ed25519', 'rsa')))
```
</details>
## Columns
| Name | Type | Default | Nullable | Children | Parents | Comment |
| ---- | ---- | ------- | -------- | -------- | ------- | ------- |
| baseCommit | varchar(64) | | true | | | |
| branchName | varchar(255) | | true | | | |
| connectionType | varchar(16) | | false | | | |
| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | |
| encryptedPassword | TEXT | | true | | | |
| encryptedPrivateKey | TEXT | | true | | | |
| encryptedUsername | TEXT | | true | | | |
| id | varchar(36) | | false | | | |
| keyGeneratorType | varchar(16) | | true | | | |
| name | varchar(128) | | false | | | |
| publicKey | TEXT | | true | | | |
| repositoryUrl | TEXT | | false | | | |
| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | |
## Constraints
| Name | Type | Definition |
| ---- | ---- | ---------- |
| - | CHECK | CHECK ("connectionType" <> 'ssh' OR ("encryptedUsername" IS NULL AND "encryptedPassword" IS NULL)) |
| - | CHECK | CHECK ("connectionType" <> 'https' OR ("publicKey" IS NULL AND "encryptedPrivateKey" IS NULL AND "keyGeneratorType" IS NULL)) |
| - | CHECK | CHECK ("connectionType" IN ('ssh', 'https')) |
| - | CHECK | CHECK ("keyGeneratorType" IN ('ed25519', 'rsa')) |
| id | PRIMARY KEY | PRIMARY KEY (id) |
| sqlite_autoindex_git_connection_1 | PRIMARY KEY | PRIMARY KEY (id) |
## Indexes
| Name | Definition |
| ---- | ---------- |
| sqlite_autoindex_git_connection_1 | PRIMARY KEY (id) |
## Relations
```mermaid
erDiagram
"git_connection" {
varchar_64_ baseCommit
varchar_255_ branchName
varchar_16_ connectionType
datetime_3_ createdAt
TEXT encryptedPassword
TEXT encryptedPrivateKey
TEXT encryptedUsername
varchar_36_ id PK
varchar_16_ keyGeneratorType
varchar_128_ name
TEXT publicKey
TEXT repositoryUrl
datetime_3_ updatedAt
}
```
---
> Generated by [tbls](https://github.com/k1LoW/tbls)