File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -449,8 +449,21 @@ impl<'s> PostgresStructPropertyExt<'s> for StructProperty<'s> {
449449 quote:: quote!( my_postgres:: table_schema:: TableColumnType :: BigInt )
450450 }
451451 PropertyType :: String => {
452- self . must_not_have_sql_type_attr ( ) ?;
453- quote:: quote!( my_postgres:: table_schema:: TableColumnType :: Text )
452+ if let Some ( sql_type) = self . try_get_sql_type_attr_value ( & [ "json" , "jsonb" ] ) ? {
453+ match sql_type {
454+ "json" => {
455+ quote:: quote!( my_postgres:: table_schema:: TableColumnType :: Json )
456+ }
457+ "jsonb" => {
458+ quote:: quote!( my_postgres:: table_schema:: TableColumnType :: Jsonb )
459+ }
460+ _ => {
461+ panic ! ( "Unsupported sql_type: {}" , sql_type) ;
462+ }
463+ }
464+ } else {
465+ quote:: quote!( my_postgres:: table_schema:: TableColumnType :: Text )
466+ }
454467 }
455468 PropertyType :: Bool => {
456469 self . must_not_have_sql_type_attr ( ) ?;
You can’t perform that action at this time.
0 commit comments