Skip to content

Commit

Permalink
fix: restore explicit column: name override (#984)
Browse files Browse the repository at this point in the history
Accidentally removed in commit 9052fc4.
  • Loading branch information
shiar authored Oct 26, 2024
1 parent a6f81ee commit 169f258
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 0 deletions.
11 changes: 11 additions & 0 deletions internal/dbtest/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1545,6 +1545,17 @@ func TestQuery(t *testing.T) {
return db.NewInsert().Model(new(Model))
},
},
{
id: 167,
query: func(db *bun.DB) schema.QueryAppender {
// specified option names
type Model struct {
bun.BaseModel `bun:"table:table"`
IsDefault bool `bun:"column:default"`
}
return db.NewInsert().Model(new(Model))
},
},
}

timeRE := regexp.MustCompile(`'2\d{3}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(\.\d+)?(\+\d{2}:\d{2})?'`)
Expand Down
1 change: 1 addition & 0 deletions internal/dbtest/testdata/snapshots/TestQuery-mariadb-167
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
INSERT INTO `table` (`default`) VALUES (FALSE)
1 change: 1 addition & 0 deletions internal/dbtest/testdata/snapshots/TestQuery-mssql2019-167
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
INSERT INTO "table" ("default") VALUES (0)
1 change: 1 addition & 0 deletions internal/dbtest/testdata/snapshots/TestQuery-mysql5-167
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
INSERT INTO `table` (`default`) VALUES (FALSE)
1 change: 1 addition & 0 deletions internal/dbtest/testdata/snapshots/TestQuery-mysql8-167
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
INSERT INTO `table` (`default`) VALUES (FALSE)
1 change: 1 addition & 0 deletions internal/dbtest/testdata/snapshots/TestQuery-pg-167
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
INSERT INTO "table" ("default") VALUES (FALSE)
1 change: 1 addition & 0 deletions internal/dbtest/testdata/snapshots/TestQuery-pgx-167
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
INSERT INTO "table" ("default") VALUES (FALSE)
1 change: 1 addition & 0 deletions internal/dbtest/testdata/snapshots/TestQuery-sqlite-167
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
INSERT INTO "table" ("default") VALUES (FALSE)

0 comments on commit 169f258

Please sign in to comment.