 ALTER SEQUENCE "public"."collection_index__id_seq" OWNED BY "collection_index"."_id";
 ALTER SEQUENCE "public"."collection_index_item__id_seq" OWNED BY "collection_index_item"."_id";
 ALTER SEQUENCE "public"."collection_keyspace__id_seq" OWNED BY "collection_keyspace"."_id";
-ALTER SEQUENCE "public"."collection_keyspace_item__id_seq" OWNED BY "collection_keyspace_item"."_id";
+ALTER SEQUENCE "public"."collection_keyspace_item__id_seq" OWNED BY "collection_keyspace_shardkey"."_id";
 ALTER SEQUENCE "public"."collection_keyspace_partition__id_seq" OWNED BY "collection_keyspace_partition"."_id";
-ALTER SEQUENCE "public"."collection_keyspace_partition_datastore_vshard__id_seq" OWNED BY "collection_keyspace_partition_datastore_vshard_instance"."_id";
+ALTER SEQUENCE "public"."collection_keyspace_partition_datastore_vshard__id_seq" OWNED BY "collection_keyspace_partition_datastore_vshard"."_id";
 ALTER SEQUENCE "public"."database__id_seq" OWNED BY "database"."_id";
 ALTER SEQUENCE "public"."database_datastore__id_seq" OWNED BY "database_datastore"."_id";
 ALTER SEQUENCE "public"."datasource__id_seq" OWNED BY "datasource"."_id";

;

-- ----------------------------
-- Table structure for collection_keyspace_partition_datastore_vshard_instance
-- ----------------------------
DROP TABLE IF EXISTS "public"."collection_keyspace_partition_datastore_vshard_instance";
CREATE TABLE "public"."collection_keyspace_partition_datastore_vshard_instance" (
"_id" int4 DEFAULT nextval('collection_keyspace_partition_datastore_vshard__id_seq'::regclass) NOT NULL,
"collection_keyspace_partition_id" int4 NOT NULL,
"datastore_vshard_instance_id" int4 NOT NULL,
"order" int4 NOT NULL
)
WITH (OIDS=FALSE)

ALTER TABLE "public"."datastore_shard_replica" ADD PRIMARY KEY ("_id");

-- ----------------------------
-- Indexes structure for table datastore_vshard
-- ----------------------------
CREATE UNIQUE INDEX "datastore_vshard_name_idx" ON "public"."datastore_vshard" USING btree ("name");

-- ----------------------------
-- Primary Key structure for table datastore_vshard
-- ----------------------------
ALTER TABLE "public"."datastore_vshard" ADD PRIMARY KEY ("_id");
