mirror of
				https://github.com/strapi/strapi.git
				synced 2025-11-03 19:36:20 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			20 lines
		
	
	
		
			794 B
		
	
	
	
		
			Plaintext
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			794 B
		
	
	
	
		
			Plaintext
		
	
	
		
			Executable File
		
	
	
	
	
 | 
						|
/**
 | 
						|
 * Select the `<%= tableName %>` table.
 | 
						|
 */
 | 
						|
<% if (toDrop === true) { %>
 | 
						|
connection.schema.table('<%= tableName %>', function (table) {
 | 
						|
  <% if (!_.isEmpty(attributes)) { _.forEach(attributes, function(details, attribute) { %><%= models[tableName].attributes[attribute].delete.drop %>;
 | 
						|
  <% }); } %>
 | 
						|
}).catch(function (err) {
 | 
						|
  console.log('Impossible to select the `<%= tableName %>` table.');
 | 
						|
  console.log(err);
 | 
						|
}), <% } else { %>
 | 
						|
connection.schema.table('<%= tableName %>', function (table) {
 | 
						|
  <% if (!_.isEmpty(attributes)) { _.forEach(attributes, function(details, attribute) { %><%= models[tableName].attributes[attribute].delete.others %>;
 | 
						|
  <% }); } %>
 | 
						|
}).catch(function (err) {
 | 
						|
  console.log('Impossible to select the `<%= tableName %>` table.');
 | 
						|
  console.log(err);
 | 
						|
}),<% } %>
 |