update sqlcgen with new enub type
This commit is contained in:
parent
6d80f5c5e8
commit
e4cdfcace2
@ -47,7 +47,7 @@ type Field struct {
|
||||
Accountid int32 `db:"accountid" json:"accountid"`
|
||||
Name string `db:"name" json:"name"`
|
||||
Entity interface{} `db:"entity" json:"entity"`
|
||||
Type string `db:"type" json:"type"`
|
||||
Type interface{} `db:"type" json:"type"`
|
||||
Deleted bool `db:"deleted" json:"deleted"`
|
||||
Createdat sql.NullTime `db:"createdat" json:"createdat"`
|
||||
}
|
||||
|
||||
@ -219,7 +219,7 @@ WITH user_data AS (
|
||||
COALESCE(field->>'Code', '')::varchar(255) AS code,
|
||||
COALESCE(field->>'Name', '')::varchar(50) AS name,
|
||||
CAST(field->>'Entity' AS entitytype) AS Entity,
|
||||
COALESCE(field->>'Type', '')::varchar(50) AS type,
|
||||
COALESCE(field->>'Type', '')::fieldtype AS type,
|
||||
CURRENT_TIMESTAMP AS createdAt
|
||||
FROM json_array_elements($2::json) AS field
|
||||
), inserted_fields AS(
|
||||
@ -257,7 +257,7 @@ type CheckFieldsRow struct {
|
||||
Code string `db:"code" json:"code"`
|
||||
Name string `db:"name" json:"name"`
|
||||
Entity interface{} `db:"entity" json:"entity"`
|
||||
Type string `db:"type" json:"type"`
|
||||
Type interface{} `db:"type" json:"type"`
|
||||
Createdat interface{} `db:"createdat" json:"createdat"`
|
||||
Amoid_2 int32 `db:"amoid_2" json:"amoid_2"`
|
||||
}
|
||||
@ -1475,7 +1475,7 @@ type GetFieldsWithPaginationRow struct {
|
||||
Accountid int32 `db:"accountid" json:"accountid"`
|
||||
Name string `db:"name" json:"name"`
|
||||
Entity interface{} `db:"entity" json:"entity"`
|
||||
Type string `db:"type" json:"type"`
|
||||
Type interface{} `db:"type" json:"type"`
|
||||
Deleted bool `db:"deleted" json:"deleted"`
|
||||
Createdat sql.NullTime `db:"createdat" json:"createdat"`
|
||||
TotalCount int64 `db:"total_count" json:"total_count"`
|
||||
@ -2945,7 +2945,7 @@ const updateFields = `-- name: UpdateFields :exec
|
||||
UPDATE fields AS f
|
||||
SET name = (update_data ->> 'Name')::varchar(50),
|
||||
code = (update_data ->> 'Code')::varchar(255),
|
||||
type = (update_data ->> 'Type')::varchar(50),
|
||||
type = (update_data ->> 'Type')::fieldtype,
|
||||
createdAt = CURRENT_TIMESTAMP
|
||||
FROM json_array_elements($1::json) AS update_data
|
||||
WHERE f.amoID = (update_data ->> 'AmoID')::INT
|
||||
|
||||
Loading…
Reference in New Issue
Block a user