[Groonga-commit] groonga/gcs [master] Detect index field type from the column type

Back to archive index

null+****@clear***** null+****@clear*****
2012年 7月 6日 (金) 18:46:36 JST


SHIMODA Hiroshi	2012-07-06 18:46:36 +0900 (Fri, 06 Jul 2012)

  New Revision: 1e189a2dbcae4c755957db64db7cfae27893c9ca
  https://github.com/groonga/gcs/commit/1e189a2dbcae4c755957db64db7cfae27893c9ca

  Log:
    Detect index field type from the column type

  Modified files:
    lib/api/2011-02-01/configuration.js

  Modified: lib/api/2011-02-01/configuration.js (+6 -1)
===================================================================
--- lib/api/2011-02-01/configuration.js    2012-07-06 18:42:51 +0900 (17d3e48)
+++ lib/api/2011-02-01/configuration.js    2012-07-06 18:46:36 +0900 (0eb9412)
@@ -271,13 +271,18 @@ handlers.DeleteIndexField = function(database, request, response) {
   var fieldName = request.query['IndexFieldName'] || '';
   var field = domain.getIndexField(fieldName);
 
+  var column = database.columnListSync(domain.tableName)
+                 .filter(function(column) {
+                   return column.name == field.columnName;
+                 })[0];
+
   try {
     database.commandSync('column_remove', {
       table: domain.tableName,
       name: field.columnName
     });
 
-    if (fieldType == 'uint') {
+    if (column.type == Translator.translateIndexFieldType('uint')) {
       var alterTableName = domain.getAlterTableName(field.columnName);
       database.commandSync('table_remove', {
         name: alterTableName
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
Download 



Groonga-commit メーリングリストの案内
Back to archive index