v2 compatible lock column setting

This commit is contained in:
Roland Shoemaker 2015-05-03 13:51:11 -07:00
parent 1597af6d2b
commit 06536fae13
1 changed files with 6 additions and 6 deletions

View File

@ -44,13 +44,13 @@ type Registration struct {
Thumbprint string `db:"thumbprint"` Thumbprint string `db:"thumbprint"`
core.Registration core.Registration
Version int64 // Lock column LockCol int64
} }
type Pending_auth struct { type Pending_auth struct {
core.Authorization core.Authorization
Version int64 // Lock column LockCol int64
} }
type Auth struct { type Auth struct {
@ -72,7 +72,7 @@ type CertificateStatus struct {
RevokedReason int `db:"revokedReason"` RevokedReason int `db:"revokedReason"`
core.CertificateStatus core.CertificateStatus
Version int64 // Lock column LockCol int64
} }
type OcspResponse struct { type OcspResponse struct {
@ -176,11 +176,11 @@ func NewSQLStorageAuthority(driver string, name string) (ssa *SQLStorageAuthorit
} }
func (ssa *SQLStorageAuthority) InitTables() (err error) { func (ssa *SQLStorageAuthority) InitTables() (err error) {
ssa.dbMap.AddTableWithName(Registration{}, "registrations").SetKeys(false, "ID") ssa.dbMap.AddTableWithName(Registration{}, "registrations").SetKeys(false, "ID").SetVersionCol("LockCol")
ssa.dbMap.AddTableWithName(Pending_auth{}, "pending_authz").SetKeys(false, "ID") ssa.dbMap.AddTableWithName(Pending_auth{}, "pending_authz").SetKeys(false, "ID").SetVersionCol("LockCol")
ssa.dbMap.AddTableWithName(Auth{}, "authz").SetKeys(false, "ID") ssa.dbMap.AddTableWithName(Auth{}, "authz").SetKeys(false, "ID")
ssa.dbMap.AddTableWithName(Certificate{}, "certificates").SetKeys(false, "Serial") ssa.dbMap.AddTableWithName(Certificate{}, "certificates").SetKeys(false, "Serial")
ssa.dbMap.AddTableWithName(CertificateStatus{}, "certificateStatus").SetKeys(false, "Serial") ssa.dbMap.AddTableWithName(CertificateStatus{}, "certificateStatus").SetKeys(false, "Serial").SetVersionCol("LockCol")
ssa.dbMap.AddTableWithName(OcspResponse{}, "ocspResponses").SetKeys(true, "ID") ssa.dbMap.AddTableWithName(OcspResponse{}, "ocspResponses").SetKeys(true, "ID")
ssa.dbMap.AddTableWithName(Crl{}, "crls").SetKeys(false, "CreatedAt") ssa.dbMap.AddTableWithName(Crl{}, "crls").SetKeys(false, "CreatedAt")