mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-17 16:27:39 +00:00
misc: continued migration to new ca structure
This commit is contained in:
@@ -19,10 +19,15 @@ export const certificateTemplateDALFactory = (db: TDbClient) => {
|
||||
`${TableName.CertificateAuthority}.id`,
|
||||
`${TableName.CertificateTemplate}.caId`
|
||||
)
|
||||
.join(
|
||||
TableName.InternalCertificateAuthority,
|
||||
`${TableName.InternalCertificateAuthority}.certificateAuthorityId`,
|
||||
`${TableName.CertificateAuthority}.id`
|
||||
)
|
||||
.where(`${TableName.CertificateAuthority}.projectId`, "=", projectId)
|
||||
.select(selectAllTableCols(TableName.CertificateTemplate))
|
||||
.select(
|
||||
db.ref("friendlyName").as("caName").withSchema(TableName.CertificateAuthority),
|
||||
db.ref("friendlyName").as("caName").withSchema(TableName.InternalCertificateAuthority),
|
||||
db.ref("projectId").withSchema(TableName.CertificateAuthority)
|
||||
);
|
||||
|
||||
@@ -41,11 +46,16 @@ export const certificateTemplateDALFactory = (db: TDbClient) => {
|
||||
`${TableName.CertificateTemplate}.caId`
|
||||
)
|
||||
.join(TableName.Project, `${TableName.Project}.id`, `${TableName.CertificateAuthority}.projectId`)
|
||||
.join(
|
||||
TableName.InternalCertificateAuthority,
|
||||
`${TableName.InternalCertificateAuthority}.certificateAuthorityId`,
|
||||
`${TableName.CertificateAuthority}.id`
|
||||
)
|
||||
.where(`${TableName.CertificateTemplate}.id`, "=", id)
|
||||
.select(selectAllTableCols(TableName.CertificateTemplate))
|
||||
.select(
|
||||
db.ref("projectId").withSchema(TableName.CertificateAuthority),
|
||||
db.ref("friendlyName").as("caName").withSchema(TableName.CertificateAuthority),
|
||||
db.ref("friendlyName").as("caName").withSchema(TableName.InternalCertificateAuthority),
|
||||
db.ref("orgId").withSchema(TableName.Project)
|
||||
)
|
||||
.first();
|
||||
|
||||
Reference in New Issue
Block a user