sql.py (keystone-19.0.0) | : | sql.py (keystone-19.0.1) | ||
---|---|---|---|---|
skipping to change at line 23 | skipping to change at line 23 | |||
# under the License. | # under the License. | |||
from keystone.common import sql | from keystone.common import sql | |||
from keystone.identity.mapping_backends import base | from keystone.identity.mapping_backends import base | |||
from keystone.identity.mapping_backends import mapping as identity_mapping | from keystone.identity.mapping_backends import mapping as identity_mapping | |||
class IDMapping(sql.ModelBase, sql.ModelDictMixin): | class IDMapping(sql.ModelBase, sql.ModelDictMixin): | |||
__tablename__ = 'id_mapping' | __tablename__ = 'id_mapping' | |||
public_id = sql.Column(sql.String(64), primary_key=True) | public_id = sql.Column(sql.String(64), primary_key=True) | |||
domain_id = sql.Column(sql.String(64), nullable=False) | domain_id = sql.Column(sql.String(64), nullable=False) | |||
local_id = sql.Column(sql.String(64), nullable=False) | local_id = sql.Column(sql.String(255), nullable=False) | |||
# NOTE(henry-nash): Postgres requires a name to be defined for an Enum | # NOTE(henry-nash): Postgres requires a name to be defined for an Enum | |||
entity_type = sql.Column( | entity_type = sql.Column( | |||
sql.Enum(identity_mapping.EntityType.USER, | sql.Enum(identity_mapping.EntityType.USER, | |||
identity_mapping.EntityType.GROUP, | identity_mapping.EntityType.GROUP, | |||
name='entity_type'), | name='entity_type'), | |||
nullable=False) | nullable=False) | |||
# Unique constraint to ensure you can't store more than one mapping to the | # Unique constraint to ensure you can't store more than one mapping to the | |||
# same underlying values | # same underlying values | |||
__table_args__ = ( | __table_args__ = ( | |||
sql.UniqueConstraint('domain_id', 'local_id', 'entity_type'),) | sql.UniqueConstraint('domain_id', 'local_id', 'entity_type'),) | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added |