Repository: rucio/rucio
Issue: `import rucio.core.rule` fails with missing section

The work in #339 caused a regression if the `permission` section does not exist.  From the logs:

```
mod_wsgi (pid=18803): Exception occurred processing WSGI script '/usr/lib/python2.7/site-packages/rucio/web/rest/did.py'.
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/rucio/web/rest/did.py", line 22, in <module>
    from rucio.api.did import (add_did, add_dids, list_content, list_content_history,
  File "/usr/lib/python2.7/site-packages/rucio/api/did.py", line 19, in <module>
    from rucio.core import did, naming_convention, meta as meta_core
  File "/usr/lib/python2.7/site-packages/rucio/core/did.py", line 35, in <module>
    import rucio.core.rule
  File "/usr/lib/python2.7/site-packages/rucio/core/rule.py", line 2888, in <module>
    def archive_localgroupdisk_datasets(scope, name, session=None):
  File "/usr/lib/python2.7/site-packages/rucio/common/policy.py", line 78, in policy_filter
    policy = get_policy()
  File "/usr/lib/python2.7/site-packages/rucio/common/policy.py", line 40, in get_policy
    policy = config_get('permission', 'policy')
  File "/usr/lib/python2.7/site-packages/rucio/common/config.py", line 30, in config_get
    return __CONFIG.get(section, option)
  File "/usr/lib64/python2.7/ConfigParser.py", line 607, in get
    raise NoSectionError(section)
NoSectionError: No section: 'permission'
```

Seems that this exception type is simply not caught.

Changed files:
lib/rucio/common/policy.py, lib/rucio/common/schema/atlas.py, lib/rucio/common/schema/cms.py, lib/rucio/db/sqla/models.py, lib/rucio/common/schema/generic.py

diff --git a/lib/rucio/common/policy.py b/lib/rucio/common/policy.py
index b0c3efc7e..62403709c 100644
--- a/lib/rucio/common/policy.py
+++ b/lib/rucio/common/policy.py
@@ -38,7 +38,7 @@ def get_policy():
     if isinstance(policy, NoValue):
         try:
             policy = config_get('permission', 'policy')
-        except NoOptionError:
+        except (NoOptionError, NoSectionError):
             policy = 'atlas'
         REGION.set('policy', policy)
     return policy
diff --git a/lib/rucio/common/schema/atlas.py b/lib/rucio/common/schema/atlas.py
index ff23cfab0..2b526d7e0 100644
--- a/lib/rucio/common/schema/atlas.py
+++ b/lib/rucio/common/schema/atlas.py
@@ -7,7 +7,7 @@
   http://www.apache.org/licenses/LICENSE-2.0
 
   Authors:
-  - Vincent Garonne, <vincent.garonne@cern.ch>, 2013-2016
+  - Vincent Garonne, <vincent.garonne@cern.ch>, 2013-2017
   - Cedric Serfon, <cedric.serfon@cern.ch>, 2014-2015, 2017
   - Joaquin Bogado, <joaquin.bogado@cern.ch>, 2015
   - Mario Lassnig, <mario.lassnig@cern.ch>, 2015
@@ -43,17 +43,21 @@ ACTIVITY = {"description": "Activity name",
                      "T0 Export", "T0 Tape", "Upload/Download (Job)",
                      "Upload/Download (User)", "User Subscriptions"]}
 
+SCOPE_LENGTH = 25
+
 SCOPE = {"description": "Scope name",
          "type": "string",
-         "pattern": "^[a-zA-Z'_'-.0-9]{1,30}$"}
+         "pattern": "^[a-zA-Z'_'-.0-9]{1,%s}$" % SCOPE_LENGTH}
 
 R_SCOPE = {"description": "Scope name",
            "type": "string",
            "pattern": "\\\\w"}
 
+NAME_LENGTH = 250
+
 NAME = {"description": "Data Identifier name",
         "type": "string",
-        "pattern": "^[A-Za-z0-9][A-Za-z0-9\\\\.\\\\-\\\\_]{1,255}$"}
+        "pattern": "^[A-Za-z0-9][A-Za-z0-9\\\\.\\\\-\\\\_]{1,%s}$" % NAME_LENGTH}
 
 R_NAME = {"description": "Data Identifier name",
           "type": "string",
diff --git a/lib/rucio/common/schema/cms.py b/lib/rucio/common/schema/cms.py
index b97b9feb3..f8e19adce 100644
--- a/lib/rucio/common/schema/cms.py
+++ b/lib/rucio/common/schema/cms.py
@@ -7,7 +7,7 @@
   http://www.apache.org/licenses/LICENSE-2.0
 
   Authors:
-  - Vincent Garonne, <vincent.garonne@cern.ch>, 2013-2016
+  - Vincent Garonne, <vincent.garonne@cern.ch>, 2013-2017
   - Cedric Serfon, <cedric.serfon@cern.ch>, 2014-2015, 2017
   - Joaquin Bogado, <joaquin.bogado@cern.ch>, 2015
   - Mario Lassnig, <mario.lassnig@cern.ch>, 2015
@@ -43,21 +43,25 @@ ACTIVITY = {"description": "Activity name",
                      "T0 Export", "T0 Tape", "Upload/Download (Job)",
                      "Upload/Download (User)", "User Subscriptions"]}
 
+SCOPE_LENGTH = 25
+
 SCOPE = {"description": "Scope name",
          "type": "string",
-         "pattern": "^[a-zA-Z'_'-.0-9]{1,30}$"}
+         "pattern": "^[a-zA-Z'_'-.0-9]{1,%s}$" % SCOPE_LENGTH}
 
 R_SCOPE = {"description": "Scope name",
            "type": "string",
            "pattern": "\\\\w"}
 
+
+NAME_LENGTH = 500
+
 NAME = {"description": "Data Identifier name",
         "type": "string",
-        "pattern": "^\\/[A-Za-z0-9][A-Za-z0-9\\\\.\\\\-\\\\_\\/\\#]{1,255}$"}
+        "pattern": "^\\/[A-Za-z0-9][A-Za-z0-9\\\\.\\\\-\\\\_\\/\\#]{1,%s}$" % NAME_LENGTH}
 
-R_NAME = {"description": "Data Identifier name",
-          "type": "string",
-          "pattern": "^\\/[A-Za-z0-9][A-Za-z0-9\\\\.\\\\-\\\\_\\/]{1,255}$"}
+# read name
+R_NAME = NAME
 
 LOCKED = {"description": "Rule locked status",
           "type": ["boolean", "null"]}
diff --git a/lib/rucio/common/schema/generic.py b/lib/rucio/common/schema/generic.py
index ff23cfab0..2b526d7e0 100644
--- a/lib/rucio/common/schema/generic.py
+++ b/lib/rucio/common/schema/generic.py
@@ -7,7 +7,7 @@
   http://www.apache.org/licenses/LICENSE-2.0
 
   Authors:
-  - Vincent Garonne, <vincent.garonne@cern.ch>, 2013-2016
+  - Vincent Garonne, <vincent.garonne@cern.ch>, 2013-2017
   - Cedric Serfon, <cedric.serfon@cern.ch>, 2014-2015, 2017
   - Joaquin Bogado, <joaquin.bogado@cern.ch>, 2015
   - Mario Lassnig, <mario.lassnig@cern.ch>, 2015
@@ -43,17 +43,21 @@ ACTIVITY = {"description": "Activity name",
                      "T0 Export", "T0 Tape", "Upload/Download (Job)",
                      "Upload/Download (User)", "User Subscriptions"]}
 
+SCOPE_LENGTH = 25
+
 SCOPE = {"description": "Scope name",
          "type": "string",
-         "pattern": "^[a-zA-Z'_'-.0-9]{1,30}$"}
+         "pattern": "^[a-zA-Z'_'-.0-9]{1,%s}$" % SCOPE_LENGTH}
 
 R_SCOPE = {"description": "Scope name",
            "type": "string",
            "pattern": "\\\\w"}
 
+NAME_LENGTH = 250
+
 NAME = {"description": "Data Identifier name",
         "type": "string",
-        "pattern": "^[A-Za-z0-9][A-Za-z0-9\\\\.\\\\-\\\\_]{1,255}$"}
+        "pattern": "^[A-Za-z0-9][A-Za-z0-9\\\\.\\\\-\\\\_]{1,%s}$" % NAME_LENGTH}
 
 R_NAME = {"description": "Data Identifier name",
           "type": "string",
diff --git a/lib/rucio/db/sqla/models.py b/lib/rucio/db/sqla/models.py
index 6e9f03ff5..a302fc9eb 100644
--- a/lib/rucio/db/sqla/models.py
+++ b/lib/rucio/db/sqla/models.py
@@ -30,6 +30,7 @@ from sqlalchemy.sql import Delete
 from sqlalchemy.types import LargeBinary
 
 from rucio.common import utils
+from rucio.common.schema import NAME_LENGTH, SCOPE_LENGTH
 from rucio.db.sqla.constants import (AccountStatus, AccountType, DIDAvailability, DIDType, DIDReEvaluation,
                                      KeyType, IdentityType, LockState, RuleGrouping, BadFilesStatus,
                                      RuleState, ReplicaState, RequestState, RequestType, RSEType,
@@ -295,7 +296,7 @@ class IdentityAccountAssociation(BASE, ModelBase):
 class Scope(BASE, ModelBase):
     """Represents a scope"""
     __tablename__ = 'scopes'
-    scope = Column(String(25))
+    scope = Column(String(SCOPE_LENGTH))
     account = Column(String(25))
     is_default = Column(Boolean(name='SCOPES_DEFAULT_CHK'), default=False)
     status = Column(ScopeStatus.db_type(name='SCOPE_STATUS_CHK', default=ScopeStatus.OPEN))
@@ -311,8 +312,8 @@ class Scope(BASE, ModelBase):
 class DataIdentifier(BASE, ModelBase):
     """Represents a dataset"""
     __tablename__ = 'dids'
-    scope = Column(String(25))
-    name = Column(String(255))
+    scope = Column(String(SCOPE_LENGTH))
+    name = Column(String(NAME_LENGTH))
     account = Column(String(25))
     did_type = Column(DIDType.db_type(name='DIDS_TYPE_CHK'))
     is_open = Column(Boolean(name='DIDS_IS_OPEN_CHK'))
@@ -368,8 +369,8 @@ class DataIdentifier(BASE, ModelBase):
 class DeletedDataIdentifier(BASE, ModelBase):
     """Represents a dataset"""
     __tablename__ = 'deleted_dids'
-    scope = Column(String(25))
-    name = Column(String(255))
+    scope = Column(String(SCOPE_LENGTH))
+    name = Column(String(NAME_LENGTH))
     account = Column(String(25))
     did_type = Column(DIDType.db_type(name='DEL_DIDS_TYPE_CHK'))
     is_open = Column(Boolean(name='DEL_DIDS_IS_OPEN_CHK'))
@@ -416,8 +417,8 @@ class UpdatedDID(BASE, ModelBase):
     """Represents the recently updated dids"""
     __tablename__ = 'updated_dids'
     id = Column(GUID(), default=utils.generate_uuid)
-    scope = Column(String(25))
-    name = Column(String(255))
+    scope = Column(String(SCOPE_LENGTH))
+    name = Column(String(NAME_LENGTH))
     rule_evaluation_action = Column(DIDReEvaluation.db_type(name='UPDATED_DIDS_RULE_EVAL_ACT_CHK'))
     _table_args = (PrimaryKeyConstraint('id', name='UPDATED_DIDS_PK'),
                    CheckConstraint('SCOPE IS NOT NULL', name='UPDATED_DIDS_SCOPE_NN'),
@@ -428,8 +429,8 @@ class UpdatedDID(BASE, ModelBase):
 class BadReplicas(BASE, ModelBase):
     """Represents the suspicious or bad replicas"""
     __tablename__ = 'bad_replicas'
-    scope = Column(String(25))
-    name = Column(String(255))
+    scope = Column(String(SCOPE_LENGTH))
+    name = Column(String(NAME_LENGTH))
     rse_id = Column(GUID())
     reason = Column(String(255))
     state = Column(BadFilesStatus.db_type(name='BAD_REPLICAS_STATE_CHK'), default=BadFilesStatus.SUSPICIOUS)
@@ -450,8 +451,8 @@ class QuarantinedReplica(BASE, ModelBase, Versioned):
     bytes = Column(BigInteger)
     md5 = Column(String(32))
     adler32 = Column(String(8))
-    scope = Column(String(25))
-    name = Column(String(255))
+    scope = Column(String(SCOPE_LENGTH))
+    name = Column(String(NAME_LENGTH))
     _table_args = (PrimaryKeyConstraint('rse_id', 'path', name='QURD_REPLICAS_STATE_PK'),
                    ForeignKeyConstraint(['rse_id'], ['rses.id'], name='QURD_REPLICAS_RSE_ID_FK'))
 
@@ -481,10 +482,10 @@ class DIDKeyValueAssociation(BASE, ModelBase):
 class DataIdentifierAssociation(BASE, ModelBase):
     """Represents the map between containers/datasets and files"""
     __tablename__ = 'contents'
-    scope = Column(String(25))          # dataset scope
-    name = Column(String(255))          # dataset name
-    child_scope = Column(String(25))    # Provenance scope
-    child_name = Column(String(255))    # Provenance name
+    scope = Column(String(SCOPE_LENGTH))  # dataset scope
+    name = Column(String(NAME_LENGTH))    # dataset name
+    child_scope = Column(String(SCOPE_LENGTH))  # Provenance scope
+    child_name = Column(String(NAME_LENGTH))    # Provenance name
     did_type = Column(DIDType.db_type(name='CONTENTS_DID_TYPE_CHK'))
     child_type = Column(DIDType.db_type(name='CONTENTS_CHILD_TYPE_CHK'))
     bytes = Column(BigInteger)
@@ -504,10 +505,10 @@ class DataIdentifierAssociation(BASE, ModelBase):
 class ConstituentAssociation(BASE, ModelBase):
     """Represents the map between archives and constituents"""
     __tablename__ = 'archive_contents'
-    child_scope = Column(String(25))    # Constituent file scope
-    child_name = Column(String(255))    # Constituent file name
-    scope = Column(String(25))          # Archive file scope
-    name = Column(String(255))          # Archive file name
+    child_scope = Column(String(SCOPE_LENGTH))    # Constituent file scope
+    child_name = Column(String(NAME_LENGTH))    # Constituent file name
+    scope = Column(String(SCOPE_LENGTH))          # Archive file scope
+    name = Column(String(NAME_LENGTH))          # Archive file name
     bytes = Column(BigInteger)
     adler32 = Column(String(8))
     md5 = Column(String(32))
@@ -527,10 +528,10 @@ class ConstituentAssociation(BASE, ModelBase):
 class ConstituentAssociationHistory(BASE, ModelBase):
     """Represents the map between archives and constituents"""
     __tablename__ = 'archive_contents_history'
-    child_scope = Column(String(25))    # Constituent file scope
-    child_name = Column(String(255))    # Constituent file name
-    scope = Column(String(25))          # Archive file scope
-    name = Column(String(255))          # Archive file name
+    child_scope = Column(String(SCOPE_LENGTH))    # Constituent file scope
+    child_name = Column(String(NAME_LENGTH))    # Constituent file name
+    scope = Column(String(SCOPE_LENGTH))          # Archive file scope
+    name = Column(String(NAME_LENGTH))  # Archive file name
     bytes = Column(BigInteger)
     adler32 = Column(String(8))
     md5 = Column(String(32))
@@ -543,10 +544,10 @@ class ConstituentAssociationHistory(BASE, ModelBase):
 class DataIdentifierAssociationHistory(BASE, ModelBase):
     """Represents the map history between containers/datasets and files"""
     __tablename__ = 'contents_history'
-    scope = Column(String(25))          # dataset scope
-    name = Column(String(255))          # dataset name
-    child_scope = Column(String(25))    # Provenance scope
-    child_name = Column(String(255))    # Provenance name
+    scope = Column(String(SCOPE_LENGTH))          # dataset scope
+    name = Column(String(NAME_LENGTH))  # dataset name
+    child_scope = Column(String(SCOPE_LENGTH))          # Provenance scope
+    child_name = Column(String(NAME_LENGTH))  # Provenance name
     did_type = Column(DIDType.db_type(name='CONTENTS_HIST_DID_TYPE_CHK'))
     child_type = Column(DIDType.db_type(name='CONTENTS_HIST_CHILD_TYPE_CHK'))
     bytes = Column(BigInteger)
@@ -700,8 +701,8 @@ class RSEFileAssociation(BASE, ModelBase):
     """Represents the map between locations and files"""
     __tablename__ = 'replicas'
     rse_id = Column(GUID())
-    scope = Column(String(25))
-    name = Column(String(255))
+    scope = Column(String(SCOPE_LENGTH))
+    name = Column(String(NAME_LENGTH))
     bytes = Column(BigInteger)
     md5 = Column(String(32))
     adler32 = Column(String(8))
@@ -718,14 +719,14 @@ class RSEFileAssociation(BASE, ModelBase):
                    CheckConstraint('bytes IS NOT NULL', name='REPLICAS_SIZE_NN'),
                    CheckConstraint('lock_cnt IS NOT NULL', name='REPLICAS_LOCK_CNT_NN'),
                    Index('REPLICAS_TOMBSTONE_IDX', 'tombstone'),
-                   Index('REPLICAS_PATH_IDX', 'path', mysql_length=255))
+                   Index('REPLICAS_PATH_IDX', 'path', mysql_length=NAME_LENGTH))
 
 
 class CollectionReplica(BASE, ModelBase):
     """Represents replicas for datasets/collections"""
     __tablename__ = 'collection_replicas'
-    scope = Column(String(25))
-    name = Column(String(255))
+    scope = Column(String(SCOPE_LENGTH))
+    name = Column(String(NAME_LENGTH))
     did_type = Column(DIDType.db_type(name='COLLECTION_REPLICAS_TYPE_CHK'))
     rse_id = Column(GUID())
     bytes = Column(BigInteger)
@@ -746,8 +747,8 @@ class UpdatedCollectionReplica(BASE, ModelBase):
     """Represents updates to replicas for datasets/collections"""
     __tablename__ = 'updated_col_rep'
     id = Column(GUID(), default=utils.generate_uuid)
-    scope = Column(String(25))
-    name = Column(String(255))
+    scope = Column(String(SCOPE_LENGTH))
+    name = Column(String(NAME_LENGTH))
     did_type = Column(DIDType.db_type(name='UPDATED_COL_REP_TYPE_CHK'))
     rse_id = Column(GUID())
     _table_args = (PrimaryKeyConstraint('id', name='UPDATED_COL_REP_PK'),
@@ -760,8 +761,8 @@ class RSEFileAssociationHistory(BASE, ModelBase):
     """Represents a short history of the deleted replicas"""
     __tablename__ = 'replicas_history'
     rse_id = Column(GUID())
-    scope = Column(String(25))
-    name = Column(String(255))
+    scope = Column(String(SCOPE_LENGTH))
+    name = Column(String(NAME_LENGTH))
     bytes = Column(BigInteger)
     _table_args = (PrimaryKeyConstraint('rse_id', 'scope', 'name', name='REPLICAS_HIST_PK'),
                    ForeignKeyConstraint(['rse_id'], ['rses.id'], name='REPLICAS_HIST_RSE_ID_FK'),
@@ -775,8 +776,8 @@ class ReplicationRule(BASE, ModelBase):
     id = Column(GUID(), default=utils.generate_uuid)
     subscription_id = Column(GUID())
     account = Column(String(25))
-    scope = Column(String(25))
-    name = Column(String(255))
+    scope = Column(String(SCOPE_LENGTH))
+    name = Column(String(NAME_LENGTH))
     did_type = Column(DIDType.db_type(name='RULES_DID_TYPE_CHK'))
     state = Column(RuleState.db_type(name='RULES_STATE_CHK'), default=RuleState.REPLICATING)
     error = Column(String(255))
@@ -833,8 +834,8 @@ class ReplicationRuleHistoryRecent(BASE, ModelBase):
     id = Column(GUID())
     subscription_id = Column(GUID())
     account = Column(String(25))
-    scope = Column(String(25))
-    name = Column(String(255))
+    scope = Column(String(SCOPE_LENGTH))
+    name = Column(String(NAME_LENGTH))
     did_type = Column(DIDType.db_type())
     state = Column(RuleState.db_type())
     error = Column(String(255))
@@ -872,8 +873,8 @@ class ReplicationRuleHistory(BASE, ModelBase):
     id = Column(GUID())
     subscription_id = Column(GUID())
     account = Column(String(25))
-    scope = Column(String(25))
-    name = Column(String(255))
+    scope = Column(String(SCOPE_LENGTH))
+    name = Column(String(NAME_LENGTH))
     did_type = Column(DIDType.db_type())
     state = Column(RuleState.db_type())
     error = Column(String(255))
@@ -906,8 +907,8 @@ class ReplicationRuleHistory(BASE, ModelBase):
 class ReplicaLock(BASE, ModelBase):
     """Represents replica locks"""
     __tablename__ = 'locks'
-    scope = Column(String(25))
-    name = Column(String(255))
+    scope = Column(String(SCOPE_LENGTH))
+    name = Column(String(NAME_LENGTH))
     rule_id = Column(GUID())
     rse_id = Column(GUID())
     account = Column(String(25))
@@ -926,8 +927,8 @@ class ReplicaLock(BASE, ModelBase):
 class DatasetLock(BASE, ModelBase):
     """Represents dataset locks"""
     __tablename__ = 'dataset_locks'
-    scope = Column(String(25))
-    name = Column(String(255))
+    scope = Column(String(SCOPE_LENGTH))
+    name = Column(String(NAME_LENGTH))
     rule_id = Column(GUID())
     rse_id = Column(GUID())
     account = Column(String(25))
@@ -964,8 +965,8 @@ class Request(BASE, ModelBase, Versioned):
     __tablename__ = 'requests'
     id = Column(GUID(), default=utils.generate_uuid)
     request_type = Column(RequestType.db_type(name='REQUESTS_TYPE_CHK'), default=RequestType.TRANSFER)
-    scope = Column(String(25))
-    name = Column(String(255))
+    scope = Column(String(SCOPE_LENGTH))
+    name = Column(String(NAME_LENGTH))
     did_type = Column(DIDType.db_type(name='REQUESTS_DIDTYPE_CHK'), default=DIDType.FILE)
     dest_rse_id = Column(GUID())
     source_rse_id = Column(GUID())
@@ -1008,8 +1009,8 @@ class Source(BASE, ModelBase, Versioned):
     """Represents source files for transfers"""
     __tablename__ = 'sources'
     request_id = Column(GUID())
-    scope = Column(String(25))
-    name = Column(String(255))
+    scope = Column(String(SCOPE_LENGTH))
+    name = Column(String(NAME_LENGTH))
     rse_id = Column(GUID())
     dest_rse_id = Column(GUID())
     url = Column(String(2048))
@@ -1139,7 +1140,7 @@ class Heartbeats(BASE, ModelBase):
 class NamingConvention(BASE, ModelBase):
     """Represents naming conventions for name within a scope"""
     __tablename__ = 'naming_conventions'
-    scope = Column(String(25))
+    scope = Column(String(SCOPE_LENGTH))
     regexp = Column(String(255))
     convention_type = Column(KeyType.db_type(name='CVT_TYPE_CHK'))
     _table_args = (PrimaryKeyConstraint('scope', name='NAMING_CONVENTIONS_PK'),
@@ -1149,8 +1150,8 @@ class NamingConvention(BASE, ModelBase):
 class TemporaryDataIdentifier(BASE, ModelBase):
     """Represents a temporary DID (pre-merged files, etc.)"""
     __tablename__ = 'tmp_dids'
-    scope = Column(String(25))
-    name = Column(String(255))
+    scope = Column(String(SCOPE_LENGTH))
+    name = Column(String(NAME_LENGTH))
     rse_id = Column(GUID())
     path = Column(String(1024))
     bytes = Column(BigInteger)
@@ -1161,8 +1162,8 @@ class TemporaryDataIdentifier(BASE, ModelBase):
     events = Column(BigInteger)
     task_id = Column(Integer())
     panda_id = Column(Integer())
-    parent_scope = Column(String(25))
-    parent_name = Column(String(255))
+    parent_scope = Column(String(SCOPE_LENGTH))
+    parent_name = Column(String(NAME_LENGTH))
     offset = Column(BigInteger)
     _table_args = (PrimaryKeyConstraint('scope', 'name', name='TMP_DIDS_PK'),
                    Index('TMP_DIDS_EXPIRED_AT_IDX', 'expired_at'))
@@ -1172,8 +1173,8 @@ class LifetimeExceptions(BASE, ModelBase):
     """Represents the exceptions to the lifetime model"""
     __tablename__ = 'lifetime_except'
     id = Column(GUID(), default=utils.generate_uuid)
-    scope = Column(String(25))
-    name = Column(String(255))
+    scope = Column(String(SCOPE_LENGTH))
+    name = Column(String(NAME_LENGTH))
     did_type = Column(DIDType.db_type(name='LIFETIME_EXCEPT_TYPE_CHK'))
     account = Column(String(25))
     pattern = Column(String(255))