CartsTable.php
8 months ago
ContactListsTable.php
11 months ago
DatabaseInterface.php
8 months ago
DatabaseTable.php
11 months ago
FormsTable.php
8 months ago
CartsTable.php
28 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Hostinger\Reach\Admin\Database; |
| 4 | |
| 5 | if ( ! defined( 'ABSPATH' ) ) { |
| 6 | die; |
| 7 | } |
| 8 | |
| 9 | class CartsTable extends DatabaseTable { |
| 10 | protected string $table_name = 'carts'; |
| 11 | |
| 12 | public function schema(): array { |
| 13 | return array( |
| 14 | 'hash varchar(100)', |
| 15 | 'customer_id bigint(20) unsigned DEFAULT NULL', |
| 16 | 'customer_email varchar(100)', |
| 17 | 'items longtext NOT NULL', |
| 18 | 'totals text NOT NULL', |
| 19 | 'currency varchar(3) NOT NULL', |
| 20 | 'status varchar(100) NOT NULL', |
| 21 | 'updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP', |
| 22 | 'PRIMARY KEY (hash)', |
| 23 | 'UNIQUE KEY hash (hash)', |
| 24 | 'KEY customer_id (customer_id)', |
| 25 | ); |
| 26 | } |
| 27 | } |
| 28 |