<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -2,6 +2,11 @@
 # within the database.
 class PluginMigrationGenerator &lt; Rails::Generator::Base
   
+  # 255 characters max for Windows NTFS (http://en.wikipedia.org/wiki/Filename)
+  # minus 14 for timestamp, minus some extra chars for dot, underscore, file 
+  # extension. So let's have 230.
+  MAX_FILENAME_LENGTH = 230
+    
   def initialize(runtime_args, runtime_options={})
     super
     @options = {:assigns =&gt; {}}
@@ -67,12 +72,27 @@ class PluginMigrationGenerator &lt; Rails::Generator::Base
       @options[:assigns][:current_versions] = @current_versions
     end
 
+    # Returns a migration name. If the descriptive migration name based on the 
+    # plugin names involved is shorter than 230 characters that one will be
+    # used. Otherwise a shorter name will be returned.
+    def build_migration_name
+      returning descriptive_migration_name do |name|        
+        name.replace short_migration_name if name.length &gt; MAX_FILENAME_LENGTH
+      end
+    end
+
     # Construct a unique migration name based on the plugins involved and the
     # versions they should reach after this migration is run. The name constructed
     # needs to be lowercase
-    def build_migration_name
+    def descriptive_migration_name
       @plugins_to_migrate.map do |plugin| 
         &quot;#{plugin.name}_to_version_#{@new_versions[plugin.name]}&quot; 
       end.join(&quot;_and_&quot;).downcase
-    end  
+    end
+
+    # Short migration name that will be used if the descriptive_migration_name
+    # exceeds 230 characters
+    def short_migration_name
+      'plugin_migrations'
+    end
 end
\ No newline at end of file</diff>
      <filename>generators/plugin_migration/plugin_migration_generator.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>c152ff169b941a233d69f0c5ef7625cc3cca20cd</id>
    </parent>
  </parents>
  <author>
    <name>James Adam</name>
    <email>james@lazyatom.com</email>
  </author>
  <url>http://github.com/lazyatom/engines/commit/3207d265d49144443cdff5cbe4113fe3287d2816</url>
  <id>3207d265d49144443cdff5cbe4113fe3287d2816</id>
  <committed-date>2008-11-11T14:32:26-08:00</committed-date>
  <authored-date>2008-11-11T14:32:26-08:00</authored-date>
  <message>Ensure that plugin migration names aren't too long for NTFS</message>
  <tree>c1b28e9585a1e1e84c2c951d78fdd4987b55240b</tree>
  <committer>
    <name>James Adam</name>
    <email>james@lazyatom.com</email>
  </committer>
</commit>
