Skip to content

Commit

Permalink
feat: update docs site models and fix generate model schema data type…
Browse files Browse the repository at this point in the history
… error
  • Loading branch information
fan-tastic-z committed Feb 23, 2024
1 parent 7f7e8af commit 65ac4f9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
12 changes: 7 additions & 5 deletions docs-site/content/docs/the-app/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ These fields are ignored if you provide them in your migration command. In addit
For schema data types, you can use the following mapping to understand the schema:

```rust
("uuid", "uuid"),
("uuid", "uuid_null"),
("uuid!", "uuid"),
("uuid^", "uuid_uniq"),
("string", "string_null"),
("string!", "string"),
("string^", "string_uniq"),
Expand All @@ -109,8 +111,8 @@ For schema data types, you can use the following mapping to understand the schem
("decimal!", "decimal"),
("decimal_len", "decimal_len_null"),
("decimal_len!", "decimal_len"),
("bool", "bool_null"),
("bool!", "bool"),
("boolean", "boolean_null"),
("boolean!", "boolean"),
("tstz", "timestamptz_null"),
("tstz!", "timestamptz"),
("date", "date_null"),
Expand All @@ -119,8 +121,8 @@ For schema data types, you can use the following mapping to understand the schem
("ts!", "timestamp"),
("json", "json_null"),
("json!", "json"),
("jsonb", "jsonb_null"),
("jsonb!", "jsonb"),
("jsonb", "json_binary_null"),
("jsonb!", "json_binary"),
```


Expand Down
14 changes: 7 additions & 7 deletions src/gen/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ pub const IGNORE_FIELDS: &[&str] = &["created_at", "updated_at", "create_at", "u

lazy_static! {
static ref TYPEMAP: HashMap<&'static str, &'static str> = HashMap::from([
("uuid", "uuid"),
("uuid_col!", "uuid_col"),
("uuid_col", "uuid_col_null"),
("uuid", "uuid_null"),
("uuid!", "uuid"),
("uuid^", "uuid_uniq"),
("string", "string_null"),
("string!", "string"),
("string^", "string_uniq"),
Expand All @@ -48,8 +48,8 @@ lazy_static! {
("decimal!", "decimal"),
("decimal_len", "decimal_len_null"),
("decimal_len!", "decimal_len"),
("bool", "bool_null"),
("bool!", "bool"),
("boolean", "boolean_null"),
("boolean!", "boolean"),
("tstz", "timestamptz_null"),
("tstz!", "timestamptz"),
("date", "date_null"),
Expand All @@ -58,8 +58,8 @@ lazy_static! {
("ts!", "timestamp"),
("json", "json_null"),
("json!", "json"),
("jsonb", "jsonb_null"),
("jsonb!", "jsonb"),
("jsonb", "json_binary_null"),
("jsonb!", "json_binary"),
]);
}

Expand Down

0 comments on commit 65ac4f9

Please sign in to comment.