Merge "ID should be biginteger in resource routing table"

This commit is contained in:
Jenkins 2016-12-09 06:38:46 +00:00 committed by Gerrit Code Review
commit 64f56484f2
3 changed files with 15 additions and 11 deletions

View File

@ -583,7 +583,7 @@ attributes are described in the following table.
+-------------+-------+---------------+-----------------------------------------------------+
|Name |In | Type | Description |
+=============+=======+===============+=====================================================+
|id |body | uuid |id is the unique identification of the resource |
|id |body | biginteger |id is the unique identification of the resource |
| | | |routing. |
+-------------+-------+---------------+-----------------------------------------------------+
|top_id |body | string |top_id denotes the resource id on central Neutron. |
@ -672,7 +672,7 @@ Normal Response Code: 200
+-------------+-------+---------------+-----------------------------------------------------+
|Name |In | Type | Description |
+=============+=======+===============+=====================================================+
|id |path | uuid |id is the unique identification of the resource |
|id |path | biginteger |id is the unique identification of the resource |
| | | |routing. |
+-------------+-------+---------------+-----------------------------------------------------+
@ -686,7 +686,7 @@ table.
+-------------+-------+---------------+-----------------------------------------------------+
|Name |In | Type | Description |
+=============+=======+===============+=====================================================+
|id |body | uuid |id is the unique identification of the resource |
|id |body | biginteger |id is the unique identification of the resource |
| | | |routing. |
+-------------+-------+---------------+-----------------------------------------------------+
|top_id |body | string |top_id denotes the resource id on central Neutron. |
@ -769,7 +769,7 @@ entry's attributes are listed below.
+-------------+-------+---------------+-----------------------------------------------------+
|Name |In | Type | Description |
+=============+=======+===============+=====================================================+
|id |body | uuid |id is the unique identification of the resource |
|id |body | biginteger |id is the unique identification of the resource |
| | | |routing. |
+-------------+-------+---------------+-----------------------------------------------------+
|top_id |body | string |top_id denotes the resource id on central Neutron. |
@ -844,7 +844,7 @@ Normal Response Code: 200
+-------------+-------+---------------+-----------------------------------------------------+
|Name |In | Type | Description |
+=============+=======+===============+=====================================================+
|id |path | uuid |id is the unique identification of the resource |
|id |path | biginteger |id is the unique identification of the resource |
| | | |routing. |
+-------------+-------+---------------+-----------------------------------------------------+
@ -898,7 +898,7 @@ attributes of routing entry are listed below.
+-------------+-------+---------------+-----------------------------------------------------+
|Name |In | Type | Description |
+=============+=======+===============+=====================================================+
|id |body | uuid |id is the unique identification of the resource |
|id |body | biginteger |id is the unique identification of the resource |
| | | |routing. |
+-------------+-------+---------------+-----------------------------------------------------+
|top_id |body | string |top_id denotes the resource id on central Neutron. |
@ -953,3 +953,4 @@ from the database.
"resource_type": "router"
}
}

View File

@ -241,7 +241,7 @@ def upgrade(migrate_engine):
cascaded_pods_resource_routing = sql.Table(
'cascaded_pods_resource_routing', meta,
sql.Column('id', sql.Integer, primary_key=True),
sql.Column('id', sql.BigInteger, primary_key=True),
sql.Column('top_id', sql.String(length=127), nullable=False),
sql.Column('bottom_id', sql.String(length=36)),
sql.Column('pod_id', sql.String(length=64), nullable=False),

View File

@ -13,14 +13,14 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_db.sqlalchemy import models
from oslo_utils import timeutils
import sqlalchemy as sql
from sqlalchemy.dialects import mysql
from sqlalchemy.orm import relationship
from sqlalchemy import schema
from oslo_db.sqlalchemy import models
from oslo_utils import timeutils
from tricircle.db import core
@ -442,7 +442,10 @@ class ResourceRouting(core.ModelBase, core.DictBase, models.TimestampMixin):
attributes = ['id', 'top_id', 'bottom_id', 'pod_id', 'project_id',
'resource_type', 'created_at', 'updated_at']
id = sql.Column('id', sql.Integer, primary_key=True)
# sqlite doesn't support auto increment on big integers so we use big int
# for everything but sqlite
id = sql.Column(sql.BigInteger().with_variant(sql.Integer(), 'sqlite'),
primary_key=True, autoincrement=True)
top_id = sql.Column('top_id', sql.String(length=127), nullable=False)
bottom_id = sql.Column('bottom_id', sql.String(length=36))
pod_id = sql.Column('pod_id', sql.String(length=64),