mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
orm: add support for custom table names & custom field names (#9697)
This commit is contained in:
@ -2,14 +2,18 @@
|
||||
|
||||
## Attributes
|
||||
|
||||
### Structs
|
||||
|
||||
- `[tablename: 'name']` sets a custom table name
|
||||
|
||||
### Fields
|
||||
|
||||
- `[primary]` sets the field as the primary key
|
||||
- `[unique]` sets the field as unique
|
||||
- `[unique: 'foo']` adds the field to a unique group
|
||||
- `[nonull]` field will be `NOT NULL` in table creation
|
||||
- `[skip]` field will be skipped
|
||||
- `[sql: type]` sets the type which is used in sql (special type `serial`)
|
||||
- `[sql: 'name']` sets a custom column name for the field
|
||||
|
||||
## Usage
|
||||
|
||||
|
Reference in New Issue
Block a user