mirror of
				https://github.com/beego/bee.git
				synced 2025-11-04 09:23:24 +00:00 
			
		
		
		
	minor console message changes and migration file path changes
This commit is contained in:
		
							
								
								
									
										2
									
								
								g.go
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								g.go
									
									
									
									
									
								
							@@ -27,7 +27,7 @@ bee generate model [-tables=""] [-driver=mysql] [-conn=root:@tcp(127.0.0.1:3306)
 | 
				
			|||||||
    -conn:   the connection string used by the driver, the default is root:@tcp(127.0.0.1:3306)/test
 | 
					    -conn:   the connection string used by the driver, the default is root:@tcp(127.0.0.1:3306)/test
 | 
				
			||||||
    -level:  [1 | 2 | 3], 1 = model; 2 = models,controller; 3 = models,controllers,router
 | 
					    -level:  [1 | 2 | 3], 1 = model; 2 = models,controller; 3 = models,controllers,router
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bee generate migration [filename]
 | 
					bee generate migration [migrationfile]
 | 
				
			||||||
    generate migration file for making database schema update
 | 
					    generate migration file for making database schema update
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bee generate controller [controllerfile]
 | 
					bee generate controller [controllerfile]
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -32,7 +32,7 @@ const (
 | 
				
			|||||||
// The generated file template consists of an up() method for updating schema and
 | 
					// The generated file template consists of an up() method for updating schema and
 | 
				
			||||||
// a down() method for reverting the update.
 | 
					// a down() method for reverting the update.
 | 
				
			||||||
func generateMigration(mname string, curpath string) {
 | 
					func generateMigration(mname string, curpath string) {
 | 
				
			||||||
	migrationFilePath := path.Join(curpath, M_PATH)
 | 
						migrationFilePath := path.Join(curpath, "database", M_PATH)
 | 
				
			||||||
	if _, err := os.Stat(migrationFilePath); os.IsNotExist(err) {
 | 
						if _, err := os.Stat(migrationFilePath); os.IsNotExist(err) {
 | 
				
			||||||
		// create migrations directory
 | 
							// create migrations directory
 | 
				
			||||||
		if err := os.MkdirAll(migrationFilePath, 0777); err != nil {
 | 
							if err := os.MkdirAll(migrationFilePath, 0777); err != nil {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user