[Groonga-commit] groonga/gcs [master] Change index field type after old values are deleted

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Nov 15 19:22:52 JST 2012


YUKI Hiroshi	2012-11-15 19:22:52 +0900 (Thu, 15 Nov 2012)

  New Revision: 862ee9909cdb48ccbc6607438bce0885640d05b6
  https://github.com/groonga/gcs/commit/862ee9909cdb48ccbc6607438bce0885640d05b6

  Log:
    Change index field type after old values are deleted

  Modified files:
    lib/database/index-field.js

  Modified: lib/database/index-field.js (+7 -4)
===================================================================
--- lib/database/index-field.js    2012-11-15 19:13:30 +0900 (8f9b2b6)
+++ lib/database/index-field.js    2012-11-15 19:22:52 +0900 (7f5598d)
@@ -204,9 +204,11 @@ IndexField.prototype = {
   },
   set type(type) {
     assertValidFieldType(type);
-    this._type = type;
-    if (this.exists())
-      this.changeTypeSync();
+    if (this.exists()) {
+      this.changeTypeToSync(type);
+    } else {
+      this._type = type;
+    }
     return type;
   },
   setType: function(type) {
@@ -476,9 +478,10 @@ IndexField.prototype = {
     return this;
   },
 
-  changeTypeSync: function() {
+  changeTypeToSync: function(type) {
     var values = this.domain.dumpSync();
     this.deleteSync();
+    this._type = type;
     this.createSync(true);
     this.domain.loadSync(values);
     return this;
-------------- next part --------------
HTML����������������������������...
Télécharger 



More information about the Groonga-commit mailing list
Back to archive index