rename pending_authz table to pendingAuthorizations

This commit is contained in:
Jeff Hodges 2015-09-04 14:49:49 -07:00
parent 8cfa7e5f32
commit 4109b8b3e6
4 changed files with 13 additions and 4 deletions

View File

@ -12,7 +12,7 @@
-- Storage Authority
CREATE USER `sa`@`%` IDENTIFIED BY 'password';
GRANT SELECT,INSERT,UPDATE ON authz TO 'sa'@'%';
GRANT SELECT,INSERT,UPDATE,DELETE ON pending_authz TO 'sa'@'%';
GRANT SELECT,INSERT,UPDATE,DELETE ON pendingAuthorizations TO 'sa'@'%';
GRANT SELECT,INSERT ON certificates TO 'sa'@'%';
GRANT SELECT,INSERT,UPDATE ON certificateStatus TO 'sa'@'%';
GRANT SELECT,INSERT ON deniedCSRs TO 'sa'@'%';

View File

@ -0,0 +1,9 @@
-- +goose Up
-- SQL in section 'Up' is executed when this migration is applied
RENAME TABLE `pending_authz` to `pendingAuthorizations`;
-- +goose Down
-- SQL section 'Down' is executed when this migration is rolled back
RENAME TABLE `pendingAuthorizations` to `pending_authz`;

View File

@ -133,7 +133,7 @@ func initTables(dbMap *gorp.DbMap) {
regTable.SetVersionCol("LockCol")
regTable.ColMap("Key").SetNotNull(true)
regTable.ColMap("KeySHA256").SetNotNull(true).SetUnique(true)
pendingAuthzTable := dbMap.AddTableWithName(pendingauthzModel{}, "pending_authz").SetKeys(false, "ID")
pendingAuthzTable := dbMap.AddTableWithName(pendingauthzModel{}, "pendingAuthorizations").SetKeys(false, "ID")
pendingAuthzTable.SetVersionCol("LockCol")
dbMap.AddTableWithName(authzModel{}, "authz").SetKeys(false, "ID")
dbMap.AddTableWithName(challModel{}, "challenges").SetKeys(true, "ID").SetVersionCol("LockCol")

View File

@ -73,7 +73,7 @@ func statusIsPending(status core.AcmeStatus) bool {
func existingPending(tx *gorp.Transaction, id string) bool {
var count int64
_ = tx.SelectOne(&count, "SELECT count(*) FROM pending_authz WHERE id = :id", map[string]interface{}{"id": id})
_ = tx.SelectOne(&count, "SELECT count(*) FROM pendingAuthorizations WHERE id = :id", map[string]interface{}{"id": id})
return count > 0
}
@ -183,7 +183,7 @@ func (ssa *SQLStorageAuthority) GetAuthorization(id string) (authz core.Authoriz
return
}
if authObj == nil {
err = fmt.Errorf("No pending_authz or authz with ID %s", id)
err = fmt.Errorf("No pendingAuthorization or authz with ID %s", id)
tx.Rollback()
return
}