diff --git a/nomad/state/schema.go b/nomad/state/schema.go index 6d9675c86..b060eda5d 100644 --- a/nomad/state/schema.go +++ b/nomad/state/schema.go @@ -26,6 +26,7 @@ func stateStoreSchema() *memdb.DBSchema { evalTableSchema, allocTableSchema, vaultAccessorTableSchema, + aclPolicyTableSchema, } // Add each of the tables @@ -430,3 +431,21 @@ func vaultAccessorTableSchema() *memdb.TableSchema { }, } } + +// aclPolicyTableSchema returns the MemDB schema for the policy table. +// This table is used to store the policies which are refrenced by tokens +func aclPolicyTableSchema() *memdb.TableSchema { + return &memdb.TableSchema{ + Name: "acl_policy", + Indexes: map[string]*memdb.IndexSchema{ + "id": &memdb.IndexSchema{ + Name: "id", + AllowMissing: false, + Unique: true, + Indexer: &memdb.StringFieldIndex{ + Field: "Name", + }, + }, + }, + } +}