strict constraint for database table creation
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Identity (keystone) |
Fix Released
|
Medium
|
Dolph Mathews |
Bug Description
OpenStack claims that any type of database supporting SQLAlchemy can be taken as the database for OpenStack use.
In some databases, if a column is defined as UNIQUE, it must be specified NOT NULL at the same time, e.g. IBM DB2, which is SQLAlchemy supporting. I am doing some tests with DB2 now.
For the tables TENANT, USER and ROLE, they all have the column NAME, but they don't define this column NOT NULL. For database like MYSQL, it is permitted and keystone-manage db_sync works well. However, for database with strict constrains, like IBM DB2, this is not allowed. Running keystone-manage db_sync will prompt the error, which tells me UNIQUE and NOT NULL must be specified for the column NAME.
Suggestion:
In the code keystone/
name = sql.Column(
If we change it into
name = sql.Column(
this issue will be solved.
Changed in keystone: | |
status: | Fix Committed → Fix Released |
Changed in keystone: | |
milestone: | folsom-1 → 2012.2 |
For the User, Tenant, and Role names, it definitely makes sense to me that they should be treated as unique and non-nullable.
I don't believe the catalog or token drivers are affected.