mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
examples/vweb_fullstack: fix wrong db ORM-fields (#17907)
This commit is contained in:
parent
48d42287a9
commit
756e5d931e
@ -1,6 +1,6 @@
|
|||||||
module main
|
module main
|
||||||
|
|
||||||
struct AuthRequestDto {
|
struct AuthRequestDto {
|
||||||
username string [required]
|
username string [nonull]
|
||||||
password string [required]
|
password string [nonull]
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,6 @@ module main
|
|||||||
struct Product {
|
struct Product {
|
||||||
id int [primary; sql: serial]
|
id int [primary; sql: serial]
|
||||||
user_id int
|
user_id int
|
||||||
name string [required; sql_type: 'TEXT']
|
name string [nonull; sql_type: 'TEXT']
|
||||||
created_at string [default: 'CURRENT_TIMESTAMP']
|
created_at string [default: 'CURRENT_TIMESTAMP']
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,8 @@ module main
|
|||||||
pub struct User {
|
pub struct User {
|
||||||
mut:
|
mut:
|
||||||
id int [primary; sql: serial]
|
id int [primary; sql: serial]
|
||||||
username string [required; sql_type: 'TEXT'; unique]
|
username string [nonull; sql_type: 'TEXT'; unique]
|
||||||
password string [required; sql_type: 'TEXT']
|
password string [nonull; sql_type: 'TEXT']
|
||||||
active bool
|
active bool
|
||||||
products []Product [fkey: 'user_id']
|
products []Product [fkey: 'user_id']
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user