add seed
This commit is contained in:
		
							parent
							
								
									70c14e0263
								
							
						
					
					
						commit
						eaef191c1e
					
				
					 1 changed files with 20 additions and 0 deletions
				
			
		
							
								
								
									
										20
									
								
								seeds/initseed.ts
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								seeds/initseed.ts
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,20 @@
 | 
			
		|||
import Knex from "knex";
 | 
			
		||||
 | 
			
		||||
exports.seed = async function(knex:Knex) {
 | 
			
		||||
  // Deletes ALL existing entries
 | 
			
		||||
  await knex('contents').del();
 | 
			
		||||
  await knex('contents').insert({
 | 
			
		||||
    title:"aaa",
 | 
			
		||||
    basepath:"testdata",
 | 
			
		||||
    content_type:"manga",
 | 
			
		||||
    filename:"test_zip.zip",
 | 
			
		||||
    additional:JSON.stringify({comment:"comment"})
 | 
			
		||||
  });
 | 
			
		||||
  await knex('contents').insert({
 | 
			
		||||
    title:"aaa",
 | 
			
		||||
    basepath:"testdata",
 | 
			
		||||
    content_type:"video",
 | 
			
		||||
    filename:"video_test.mp4",
 | 
			
		||||
    additional:JSON.stringify({comment:"test comment"})
 | 
			
		||||
  });
 | 
			
		||||
};
 | 
			
		||||
		Loading…
	
	Add table
		
		Reference in a new issue