Skip to content

Commit

Permalink
fix(sql): fix types.md to convert to string on sql dump (#520)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxdemaio authored Jan 11, 2024
1 parent 2114871 commit f018e00
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/dump/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func sqlInsertEtymologies(sqlDialect SqlDialect, etymologies []types.EtymologyRe
insertQuery := sq.
InsertInto(ety).
Columns(ety.ID, ety.DESCRIPTION, ety.ENTRY_ID).
Values(sq.Literal(sqlEtymologyId), sq.Literal(etymology.Description), sq.Literal(sqlEntryId))
Values(sq.Literal(sqlEtymologyId), sq.Literal(etymology.Description.String()), sq.Literal(sqlEntryId))

ety_query, _, err := sq.ToSQL(sqlDialect, insertQuery, nil)

Expand Down Expand Up @@ -249,8 +249,8 @@ func sqlInsertDefinitions(sqlDialect SqlDialect, definitions []types.DefinitionR

insertQuery := sq.
InsertInto(def).
Columns(def.ID, def.TEXT, def.SENSE_ID, def.GROUP_ID).
Values(sq.Literal(sqlDefinitionId), sq.Literal(definition.Value), sq.Literal(sqlSenseId), sq.Literal(sqlGroupId))
Columns(def.ID, def.VALUE, def.SENSE_ID, def.GROUP_ID).
Values(sq.Literal(sqlDefinitionId), sq.Literal(definition.Value.String()), sq.Literal(sqlSenseId), sq.Literal(sqlGroupId))

def_query, _, err := sq.ToSQL(sqlDialect, insertQuery, nil)

Expand Down
2 changes: 1 addition & 1 deletion lib/dump/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type GROUPS struct {
type DEFINITIONS struct {
sq.TableStruct
ID sq.NumberField `ddl:"type=BIGINT primarykey auto_increment autoincrement identity"`
TEXT sq.StringField `ddl:"notnull"`
VALUE sq.StringField `ddl:"notnull"`
SENSE_ID sq.NumberField `ddl:"type=BIGINT references=senses.id"`
GROUP_ID sq.NumberField `ddl:"type=BIGINT references=groups.id"`
}
Expand Down

0 comments on commit f018e00

Please sign in to comment.