Order data.
| Column | Type | Constraint | Description |
|---|---|---|---|
| shop | TEXT | PRIMARY KEY | Shop ID. (.username) |
| id | INTEGER | Identifier. | |
| account_id | INTEGER | NOT NULL | Account ID. (account.id) |
| total | INTEGER | NOT NULL | Total amout of products. Tax included. |
| shipping_cost | INTEGER | NOT NULL | Shipping cost. Tax included. |
| payment_fee | INTEGER | NOT NULL | Payment fee. Tax included. |
| payment_method | TEXT | NOT NULL | Payment method which is ID of payment module (payment_module.name). If empty, there are no payment. |
| payment_state | INTEGER | NOT NULL |
|
| delivered | INTEGER | NOT NULL |
|
| cancel_state | INTEGER | NOT NULL |
|
| state | INTEGER | NOT NULL | Order state.
|
| inquiry_code | TEXT | UNIQUE, NOT NULL | Inquiry code to see detail the order. |
| requested_date | TIMESTAMP | NOT NULL | Date of order requested. |
| delivery_date | DATE | Designated delivery date that the products will arrive. NULL value means, there are no assignment. | |
| delivery_time | TIME | Designated delivery time that the products will arrive. NULL value means, there are no assignment. | |
| remarks | TEXT |
CREATE TABLE "order"( shop TEXT, id INTEGER, account_id INTEGER NOT NULL, total INTEGER NOT NULL, shipping_cost INTEGER NOT NULL, payment_fee INTEGER NOT NULL, payment_state INTEGER NOT NULL, delivered INTEGER NOT NULL, cancel_state INTEGER NOT NULL, payment_method TEXT NOT NULL, state INTEGER NOT NULL, inquiry_code TEXT NOT NULL UNIQUE, requested_date TIMESTAMP NOT NULL, delivery_date DATE, delivery_time TIME, remarks TEXT, PRIMARY KEY(shop, id));