Skip to content

Commit

Permalink
Integer to bigint. Small fix and feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
halybang committed Apr 23, 2019
1 parent caf0a09 commit 168f9ce
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions cmd/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,18 @@ This command also :
- creates or updates the main.go of the project.
This command must be rerun after each source code modification, including module import.`,
Run: func(cmd *cobra.Command, args []string) {
projectDir := "."
if len(args) > 0 {
projectDir = args[0]
}
runGenerate(projectDir)
/*
if len(args) == 0 {
fmt.Println("You must specify the project directory ")
os.Exit(1)
}
runGenerate(args[0])
*/
},
}

Expand Down
2 changes: 1 addition & 1 deletion src/models/db_postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var pgTypes = map[fieldtype.Type]string{
fieldtype.Text: "text",
fieldtype.Date: "date",
fieldtype.DateTime: "timestamp without time zone",
fieldtype.Integer: "integer",
fieldtype.Integer: "bigint",
fieldtype.Float: "numeric",
fieldtype.HTML: "text",
fieldtype.Binary: "bytea",
Expand Down
2 changes: 1 addition & 1 deletion src/models/t00_setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,6 @@ func tearDownTests() {
}
fmt.Printf("Tearing down database for models\n")
admDB := sqlx.MustConnect(dbArgs.Driver, fmt.Sprintf("dbname=postgres sslmode=disable user=%s password=%s", dbArgs.User, dbArgs.Password))
admDB.MustExec(fmt.Sprintf("DROP DATABASE %s", dbArgs.DB))
admDB.MustExec(fmt.Sprintf("DROP DATABASE IF EXISTS %s", dbArgs.DB))
admDB.Close()
}

0 comments on commit 168f9ce

Please sign in to comment.