CREATE TABLE IF NOT EXISTS orders (
id TEXT PRIMARY KEY,
+ date BIGINT NOT NULL,
products JSON NOT NULL,
total INT NOT NULL,
discount VARCHAR(20) REFERENCES discounts UNIQUE,
die "Not enough of " .$prod->{title}."\n" if $prod->{quantity} > $stock;
$db{$$}->update(products => {stock => $stock - $prod->{quantity}}, {product => $prod->{product}});
}
- $db{$$}->insert(orders => {id => $id, %parms});
+ $db{$$}->insert(orders => {id => $id, date => time, %parms});
$db{$$}->commit;
sendmail (Email::Simple->create(
header => [