Associate anchor to schema set

- db schema updated
- db layer tests provided for ancor create and reading by dataspace
- anchor model is removed from rest api as extra
- api/spi updated to use string references instead of object

Issue-ID: CPS-99
Change-Id: Ideeb83fa9e91ec1816308d8327a6589b999c64c5
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
diff --git a/cps-ri/src/main/resources/schema.sql b/cps-ri/src/main/resources/schema.sql
index 2dce470..58b3c63 100755
--- a/cps-ri/src/main/resources/schema.sql
+++ b/cps-ri/src/main/resources/schema.sql
@@ -61,7 +61,7 @@
     ANCHOR_NAME TEXT,

     ANCHOR_ID BIGINT REFERENCES FRAGMENT(ID),

     PARENT_ID BIGINT REFERENCES FRAGMENT(ID),

-    MODULE_ID INTEGER REFERENCES MODULE(ID),

+    SCHEMA_SET_ID INTEGER REFERENCES SCHEMA_SET(ID),

     DATASPACE_ID INTEGER NOT NULL REFERENCES DATASPACE(ID),

     SCHEMA_NODE_ID INTEGER REFERENCES SCHEMA_NODE(ID),

     UNIQUE (DATASPACE_ID, ANCHOR_NAME, XPATH)

@@ -78,7 +78,7 @@
 );

 

 CREATE INDEX  IF NOT EXISTS "FKI_FRAGMENT_DATASPACE_ID_FK"     ON FRAGMENT USING BTREE(DATASPACE_ID) ;

-CREATE INDEX  IF NOT EXISTS "FKI_FRAGMENT_MODULE_ID_FK"        ON FRAGMENT USING BTREE(MODULE_ID) ;

+CREATE INDEX  IF NOT EXISTS "FKI_FRAGMENT_SCHEMA_SET_ID_FK"    ON FRAGMENT USING BTREE(SCHEMA_SET_ID) ;

 CREATE INDEX  IF NOT EXISTS "FKI_FRAGMENT_PARENT_ID_FK"        ON FRAGMENT USING BTREE(PARENT_ID) ;

 CREATE INDEX  IF NOT EXISTS "FKI_FRAGMENT_ANCHOR_ID_FK"        ON FRAGMENT USING BTREE(ANCHOR_ID) ;

 CREATE INDEX  IF NOT EXISTS "PERF_SCHEMA_NODE_SCHEMA_NODE_ID"  ON SCHEMA_NODE USING BTREE(SCHEMA_NODE_IDENTIFIER) ;