mirror of
				https://github.com/knex/knex.git
				synced 2025-11-04 11:49:34 +00:00 
			
		
		
		
	Only use files with the correct extension for migrations
This commit is contained in:
		
							parent
							
								
									7e4913bd32
								
							
						
					
					
						commit
						f2dd5f8305
					
				@ -129,7 +129,10 @@ Migrate.prototype = {
 | 
			
		||||
        return Promise.promisify(fs.readdir, fs)(this.config.directory);
 | 
			
		||||
      })
 | 
			
		||||
      .then(function(migrations) {
 | 
			
		||||
        return migrations.sort();
 | 
			
		||||
        var ext = this.config.extension;
 | 
			
		||||
        return _.filter(migrations, function (value) {
 | 
			
		||||
          return value.indexOf(ext, value.length - ext.length) !== -1;
 | 
			
		||||
        }).sort();
 | 
			
		||||
      });
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										1
									
								
								test/integration/migrate/test/random_bad_file.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								test/integration/migrate/test/random_bad_file.txt
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1 @@
 | 
			
		||||
This is definitely not a migration.
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user