16 lines
391 B
V
16 lines
391 B
V
module main
|
|
|
|
import time
|
|
|
|
@[table: 'flight']
|
|
pub struct Flight {
|
|
mut:
|
|
id int @[primary; sql: serial]
|
|
from string @[sql_type: 'TEXT']
|
|
to string @[sql_type: 'TEXT']
|
|
departure time.Time @[sql_type: 'DATETIME'] // Changed from string to time.Time
|
|
price int @[sql_type: 'INT']
|
|
bookings []Booking @[fkey: 'flight_id']
|
|
created_at time.Time
|
|
}
|