lib/generators/templates/ts_schema.rb in ts_schema-0.1.13 vs lib/generators/templates/ts_schema.rb in ts_schema-0.1.14
- old
+ new
@@ -1,28 +1,7 @@
-# Default type mappings:
-#
-# string: string
-# text: string
-# integer: number
-# enum: number
-# bigint: number
-# float: number
-# decimal: number
-# json: Record<string, any>
-# jsonb: Record<string, any>
-# binary: string
-# boolean: boolean
-# date: string
-# datetime: string
-# timestamp: string
-# datetime_with_timezone: string
-# inet: string
-# cidr: string
-# macaddr: string
-
TsSchema.setup do |config|
- # Case options: camel|snake|pascal
+ # Case options for field names: camel|snake|pascal
#
# config.case = :camel
# Customize output path and file name
@@ -33,12 +12,32 @@
# Whether to generate the schema file after running migrations
#
# config.auto_generate = true
- # Add custom type mappings or overrides
+ # Add custom type mappings or overrides (as strings or symbols)
#
+ # Default type mappings:
+ # string: string
+ # text: string
+ # integer: number
+ # enum: number
+ # bigint: number
+ # float: number
+ # decimal: number
+ # json: Record<string, any>
+ # jsonb: Record<string, any>
+ # binary: string
+ # boolean: boolean
+ # date: string
+ # datetime: string
+ # timestamp: string
+ # datetime_with_timezone: string
+ # inet: string
+ # cidr: string
+ # macaddr: string
+ #
# config.custom_types = {
#
# }
@@ -68,12 +67,13 @@
# ]
# Ignore certain fields, omitting them from the generated schema: :optional|(string)|false
# Key is the name of the field to override options for.
+ #
# [:optional] will make this an optional field by adding '?' to the defintion (example: password?: string)
# [(string)] enter a field name override, for instance rename encrypted_password to password
- # In that scenario, also specifying passwoord as an optional field will append a ? in the output
+ # In that scenario, also specifying password as an optional field will append a ? to password
# [:omit] will omit the field from being output in the schema entirely
#
# config.field_overrides: {
# encrypted_password: :password,
# password: :optional,