This commit is contained in:
Joe
2026-01-16 15:49:34 +08:00
commit 550d3e1f42
380 changed files with 62024 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
package migrations
import (
"github.com/goravel/framework/contracts/database/schema"
"github.com/goravel/framework/facades"
)
type M<<.Timestamp>>Create<<.ModelName>>Table struct {
}
func (m *M<<.Timestamp>>Create<<.ModelName>>Table) Signature() string {
return "<<.Timestamp>>_create_<<.TableName>>_table"
}
func (m *M<<.Timestamp>>Create<<.ModelName>>Table) Up() error {
return facades.Schema().Create("<<.TableName>>", func(table schema.Blueprint) {
table.ID()
<<range .Fields>>
table.<<.MigrationMethod>>("<<.Name>>")<<if .Comment>>.Comment("<<.Comment>>")<<end>>
<<- end>>
table.Timestamps()
table.SoftDeletes()
})
}
func (m *M<<.Timestamp>>Create<<.ModelName>>Table) Down() error {
return facades.Schema().DropIfExists("<<.TableName>>")
}