Skip to content

Instantly share code, notes, and snippets.

@WinPooh32
Created November 25, 2019 04:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WinPooh32/7fdb27ff5847c1d774d83fd3d151bf1e to your computer and use it in GitHub Desktop.
Save WinPooh32/7fdb27ff5847c1d774d83fd3d151bf1e to your computer and use it in GitHub Desktop.
Car:
+---------------+-----------+--------+----------+----------+---------+---------------+-----------+--------------------------------+------------+
| Field | Type | Unique | Optional | Nillable | Default | UpdateDefault | Immutable | StructTag | Validators |
+---------------+-----------+--------+----------+----------+---------+---------------+-----------+--------------------------------+------------+
| id | <nil> | false | false | false | false | false | false | json:"id,omitempty" | 0 |
| model | int8 | false | false | false | false | false | false | json:"model,omitempty" | 0 |
| registered_at | time.Time | false | false | false | false | false | false | json:"registered_at,omitempty" | 0 |
+---------------+-----------+--------+----------+----------+---------+---------------+-----------+--------------------------------+------------+
+-------+------+---------+---------+----------+--------+----------+
| Edge | Type | Inverse | BackRef | Relation | Unique | Optional |
+-------+------+---------+---------+----------+--------+----------+
| owner | User | true | cars | M2O | true | true |
+-------+------+---------+---------+----------+--------+----------+
Group:
+-------+-------+--------+----------+----------+---------+---------------+-----------+-----------------------+------------+
| Field | Type | Unique | Optional | Nillable | Default | UpdateDefault | Immutable | StructTag | Validators |
+-------+-------+--------+----------+----------+---------+---------------+-----------+-----------------------+------------+
| id | <nil> | false | false | false | false | false | false | json:"id,omitempty" | 0 |
| name | int8 | false | false | false | false | false | false | json:"name,omitempty" | 1 |
+-------+-------+--------+----------+----------+---------+---------------+-----------+-----------------------+------------+
+-------+------+---------+---------+----------+--------+----------+
| Edge | Type | Inverse | BackRef | Relation | Unique | Optional |
+-------+------+---------+---------+----------+--------+----------+
| users | User | false | | M2M | false | true |
+-------+------+---------+---------+----------+--------+----------+
User:
+-------+-------+--------+----------+----------+---------+---------------+-----------+-----------------------+------------+
| Field | Type | Unique | Optional | Nillable | Default | UpdateDefault | Immutable | StructTag | Validators |
+-------+-------+--------+----------+----------+---------+---------------+-----------+-----------------------+------------+
| id | <nil> | false | false | false | false | false | false | json:"id,omitempty" | 0 |
| age | int64 | false | false | false | false | false | false | json:"age,omitempty" | 1 |
| name | int8 | false | false | false | true | false | false | json:"name,omitempty" | 0 |
+-------+-------+--------+----------+----------+---------+---------------+-----------+-----------------------+------------+
+--------+-------+---------+---------+----------+--------+----------+
| Edge | Type | Inverse | BackRef | Relation | Unique | Optional |
+--------+-------+---------+---------+----------+--------+----------+
| cars | Car | false | | O2M | false | true |
| groups | Group | true | users | M2M | false | true |
+--------+-------+---------+---------+----------+--------+----------+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment