Skip to content

Commit

Permalink
new
Browse files Browse the repository at this point in the history
  • Loading branch information
fizzday committed Mar 26, 2019
1 parent 6100392 commit c907c88
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 4 deletions.
23 changes: 23 additions & 0 deletions migration/artisan.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package main

import (
"fmt"
"github.com/gohouse/gorose"
)

// ./artisan make (create_users_table) 生成迁移:创建用户表
// ./artisan migrate 运行迁移
// ./artisan rollback 回滚迁移
// ./artisan reset 回滚所有的应用迁移
// ./artisan refresh 在单个命令中回滚 & 迁移
// ./artisan fresh 删除所有表 & 迁移

var conn *gorose.Connection
var err error

func init() {
}
func main() {
conn,err = gorose.Open("mysql", "gcore:gcore@tcp(192.168.200.248:3306)/test?charset=utf8")
fmt.Println(conn,err)
}
9 changes: 9 additions & 0 deletions migration/demo.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package main

func Up() {

}

func Down() {

}
8 changes: 4 additions & 4 deletions table2struct.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ var typeForMysqlToGo = map[string]string{
"tinyblob": "string",
"mediumblob": "string",
"longblob": "string",
"date": "string", // time.Time
"datetime": "string", // time.Time
"timestamp": "string", // time.Time
"time": "string", // time.Time
"date": "time.Time", // time.Time or string
"datetime": "time.Time", // time.Time or string
"timestamp": "time.Time", // time.Time or string
"time": "time.Time", // time.Time or string
"float": "float64",
"double": "float64",
"decimal": "float64",
Expand Down

0 comments on commit c907c88

Please sign in to comment.