Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
hwbrzzl committed Nov 10, 2024
1 parent 2cf94e0 commit bd20132
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion database/schema/blueprint.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (r *Blueprint) DropIfExists() {
func (r *Blueprint) Foreign(column ...string) schema.ForeignKeyDefinition {
command := r.indexCommand(constants.CommandForeign, column)

return NewForeignKeyDefinition(command, r.prefix)
return NewForeignKeyDefinition(command)
}

func (r *Blueprint) GetAddedColumns() []schema.ColumnDefinition {
Expand Down
6 changes: 2 additions & 4 deletions database/schema/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ import (

type ForeignKeyDefinition struct {
command *schema.Command
prefix string
}

func NewForeignKeyDefinition(command *schema.Command, prefix string) schema.ForeignKeyDefinition {
func NewForeignKeyDefinition(command *schema.Command) schema.ForeignKeyDefinition {
return &ForeignKeyDefinition{
command: command,
prefix: prefix,
}
}

Expand All @@ -29,7 +27,7 @@ func (f *ForeignKeyDefinition) CascadeOnUpdate() schema.ForeignKeyDefinition {
}

func (f *ForeignKeyDefinition) On(table string) schema.ForeignKeyDefinition {
f.command.On = f.prefix + table
f.command.On = table

return f
}
Expand Down
2 changes: 1 addition & 1 deletion database/schema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func NewSchema(config config.Config, log log.Log, orm contractsorm.Orm, migratio
case contractsdatabase.DriverSqlserver:
// TODO Optimize here when implementing Sqlserver driver
case contractsdatabase.DriverSqlite:
sqliteGrammar := grammars.NewSqlite()
sqliteGrammar := grammars.NewSqlite(prefix)
driverSchema = NewSqliteSchema(sqliteGrammar, orm, prefix)
grammar = sqliteGrammar
default:
Expand Down
2 changes: 1 addition & 1 deletion support/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const (
TestModelNormal

// Switch this value to control the test model.
TestModel = TestModelNormal
TestModel = TestModelMinimum
)

type ContainerType string
Expand Down

0 comments on commit bd20132

Please sign in to comment.