1
0
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:
l-33ter 2023-04-08 16:18:48 +02:00 committed by GitHub
parent 48d42287a9
commit 756e5d931e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
module main
struct AuthRequestDto {
username string [required]
password string [required]
username string [nonull]
password string [nonull]
}

View File

@ -4,6 +4,6 @@ module main
struct Product {
id int [primary; sql: serial]
user_id int
name string [required; sql_type: 'TEXT']
name string [nonull; sql_type: 'TEXT']
created_at string [default: 'CURRENT_TIMESTAMP']
}

View File

@ -4,8 +4,8 @@ module main
pub struct User {
mut:
id int [primary; sql: serial]
username string [required; sql_type: 'TEXT'; unique]
password string [required; sql_type: 'TEXT']
username string [nonull; sql_type: 'TEXT'; unique]
password string [nonull; sql_type: 'TEXT']
active bool
products []Product [fkey: 'user_id']
}