diff --git a/src/app/models/ui-request.model.ts b/src/app/models/ui-request.model.ts index 7b022c23..f3c10560 100644 --- a/src/app/models/ui-request.model.ts +++ b/src/app/models/ui-request.model.ts @@ -271,6 +271,24 @@ export class EditTableRequest { } } +/** + * Transfer a table from one namespace to another. + * Used for request where you want to transfer a table + */ + export class TransferTableRequest { + table: string; + sourceSchema: string; + targetSchema: string; + primaryKeyNames: string; + + constructor( table: string, sourceNamespaceName: string, targetNamespaceName: string, primaryKeyNames: string ) { + this.table = table; + this.sourceSchema = sourceNamespaceName; + this.targetSchema = targetNamespaceName; + this.primaryKeyNames = primaryKeyNames; + } +} + export class EditCollectionRequest { database: string; collection: string; diff --git a/src/app/services/crud.service.ts b/src/app/services/crud.service.ts index b9933953..f4a12b8c 100644 --- a/src/app/services/crud.service.ts +++ b/src/app/services/crud.service.ts @@ -19,6 +19,7 @@ import { GraphRequest, MaterializedRequest, MonitoringRequest, + TransferTableRequest, QueryRequest, RelAlgRequest, Schema, @@ -225,6 +226,13 @@ export class CrudService { return this._http.post(`${this.httpUrl}/createTable`, tableRequest, this.httpOptions); } + /** + * Transfer a table to another schema + */ + transferTable( tableRequest: TransferTableRequest ) { + return this._http.post(`${this.httpUrl}/transferTable`, tableRequest, this.httpOptions); + } + /** * Create a new collection */ diff --git a/src/app/views/schema-editing/document-edit-collections/document-edit-collections.component.html b/src/app/views/schema-editing/document-edit-collections/document-edit-collections.component.html index c2c7c175..903948f3 100644 --- a/src/app/views/schema-editing/document-edit-collections/document-edit-collections.component.html +++ b/src/app/views/schema-editing/document-edit-collections/document-edit-collections.component.html @@ -11,6 +11,7 @@