013
This commit is contained in:
13
src/booking_entities.v
Normal file
13
src/booking_entities.v
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
module main
|
||||||
|
|
||||||
|
import time
|
||||||
|
|
||||||
|
@[table: 'booking']
|
||||||
|
pub struct Booking {
|
||||||
|
mut:
|
||||||
|
id int @[primary; sql: serial]
|
||||||
|
user_id int
|
||||||
|
flight_id int
|
||||||
|
status string @[sql_type: 'TEXT']
|
||||||
|
created_at time.Time
|
||||||
|
}
|
16
src/flight_entities.v
Normal file
16
src/flight_entities.v
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
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']
|
||||||
|
date string @[sql_type: 'TEXT']
|
||||||
|
price int @[sql_type: 'INT']
|
||||||
|
status string @[sql_type: 'TEXT']
|
||||||
|
bookings []Booking @[fkey: 'flight_id']
|
||||||
|
created_at time.Time
|
||||||
|
}
|
@@ -1,14 +0,0 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
@[table: 'planes']
|
|
||||||
pub struct Plane {
|
|
||||||
mut:
|
|
||||||
id int @[primary; sql: serial]
|
|
||||||
from string @[sql_type: 'TEXT']
|
|
||||||
to string @[sql_type: 'TEXT']
|
|
||||||
time string @[sql_type: 'TEXT']
|
|
||||||
date string @[sql_type: 'TEXT']
|
|
||||||
price int @[sql_type: 'INT']
|
|
||||||
status string @[sql_type: 'TEXT']
|
|
||||||
tickets []Ticket @[fkey: 'plane_id']
|
|
||||||
}
|
|
@@ -1,10 +0,0 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
@[table: 'tickets']
|
|
||||||
pub struct Ticket {
|
|
||||||
mut:
|
|
||||||
id int @[primary; sql: serial]
|
|
||||||
user_id int
|
|
||||||
plane_id int
|
|
||||||
status string @[sql_type: 'TEXT']
|
|
||||||
}
|
|
Reference in New Issue
Block a user