mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
orm: add unique fields & add drop table stmt (#9684)
This commit is contained in:
@@ -4,7 +4,9 @@
|
||||
|
||||
### Fields
|
||||
|
||||
- `[primary]` set the field as the primary key
|
||||
- `[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`)
|
||||
@@ -26,6 +28,14 @@ sql db {
|
||||
}
|
||||
```
|
||||
|
||||
### Drop
|
||||
|
||||
```v ignore
|
||||
sql db {
|
||||
drop table Foo
|
||||
}
|
||||
```
|
||||
|
||||
### Insert
|
||||
|
||||
```v ignore
|
||||
|
||||
Reference in New Issue
Block a user