vswitchd: Add unique indexes for some columns.
authorBen Pfaff <blp@nicira.com>
Mon, 6 Jun 2011 16:21:45 +0000 (09:21 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 6 Jun 2011 16:21:45 +0000 (09:21 -0700)
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

index 4ad5c38..be23c92 100644 (file)
@@ -1,6 +1,6 @@
 {"name": "Open_vSwitch",
- "version": "4.0.0",
- "cksum": "2606080158 14328",
+ "version": "5.0.0",
+ "cksum": "456700307 14434",
  "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": {
        "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": {
          "ephemeral": true},
        "mtu": {
          "type": {"key": "integer", "min": 0, "max": 1},
-         "ephemeral": true}}},
+         "ephemeral": true}},
+     "indexes": [["name"]]},
    "QoS": {
      "columns": {
        "type": {
        "name": {
          "type": "string"},
        "select_all": {
-         "type": "boolean"
-       },
+         "type": "boolean"},
        "select_src_port": {
          "type": {"key": {"type": "uuid",
                           "refTable": "Port",
          "ephemeral": true},
        "status": {
          "type": {"key": "string", "value": "string", "min": 0, "max": "unlimited"},
-         "ephemeral": true}}},
+         "ephemeral": true}},
+     "indexes": [["target"]]},
    "SSL": {
      "columns": {
        "private_key": {