[ovs-dev] [indexes 6/6] vswitchd: Add unique indexes for some columns.

Ben Pfaff blp at nicira.com
Thu Jun 2 23:19:24 UTC 2011


This is mainly intended to make life easier for database clients that don't
already have code to avoid creating records with duplicate names in various
OVS database tables.  With this commit, the database server itself rejects
attempts to add Port or Interface records with duplicate names or
Controller or Manager records with duplicate targets.
---
 vswitchd/vswitch.ovsschema |   22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/vswitchd/vswitch.ovsschema b/vswitchd/vswitch.ovsschema
index 4ad5c38..553ca61 100644
--- a/vswitchd/vswitch.ovsschema
+++ b/vswitchd/vswitch.ovsschema
@@ -1,6 +1,6 @@
 {"name": "Open_vSwitch",
- "version": "4.0.0",
- "cksum": "2606080158 14328",
+ "version": "5.0.0",
+ "cksum": "1004300749 14464",
  "tables": {
    "Open_vSwitch": {
      "columns": {
@@ -92,7 +92,8 @@
          "type": {"key": {"type": "integer",
                           "minInteger": 0,
                           "maxInteger": 4095},
-                  "min": 0, "max": 4096}}}},
+                  "min": 0, "max": 4096}}},
+     "indexes": [["name"]]},
    "Port": {
      "columns": {
        "name": {
@@ -138,7 +139,8 @@
        "other_config": {
          "type": {"key": "string", "value": "string", "min": 0, "max": "unlimited"}},
        "external_ids": {
-         "type": {"key": "string", "value": "string", "min": 0, "max": "unlimited"}}}},
+         "type": {"key": "string", "value": "string", "min": 0, "max": "unlimited"}}},
+     "indexes": [["name"]]},
    "Interface": {
      "columns": {
        "name": {
@@ -208,7 +210,8 @@
          "ephemeral": true},
        "mtu": {
          "type": {"key": "integer", "min": 0, "max": 1},
-         "ephemeral": true}}},
+         "ephemeral": true}},
+     "indexes": [["name"]]},
    "QoS": {
      "columns": {
        "type": {
@@ -241,8 +244,7 @@
        "name": {
          "type": "string"},
        "select_all": {
-         "type": "boolean"
-       },
+         "type": "boolean"},
        "select_src_port": {
          "type": {"key": {"type": "uuid",
                           "refTable": "Port",
@@ -353,7 +355,8 @@
          "ephemeral": true},
        "status": {
          "type": {"key": "string", "value": "string", "min": 0, "max": "unlimited"},
-         "ephemeral": true}}},
+         "ephemeral": true}},
+     "indexes": [["target"]]},
    "Manager": {
      "columns": {
        "target": {
@@ -376,7 +379,8 @@
          "ephemeral": true},
        "status": {
          "type": {"key": "string", "value": "string", "min": 0, "max": "unlimited"},
-         "ephemeral": true}}},
+         "ephemeral": true}},
+     "indexes": [["target"]]},
    "SSL": {
      "columns": {
        "private_key": {
-- 
1.7.4.4




More information about the dev mailing list