diff options
author | Akshay <[email protected]> | 2020-12-24 05:21:40 +0000 |
---|---|---|
committer | Akshay <[email protected]> | 2020-12-24 05:21:40 +0000 |
commit | 9d2b6ee10ec5359cc91769d430485c8c869ba1a8 (patch) | |
tree | b2d541e575ab6e3f70cb709f156f06afca085881 /src/schema.rs | |
parent | 7c65421328552b08e64df25e224fe9d54d363e6e (diff) |
monorepo
Diffstat (limited to 'src/schema.rs')
-rw-r--r-- | src/schema.rs | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/src/schema.rs b/src/schema.rs deleted file mode 100644 index f08221a..0000000 --- a/src/schema.rs +++ /dev/null | |||
@@ -1,61 +0,0 @@ | |||
1 | table! { | ||
2 | cart_items (cart_id, product_id) { | ||
3 | cart_id -> Integer, | ||
4 | product_id -> Integer, | ||
5 | } | ||
6 | } | ||
7 | |||
8 | table! { | ||
9 | customer (id) { | ||
10 | id -> Integer, | ||
11 | username -> Varchar, | ||
12 | password -> Varchar, | ||
13 | phone_number -> Varchar, | ||
14 | email_id -> Varchar, | ||
15 | address -> Nullable<Text>, | ||
16 | } | ||
17 | } | ||
18 | |||
19 | table! { | ||
20 | product (id) { | ||
21 | id -> Integer, | ||
22 | name -> Varchar, | ||
23 | kind -> Nullable<Varchar>, | ||
24 | price -> Float, | ||
25 | description -> Nullable<Varchar>, | ||
26 | } | ||
27 | } | ||
28 | |||
29 | table! { | ||
30 | rating (id) { | ||
31 | id -> Integer, | ||
32 | comment_text -> Nullable<Text>, | ||
33 | comment_date -> Nullable<Date>, | ||
34 | product_id -> Nullable<Integer>, | ||
35 | customer_id -> Nullable<Integer>, | ||
36 | stars -> Nullable<Integer>, | ||
37 | } | ||
38 | } | ||
39 | |||
40 | table! { | ||
41 | transaction (id) { | ||
42 | id -> Integer, | ||
43 | payment_type -> Varchar, | ||
44 | amount -> Float, | ||
45 | customer_id -> Nullable<Integer>, | ||
46 | } | ||
47 | } | ||
48 | |||
49 | joinable!(cart_items -> customer (cart_id)); | ||
50 | joinable!(cart_items -> product (product_id)); | ||
51 | joinable!(rating -> customer (customer_id)); | ||
52 | joinable!(rating -> product (product_id)); | ||
53 | joinable!(transaction -> customer (customer_id)); | ||
54 | |||
55 | allow_tables_to_appear_in_same_query!( | ||
56 | cart_items, | ||
57 | customer, | ||
58 | product, | ||
59 | rating, | ||
60 | transaction, | ||
61 | ); | ||