mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
examples: fullstack vweb example (#16761)
This commit is contained in:
11
examples/vweb_fullstack/src/user_entities.v
Normal file
11
examples/vweb_fullstack/src/user_entities.v
Normal file
@ -0,0 +1,11 @@
|
||||
module main
|
||||
|
||||
[table: 'users']
|
||||
pub struct User {
|
||||
mut:
|
||||
id int [primary; sql: serial]
|
||||
username string [required; sql_type: 'TEXT'; unique]
|
||||
password string [required; sql_type: 'TEXT']
|
||||
active bool
|
||||
products []Product [fkey: 'user_id']
|
||||
}
|
Reference in New Issue
Block a user