installed plugin Easy Digital Downloads
version 3.1.0.3
This commit is contained in:
@ -0,0 +1,210 @@
|
||||
<?php
|
||||
/**
|
||||
* Adjustments Schema Class.
|
||||
*
|
||||
* @package EDD
|
||||
* @subpackage Database\Schemas
|
||||
* @copyright Copyright (c) 2018, Easy Digital Downloads, LLC
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
||||
* @since 3.0
|
||||
*/
|
||||
namespace EDD\Database\Schemas;
|
||||
|
||||
// Exit if accessed directly
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
use EDD\Database\Schema;
|
||||
|
||||
/**
|
||||
* Adjustments Schema Class.
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
final class Adjustments extends Schema {
|
||||
|
||||
/**
|
||||
* Array of database column objects.
|
||||
*
|
||||
* @since 3.0
|
||||
* @var array
|
||||
*/
|
||||
public $columns = array(
|
||||
|
||||
// id
|
||||
array(
|
||||
'name' => 'id',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'extra' => 'auto_increment',
|
||||
'primary' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// parent
|
||||
array(
|
||||
'name' => 'parent',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'default' => '0',
|
||||
'sortable' => true,
|
||||
'transition' => true
|
||||
),
|
||||
|
||||
// name
|
||||
array(
|
||||
'name' => 'name',
|
||||
'type' => 'varchar',
|
||||
'length' => '200',
|
||||
'searchable' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// code
|
||||
array(
|
||||
'name' => 'code',
|
||||
'type' => 'varchar',
|
||||
'length' => '50',
|
||||
'searchable' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// status
|
||||
array(
|
||||
'name' => 'status',
|
||||
'type' => 'varchar',
|
||||
'length' => '20',
|
||||
'default' => 'draft',
|
||||
'sortable' => true,
|
||||
'transition' => true
|
||||
),
|
||||
|
||||
// type
|
||||
array(
|
||||
'name' => 'type',
|
||||
'type' => 'varchar',
|
||||
'length' => '20',
|
||||
'default' => '',
|
||||
'sortable' => true,
|
||||
'transition' => true
|
||||
),
|
||||
|
||||
// scope
|
||||
array(
|
||||
'name' => 'scope',
|
||||
'type' => 'varchar',
|
||||
'length' => '20',
|
||||
'default' => '',
|
||||
'sortable' => true,
|
||||
'transition' => true
|
||||
),
|
||||
|
||||
// amount_type
|
||||
array(
|
||||
'name' => 'amount_type',
|
||||
'type' => 'varchar',
|
||||
'length' => '20',
|
||||
'default' => '',
|
||||
'sortable' => true,
|
||||
'transition' => true
|
||||
),
|
||||
|
||||
// amount
|
||||
array(
|
||||
'name' => 'amount',
|
||||
'type' => 'decimal',
|
||||
'length' => '18,9',
|
||||
'default' => '0',
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// description
|
||||
array(
|
||||
'name' => 'description',
|
||||
'type' => 'longtext',
|
||||
'default' => '',
|
||||
'searchable' => true
|
||||
),
|
||||
|
||||
// max_uses
|
||||
array(
|
||||
'name' => 'max_uses',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'default' => '0'
|
||||
),
|
||||
|
||||
// use_count
|
||||
array(
|
||||
'name' => 'use_count',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'default' => '0',
|
||||
'sortable' => true,
|
||||
),
|
||||
|
||||
// once_per_customer
|
||||
array(
|
||||
'name' => 'once_per_customer',
|
||||
'type' => 'int',
|
||||
'length' => '1',
|
||||
'default' => '0'
|
||||
),
|
||||
|
||||
// min_charge_amount
|
||||
array(
|
||||
'name' => 'min_charge_amount',
|
||||
'type' => 'decimal',
|
||||
'length' => '18,9',
|
||||
'default' => '0'
|
||||
),
|
||||
|
||||
// start_date
|
||||
array(
|
||||
'name' => 'start_date',
|
||||
'type' => 'datetime',
|
||||
'default' => null,
|
||||
'allow_null' => true,
|
||||
'date_query' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// end_date
|
||||
array(
|
||||
'name' => 'end_date',
|
||||
'type' => 'datetime',
|
||||
'default' => null,
|
||||
'allow_null' => true,
|
||||
'date_query' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// date_created
|
||||
array(
|
||||
'name' => 'date_created',
|
||||
'type' => 'datetime',
|
||||
'default' => '', // Defaults to current time in query class
|
||||
'created' => true,
|
||||
'date_query' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// date_modified
|
||||
array(
|
||||
'name' => 'date_modified',
|
||||
'type' => 'datetime',
|
||||
'default' => '', // Defaults to current time in query class
|
||||
'modified' => true,
|
||||
'date_query' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// uuid
|
||||
array(
|
||||
'uuid' => true,
|
||||
)
|
||||
);
|
||||
}
|
@ -0,0 +1,169 @@
|
||||
<?php
|
||||
/**
|
||||
* Customer Addresses Schema Class.
|
||||
*
|
||||
* @package EDD
|
||||
* @subpackage Database\Schemas
|
||||
* @copyright Copyright (c) 2018, Easy Digital Downloads, LLC
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
||||
* @since 3.0
|
||||
*/
|
||||
|
||||
namespace EDD\Database\Schemas;
|
||||
|
||||
// Exit if accessed directly
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
use EDD\Database\Schema;
|
||||
|
||||
/**
|
||||
* Customer Addresses Schema Class.
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
class Customer_Addresses extends Schema {
|
||||
|
||||
/**
|
||||
* Array of database column objects
|
||||
*
|
||||
* @since 3.0
|
||||
* @access public
|
||||
* @var array
|
||||
*/
|
||||
public $columns = array(
|
||||
|
||||
// id
|
||||
array(
|
||||
'name' => 'id',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'extra' => 'auto_increment',
|
||||
'primary' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// customer_id
|
||||
array(
|
||||
'name' => 'customer_id',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'default' => '0'
|
||||
),
|
||||
|
||||
// is_primary
|
||||
array(
|
||||
'name' => 'is_primary',
|
||||
'type' => 'tinyint',
|
||||
'length' => '1',
|
||||
'unsigned' => false,
|
||||
'default' => '0',
|
||||
'sortable' => true,
|
||||
'transition' => true,
|
||||
),
|
||||
|
||||
// type
|
||||
array(
|
||||
'name' => 'type',
|
||||
'type' => 'varchar',
|
||||
'length' => '20',
|
||||
'default' => 'billing',
|
||||
'sortable' => true,
|
||||
'transition' => true
|
||||
),
|
||||
|
||||
// status
|
||||
array(
|
||||
'name' => 'status',
|
||||
'type' => 'varchar',
|
||||
'length' => '20',
|
||||
'default' => 'active',
|
||||
'sortable' => true,
|
||||
'transition' => true
|
||||
),
|
||||
|
||||
// name
|
||||
array(
|
||||
'name' => 'name',
|
||||
'type' => 'mediumtext',
|
||||
'searchable' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// address
|
||||
array(
|
||||
'name' => 'address',
|
||||
'type' => 'mediumtext',
|
||||
'searchable' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// address2
|
||||
array(
|
||||
'name' => 'address2',
|
||||
'type' => 'mediumtext',
|
||||
'searchable' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// city
|
||||
array(
|
||||
'name' => 'city',
|
||||
'type' => 'mediumtext',
|
||||
'searchable' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// region
|
||||
array(
|
||||
'name' => 'region',
|
||||
'type' => 'mediumtext',
|
||||
'searchable' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// postal_code
|
||||
array(
|
||||
'name' => 'postal_code',
|
||||
'type' => 'varchar',
|
||||
'length' => '32',
|
||||
'default' => '',
|
||||
'searchable' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// country
|
||||
array(
|
||||
'name' => 'country',
|
||||
'type' => 'mediumtext',
|
||||
'searchable' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// date_created
|
||||
array(
|
||||
'name' => 'date_created',
|
||||
'type' => 'datetime',
|
||||
'default' => '', // Defaults to current time in query class
|
||||
'created' => true,
|
||||
'date_query' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// date_modified
|
||||
array(
|
||||
'name' => 'date_modified',
|
||||
'type' => 'datetime',
|
||||
'default' => '', // Defaults to current time in query class
|
||||
'modified' => true,
|
||||
'date_query' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// uuid
|
||||
array(
|
||||
'uuid' => true,
|
||||
)
|
||||
);
|
||||
}
|
@ -0,0 +1,112 @@
|
||||
<?php
|
||||
/**
|
||||
* Customer Email Addresses Schema Class.
|
||||
*
|
||||
* @package EDD
|
||||
* @subpackage Database\Schemas
|
||||
* @copyright Copyright (c) 2018, Easy Digital Downloads, LLC
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
||||
* @since 3.0
|
||||
*/
|
||||
|
||||
namespace EDD\Database\Schemas;
|
||||
|
||||
// Exit if accessed directly
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
use EDD\Database\Schema;
|
||||
|
||||
/**
|
||||
* Customer Email Addresses Schema Class.
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
class Customer_Email_Addresses extends Schema {
|
||||
|
||||
/**
|
||||
* Array of database column objects
|
||||
*
|
||||
* @since 3.0
|
||||
* @access public
|
||||
* @var array
|
||||
*/
|
||||
public $columns = array(
|
||||
|
||||
// id
|
||||
array(
|
||||
'name' => 'id',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'extra' => 'auto_increment',
|
||||
'primary' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// customer_id
|
||||
array(
|
||||
'name' => 'customer_id',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'default' => '0',
|
||||
'cache_key' => true
|
||||
),
|
||||
|
||||
// type
|
||||
array(
|
||||
'name' => 'type',
|
||||
'type' => 'varchar',
|
||||
'length' => '20',
|
||||
'default' => 'secondary',
|
||||
'sortable' => true,
|
||||
'transition' => true
|
||||
),
|
||||
|
||||
// status
|
||||
array(
|
||||
'name' => 'status',
|
||||
'type' => 'varchar',
|
||||
'length' => '20',
|
||||
'default' => 'active',
|
||||
'sortable' => true,
|
||||
'transition' => true
|
||||
),
|
||||
|
||||
// email
|
||||
array(
|
||||
'name' => 'email',
|
||||
'type' => 'varchar',
|
||||
'length' => '100',
|
||||
'default' => '',
|
||||
'cache_key' => true,
|
||||
'searchable' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// date_created
|
||||
array(
|
||||
'name' => 'date_created',
|
||||
'type' => 'datetime',
|
||||
'default' => '', // Defaults to current time in query class
|
||||
'created' => true,
|
||||
'date_query' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// date_modified
|
||||
array(
|
||||
'name' => 'date_modified',
|
||||
'type' => 'datetime',
|
||||
'default' => '', // Defaults to current time in query class
|
||||
'modified' => true,
|
||||
'date_query' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// uuid
|
||||
array(
|
||||
'uuid' => true,
|
||||
)
|
||||
);
|
||||
}
|
@ -0,0 +1,128 @@
|
||||
<?php
|
||||
/**
|
||||
* Customer Schema Class.
|
||||
*
|
||||
* @package EDD
|
||||
* @subpackage Database\Schemas
|
||||
* @copyright Copyright (c) 2018, Easy Digital Downloads, LLC
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
||||
* @since 3.0
|
||||
*/
|
||||
namespace EDD\Database\Schemas;
|
||||
|
||||
// Exit if accessed directly
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
use EDD\Database\Schema;
|
||||
|
||||
/**
|
||||
* Discounts Schema Class.
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
class Customers extends Schema {
|
||||
|
||||
/**
|
||||
* Array of database column objects
|
||||
*
|
||||
* @since 3.0
|
||||
* @access public
|
||||
* @var array
|
||||
*/
|
||||
public $columns = array(
|
||||
|
||||
// id
|
||||
array(
|
||||
'name' => 'id',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'extra' => 'auto_increment',
|
||||
'primary' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// user_id
|
||||
array(
|
||||
'name' => 'user_id',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'default' => '0',
|
||||
'cache_key' => true
|
||||
),
|
||||
|
||||
// email
|
||||
array(
|
||||
'name' => 'email',
|
||||
'type' => 'varchar',
|
||||
'length' => '100',
|
||||
'cache_key' => true,
|
||||
'searchable' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// name
|
||||
array(
|
||||
'name' => 'name',
|
||||
'type' => 'varchar',
|
||||
'length' => '255',
|
||||
'searchable' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// status
|
||||
array(
|
||||
'name' => 'status',
|
||||
'type' => 'varchar',
|
||||
'length' => '20',
|
||||
'default' => 'active',
|
||||
'sortable' => true,
|
||||
'transition' => true
|
||||
),
|
||||
|
||||
// purchase_value
|
||||
array(
|
||||
'name' => 'purchase_value',
|
||||
'type' => 'decimal',
|
||||
'length' => '18,9',
|
||||
'default' => '0',
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// purchase_count
|
||||
array(
|
||||
'name' => 'purchase_count',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'default' => '0',
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// date_created
|
||||
array(
|
||||
'name' => 'date_created',
|
||||
'type' => 'datetime',
|
||||
'default' => '', // Defaults to current time in query class
|
||||
'created' => true,
|
||||
'date_query' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// date_modified
|
||||
array(
|
||||
'name' => 'date_modified',
|
||||
'type' => 'datetime',
|
||||
'default' => '', // Defaults to current time in query class
|
||||
'modified' => true,
|
||||
'date_query' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// uuid
|
||||
array(
|
||||
'uuid' => true,
|
||||
)
|
||||
);
|
||||
}
|
@ -0,0 +1,148 @@
|
||||
<?php
|
||||
/**
|
||||
* API Request Logs Schema Class.
|
||||
*
|
||||
* @package EDD
|
||||
* @subpackage Database\Schemas
|
||||
* @copyright Copyright (c) 2018, Easy Digital Downloads, LLC
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
||||
* @since 3.0
|
||||
*/
|
||||
namespace EDD\Database\Schemas;
|
||||
|
||||
// Exit if accessed directly
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
use EDD\Database\Schema;
|
||||
|
||||
/**
|
||||
* API Request Logs Schema Class.
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
class Logs_Api_Requests extends Schema {
|
||||
|
||||
/**
|
||||
* Array of database column objects
|
||||
*
|
||||
* @since 3.0
|
||||
* @access public
|
||||
* @var array
|
||||
*/
|
||||
public $columns = array(
|
||||
|
||||
// id
|
||||
array(
|
||||
'name' => 'id',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'extra' => 'auto_increment',
|
||||
'primary' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// user_id
|
||||
array(
|
||||
'name' => 'user_id',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'default' => '0',
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// api_key
|
||||
array(
|
||||
'name' => 'api_key',
|
||||
'type' => 'varchar',
|
||||
'length' => '32',
|
||||
'default' => 'public',
|
||||
'searchable' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// token
|
||||
array(
|
||||
'name' => 'token',
|
||||
'type' => 'varchar',
|
||||
'length' => '32',
|
||||
'default' => '',
|
||||
'searchable' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// version
|
||||
array(
|
||||
'name' => 'version',
|
||||
'type' => 'varchar',
|
||||
'length' => '32',
|
||||
'default' => '',
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// request
|
||||
array(
|
||||
'name' => 'request',
|
||||
'type' => 'longtext',
|
||||
'default' => '',
|
||||
'searchable' => true,
|
||||
'in' => false,
|
||||
'not_in' => false
|
||||
),
|
||||
|
||||
// error
|
||||
array(
|
||||
'name' => 'error',
|
||||
'type' => 'longtext',
|
||||
'default' => '',
|
||||
'searchable' => true,
|
||||
'in' => false,
|
||||
'not_in' => false
|
||||
),
|
||||
|
||||
// ip
|
||||
array(
|
||||
'name' => 'ip',
|
||||
'type' => 'varchar',
|
||||
'length' => '60',
|
||||
'default' => '',
|
||||
'searchable' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// time
|
||||
array(
|
||||
'name' => 'time',
|
||||
'type' => 'varchar',
|
||||
'length' => '60',
|
||||
'default' => '',
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// date_created
|
||||
array(
|
||||
'name' => 'date_created',
|
||||
'type' => 'datetime',
|
||||
'default' => '', // Defaults to current time in query class
|
||||
'created' => true,
|
||||
'date_query' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// date_modified
|
||||
array(
|
||||
'name' => 'date_modified',
|
||||
'type' => 'datetime',
|
||||
'default' => '', // Defaults to current time in query class
|
||||
'modified' => true,
|
||||
'date_query' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// uuid
|
||||
array(
|
||||
'uuid' => true,
|
||||
)
|
||||
);
|
||||
}
|
@ -0,0 +1,139 @@
|
||||
<?php
|
||||
/**
|
||||
* File Download Logs Schema Class.
|
||||
*
|
||||
* @package EDD
|
||||
* @subpackage Database\Schemas
|
||||
* @copyright Copyright (c) 2018, Easy Digital Downloads, LLC
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
||||
* @since 3.0
|
||||
*/
|
||||
namespace EDD\Database\Schemas;
|
||||
|
||||
// Exit if accessed directly
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
use EDD\Database\Schema;
|
||||
|
||||
/**
|
||||
* File Download Logs Schema Class.
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
class Logs_File_Downloads extends Schema {
|
||||
|
||||
/**
|
||||
* Array of database column objects
|
||||
*
|
||||
* @since 3.0
|
||||
* @access public
|
||||
* @var array
|
||||
*/
|
||||
public $columns = array(
|
||||
|
||||
// id
|
||||
array(
|
||||
'name' => 'id',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'extra' => 'auto_increment',
|
||||
'primary' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// product_id
|
||||
array(
|
||||
'name' => 'product_id',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'default' => '0',
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// file_id
|
||||
array(
|
||||
'name' => 'file_id',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'default' => '0',
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// order_id
|
||||
array(
|
||||
'name' => 'order_id',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'default' => '0',
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// price_id
|
||||
array(
|
||||
'name' => 'price_id',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'default' => '0'
|
||||
),
|
||||
|
||||
// customer_id
|
||||
array(
|
||||
'name' => 'customer_id',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'default' => '0',
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// ip
|
||||
array(
|
||||
'name' => 'ip',
|
||||
'type' => 'varchar',
|
||||
'length' => '60',
|
||||
'default' => '',
|
||||
'sortable' => true,
|
||||
'searchable' => true
|
||||
),
|
||||
|
||||
// user_agent
|
||||
array(
|
||||
'name' => 'user_agent',
|
||||
'type' => 'varchar',
|
||||
'length' => '200',
|
||||
'default' => '',
|
||||
'sortable' => true,
|
||||
'searchable' => true,
|
||||
),
|
||||
|
||||
// date_created
|
||||
array(
|
||||
'name' => 'date_created',
|
||||
'type' => 'datetime',
|
||||
'default' => '', // Defaults to current time in query class
|
||||
'created' => true,
|
||||
'date_query' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// date_modified
|
||||
array(
|
||||
'name' => 'date_modified',
|
||||
'type' => 'datetime',
|
||||
'default' => '', // Defaults to current time in query class
|
||||
'modified' => true,
|
||||
'date_query' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// uuid
|
||||
array(
|
||||
'uuid' => true,
|
||||
)
|
||||
);
|
||||
}
|
@ -0,0 +1,134 @@
|
||||
<?php
|
||||
/**
|
||||
* Logs Schema Class.
|
||||
*
|
||||
* @package EDD
|
||||
* @subpackage Database\Schemas
|
||||
* @copyright Copyright (c) 2018, Easy Digital Downloads, LLC
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
||||
* @since 3.0
|
||||
*/
|
||||
namespace EDD\Database\Schemas;
|
||||
|
||||
// Exit if accessed directly
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
use EDD\Database\Schema;
|
||||
|
||||
/**
|
||||
* Logs Schema Class.
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
class Logs extends Schema {
|
||||
|
||||
/**
|
||||
* Array of database column objects
|
||||
*
|
||||
* @since 3.0
|
||||
* @access public
|
||||
* @var array
|
||||
*/
|
||||
public $columns = array(
|
||||
|
||||
// id
|
||||
array(
|
||||
'name' => 'id',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'extra' => 'auto_increment',
|
||||
'primary' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// object_id
|
||||
array(
|
||||
'name' => 'object_id',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'default' => '0',
|
||||
'sortable' => true,
|
||||
'cache_key' => true,
|
||||
),
|
||||
|
||||
// object_type
|
||||
array(
|
||||
'name' => 'object_type',
|
||||
'type' => 'varchar',
|
||||
'length' => '20',
|
||||
'default' => '',
|
||||
'sortable' => true,
|
||||
'cache_key' => true,
|
||||
'allow_null' => true
|
||||
),
|
||||
|
||||
// user_id
|
||||
array(
|
||||
'name' => 'user_id',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'default' => '0',
|
||||
'sortable' => true,
|
||||
'cache_key' => true,
|
||||
),
|
||||
|
||||
// type
|
||||
array(
|
||||
'name' => 'type',
|
||||
'type' => 'varchar',
|
||||
'length' => '20',
|
||||
'default' => '',
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// title
|
||||
array(
|
||||
'name' => 'title',
|
||||
'type' => 'varchar',
|
||||
'length' => '200',
|
||||
'default' => '',
|
||||
'searchable' => true,
|
||||
'sortable' => true,
|
||||
'in' => false,
|
||||
'not_in' => false
|
||||
),
|
||||
|
||||
// content
|
||||
array(
|
||||
'name' => 'content',
|
||||
'type' => 'longtext',
|
||||
'default' => '',
|
||||
'searchable' => true,
|
||||
'in' => false,
|
||||
'not_in' => false
|
||||
),
|
||||
|
||||
// date_created
|
||||
array(
|
||||
'name' => 'date_created',
|
||||
'type' => 'datetime',
|
||||
'default' => '', // Defaults to current time in query class
|
||||
'created' => true,
|
||||
'date_query' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// date_modified
|
||||
array(
|
||||
'name' => 'date_modified',
|
||||
'type' => 'datetime',
|
||||
'default' => '', // Defaults to current time in query class
|
||||
'modified' => true,
|
||||
'date_query' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// uuid
|
||||
array(
|
||||
'uuid' => true,
|
||||
)
|
||||
);
|
||||
}
|
@ -0,0 +1,109 @@
|
||||
<?php
|
||||
/**
|
||||
* Notes Schema Class.
|
||||
*
|
||||
* @package EDD
|
||||
* @subpackage Database\Schemas
|
||||
* @copyright Copyright (c) 2018, Easy Digital Downloads, LLC
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
||||
* @since 3.0
|
||||
*/
|
||||
namespace EDD\Database\Schemas;
|
||||
|
||||
// Exit if accessed directly
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
use EDD\Database\Schema;
|
||||
|
||||
/**
|
||||
* Notes Schema Class.
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
class Notes extends Schema {
|
||||
|
||||
/**
|
||||
* Array of database column objects
|
||||
*
|
||||
* @since 3.0
|
||||
* @access public
|
||||
* @var array
|
||||
*/
|
||||
public $columns = array(
|
||||
|
||||
// id
|
||||
array(
|
||||
'name' => 'id',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'extra' => 'auto_increment',
|
||||
'primary' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// object_id
|
||||
array(
|
||||
'name' => 'object_id',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'default' => '0',
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// object_type
|
||||
array(
|
||||
'name' => 'object_type',
|
||||
'type' => 'varchar',
|
||||
'length' => '20',
|
||||
'default' => '',
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// user_id
|
||||
array(
|
||||
'name' => 'user_id',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'default' => '0',
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// content
|
||||
array(
|
||||
'name' => 'content',
|
||||
'type' => 'longtext',
|
||||
'default' => '',
|
||||
'searchable' => true,
|
||||
'in' => false,
|
||||
'not_in' => false
|
||||
),
|
||||
|
||||
// date_created
|
||||
array(
|
||||
'name' => 'date_created',
|
||||
'type' => 'datetime',
|
||||
'default' => '', // Defaults to current time in query class
|
||||
'created' => true,
|
||||
'date_query' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// date_modified
|
||||
array(
|
||||
'name' => 'date_modified',
|
||||
'type' => 'datetime',
|
||||
'default' => '', // Defaults to current time in query class
|
||||
'modified' => true,
|
||||
'date_query' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// uuid
|
||||
array(
|
||||
'uuid' => true,
|
||||
)
|
||||
);
|
||||
}
|
@ -0,0 +1,148 @@
|
||||
<?php
|
||||
/**
|
||||
* Order Addresses Schema Class.
|
||||
*
|
||||
* @package EDD
|
||||
* @subpackage Database\Schemas
|
||||
* @copyright Copyright (c) 2018, Easy Digital Downloads, LLC
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
||||
* @since 3.0
|
||||
*/
|
||||
|
||||
namespace EDD\Database\Schemas;
|
||||
|
||||
// Exit if accessed directly
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
use EDD\Database\Schema;
|
||||
|
||||
/**
|
||||
* Order Addresses Schema Class.
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
class Order_Addresses extends Schema {
|
||||
|
||||
/**
|
||||
* Array of database column objects
|
||||
*
|
||||
* @since 3.0
|
||||
* @access public
|
||||
* @var array
|
||||
*/
|
||||
public $columns = array(
|
||||
|
||||
// id
|
||||
array(
|
||||
'name' => 'id',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'extra' => 'auto_increment',
|
||||
'primary' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// order_id
|
||||
array(
|
||||
'name' => 'order_id',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'default' => '0'
|
||||
),
|
||||
|
||||
// type.
|
||||
array(
|
||||
'name' => 'type',
|
||||
'type' => 'varchar',
|
||||
'length' => '20',
|
||||
'default' => 'billing',
|
||||
'sortable' => true,
|
||||
'transition' => true,
|
||||
),
|
||||
|
||||
// name
|
||||
array(
|
||||
'name' => 'name',
|
||||
'type' => 'mediumtext',
|
||||
'searchable' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// address
|
||||
array(
|
||||
'name' => 'address',
|
||||
'type' => 'mediumtext',
|
||||
'searchable' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// address2
|
||||
array(
|
||||
'name' => 'address2',
|
||||
'type' => 'mediumtext',
|
||||
'searchable' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// city
|
||||
array(
|
||||
'name' => 'city',
|
||||
'type' => 'mediumtext',
|
||||
'searchable' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// region
|
||||
array(
|
||||
'name' => 'region',
|
||||
'type' => 'mediumtext',
|
||||
'searchable' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// postal_code
|
||||
array(
|
||||
'name' => 'postal_code',
|
||||
'type' => 'varchar',
|
||||
'length' => '32',
|
||||
'default' => '',
|
||||
'searchable' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// country
|
||||
array(
|
||||
'name' => 'country',
|
||||
'type' => 'mediumtext',
|
||||
'searchable' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// date_created
|
||||
array(
|
||||
'name' => 'date_created',
|
||||
'type' => 'datetime',
|
||||
'default' => '', // Defaults to current time in query class
|
||||
'created' => true,
|
||||
'date_query' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// date_modified
|
||||
array(
|
||||
'name' => 'date_modified',
|
||||
'type' => 'datetime',
|
||||
'default' => '', // Defaults to current time in query class
|
||||
'modified' => true,
|
||||
'date_query' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// uuid
|
||||
array(
|
||||
'uuid' => true,
|
||||
)
|
||||
);
|
||||
}
|
@ -0,0 +1,178 @@
|
||||
<?php
|
||||
/**
|
||||
* Order Adjustments Schema Class.
|
||||
*
|
||||
* @package EDD
|
||||
* @subpackage Database\Schemas
|
||||
* @copyright Copyright (c) 2018, Easy Digital Downloads, LLC
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
||||
* @since 3.0
|
||||
*/
|
||||
namespace EDD\Database\Schemas;
|
||||
|
||||
// Exit if accessed directly
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
use EDD\Database\Schema;
|
||||
|
||||
/**
|
||||
* Order Adjustments Schema Class.
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
class Order_Adjustments extends Schema {
|
||||
|
||||
/**
|
||||
* Array of database column objects
|
||||
*
|
||||
* @since 3.0
|
||||
* @access public
|
||||
* @var array
|
||||
*/
|
||||
public $columns = array(
|
||||
|
||||
// id
|
||||
array(
|
||||
'name' => 'id',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'extra' => 'auto_increment',
|
||||
'primary' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// parent
|
||||
array(
|
||||
'name' => 'parent',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'default' => '0',
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// object_id
|
||||
array(
|
||||
'name' => 'object_id',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'default' => '0',
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// object_type
|
||||
array(
|
||||
'name' => 'object_type',
|
||||
'type' => 'varchar',
|
||||
'length' => '20',
|
||||
'default' => '',
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// type_id
|
||||
array(
|
||||
'name' => 'type_id',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'default' => null,
|
||||
'sortable' => true,
|
||||
'allow_null' => true,
|
||||
),
|
||||
|
||||
// type
|
||||
array(
|
||||
'name' => 'type',
|
||||
'type' => 'varchar',
|
||||
'length' => '20',
|
||||
'default' => '',
|
||||
'sortable' => true,
|
||||
'transition' => true
|
||||
),
|
||||
|
||||
// type key
|
||||
array(
|
||||
'name' => 'type_key',
|
||||
'type' => 'varchar',
|
||||
'length' => '255',
|
||||
'default' => null,
|
||||
'allow_null' => true,
|
||||
'sortable' => true,
|
||||
),
|
||||
|
||||
// description
|
||||
array(
|
||||
'name' => 'description',
|
||||
'type' => 'varchar',
|
||||
'length' => '100',
|
||||
'default' => '',
|
||||
'searchable' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// subtotal
|
||||
array(
|
||||
'name' => 'subtotal',
|
||||
'type' => 'decimal',
|
||||
'length' => '18,9',
|
||||
'default' => '0',
|
||||
'sortable' => true,
|
||||
'validate' => 'edd_sanitize_amount'
|
||||
),
|
||||
|
||||
// tax
|
||||
array(
|
||||
'name' => 'tax',
|
||||
'type' => 'decimal',
|
||||
'length' => '18,9',
|
||||
'default' => '0',
|
||||
'sortable' => true,
|
||||
'validate' => 'edd_sanitize_amount'
|
||||
),
|
||||
|
||||
// total
|
||||
array(
|
||||
'name' => 'total',
|
||||
'type' => 'decimal',
|
||||
'length' => '18,9',
|
||||
'default' => '0',
|
||||
'sortable' => true,
|
||||
'validate' => 'edd_sanitize_amount'
|
||||
),
|
||||
|
||||
// rate
|
||||
array(
|
||||
'name' => 'rate',
|
||||
'type' => 'decimal',
|
||||
'length' => '10,5',
|
||||
'default' => '1.00000',
|
||||
),
|
||||
|
||||
// date_created
|
||||
array(
|
||||
'name' => 'date_created',
|
||||
'type' => 'datetime',
|
||||
'default' => '', // Defaults to current time in query class
|
||||
'created' => true,
|
||||
'date_query' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// date_modified
|
||||
array(
|
||||
'name' => 'date_modified',
|
||||
'type' => 'datetime',
|
||||
'default' => '', // Defaults to current time in query class
|
||||
'modified' => true,
|
||||
'date_query' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// uuid
|
||||
array(
|
||||
'uuid' => true,
|
||||
)
|
||||
);
|
||||
}
|
@ -0,0 +1,219 @@
|
||||
<?php
|
||||
/**
|
||||
* Order Items Schema Class.
|
||||
*
|
||||
* @package EDD
|
||||
* @subpackage Database\Schemas
|
||||
* @copyright Copyright (c) 2018, Easy Digital Downloads, LLC
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
||||
* @since 3.0
|
||||
*/
|
||||
namespace EDD\Database\Schemas;
|
||||
|
||||
// Exit if accessed directly
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
use EDD\Database\Schema;
|
||||
|
||||
/**
|
||||
* Order Items Schema Class.
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
class Order_Items extends Schema {
|
||||
|
||||
/**
|
||||
* Array of database column objects
|
||||
*
|
||||
* @since 3.0
|
||||
* @access public
|
||||
* @var array
|
||||
*/
|
||||
public $columns = array(
|
||||
|
||||
// id
|
||||
array(
|
||||
'name' => 'id',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'extra' => 'auto_increment',
|
||||
'primary' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// parent
|
||||
array(
|
||||
'name' => 'parent',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'default' => '0',
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// order_id
|
||||
array(
|
||||
'name' => 'order_id',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'default' => '0',
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// product_id
|
||||
array(
|
||||
'name' => 'product_id',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'default' => '0',
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// product_name
|
||||
array(
|
||||
'name' => 'product_name',
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
'searchable' => true,
|
||||
'in' => false,
|
||||
'not_in' => false
|
||||
),
|
||||
|
||||
// price_id
|
||||
array(
|
||||
'name' => 'price_id',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'default' => null,
|
||||
'sortable' => true,
|
||||
'allow_null' => true,
|
||||
),
|
||||
|
||||
// cart_index
|
||||
array(
|
||||
'name' => 'cart_index',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'default' => '0',
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// type
|
||||
array(
|
||||
'name' => 'type',
|
||||
'type' => 'varchar',
|
||||
'length' => '20',
|
||||
'default' => 'download',
|
||||
'sortable' => true,
|
||||
'transition' => true
|
||||
),
|
||||
|
||||
// status
|
||||
array(
|
||||
'name' => 'status',
|
||||
'type' => 'varchar',
|
||||
'length' => '20',
|
||||
'default' => 'pending',
|
||||
'sortable' => true,
|
||||
'transition' => true
|
||||
),
|
||||
|
||||
// quantity
|
||||
array(
|
||||
'name' => 'quantity',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'default' => '0',
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// amount
|
||||
array(
|
||||
'name' => 'amount',
|
||||
'type' => 'decimal',
|
||||
'length' => '18,9',
|
||||
'default' => '0',
|
||||
'sortable' => true,
|
||||
'validate' => 'edd_sanitize_amount'
|
||||
),
|
||||
|
||||
// subtotal
|
||||
array(
|
||||
'name' => 'subtotal',
|
||||
'type' => 'decimal',
|
||||
'length' => '18,9',
|
||||
'default' => '0',
|
||||
'sortable' => true,
|
||||
'validate' => 'edd_sanitize_amount'
|
||||
),
|
||||
|
||||
// discount
|
||||
array(
|
||||
'name' => 'discount',
|
||||
'type' => 'decimal',
|
||||
'length' => '18,9',
|
||||
'default' => '0',
|
||||
'sortable' => true,
|
||||
'validate' => 'edd_sanitize_amount'
|
||||
),
|
||||
|
||||
// tax
|
||||
array(
|
||||
'name' => 'tax',
|
||||
'type' => 'decimal',
|
||||
'length' => '18,9',
|
||||
'default' => '0',
|
||||
'sortable' => true,
|
||||
'validate' => 'edd_sanitize_amount'
|
||||
),
|
||||
|
||||
// total
|
||||
array(
|
||||
'name' => 'total',
|
||||
'type' => 'decimal',
|
||||
'length' => '18,9',
|
||||
'default' => '0',
|
||||
'sortable' => true,
|
||||
'validate' => 'edd_sanitize_amount'
|
||||
),
|
||||
|
||||
// rate
|
||||
array(
|
||||
'name' => 'rate',
|
||||
'type' => 'decimal',
|
||||
'length' => '10,5',
|
||||
'default' => '1.00000',
|
||||
),
|
||||
|
||||
// date_created
|
||||
array(
|
||||
'name' => 'date_created',
|
||||
'type' => 'datetime',
|
||||
'default' => '', // Defaults to current time in query class
|
||||
'created' => true,
|
||||
'date_query' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// date_modified
|
||||
array(
|
||||
'name' => 'date_modified',
|
||||
'type' => 'datetime',
|
||||
'default' => '', // Defaults to current time in query class
|
||||
'modified' => true,
|
||||
'date_query' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// uuid
|
||||
array(
|
||||
'uuid' => true,
|
||||
)
|
||||
);
|
||||
}
|
@ -0,0 +1,134 @@
|
||||
<?php
|
||||
/**
|
||||
* Order Transactions Schema Class.
|
||||
*
|
||||
* @package EDD
|
||||
* @subpackage Database\Schemas
|
||||
* @copyright Copyright (c) 2018, Easy Digital Downloads, LLC
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
||||
* @since 3.0
|
||||
*/
|
||||
namespace EDD\Database\Schemas;
|
||||
|
||||
// Exit if accessed directly
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
use EDD\Database\Schema;
|
||||
|
||||
/**
|
||||
* Order Transactions Schema Class.
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
class Order_Transactions extends Schema {
|
||||
|
||||
/**
|
||||
* Array of database column objects
|
||||
*
|
||||
* @since 3.0
|
||||
* @access public
|
||||
* @var array
|
||||
*/
|
||||
public $columns = array(
|
||||
|
||||
// id
|
||||
array(
|
||||
'name' => 'id',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'extra' => 'auto_increment',
|
||||
'primary' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// object_id
|
||||
array(
|
||||
'name' => 'object_id',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'default' => '0',
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// object_type
|
||||
array(
|
||||
'name' => 'object_type',
|
||||
'type' => 'varchar',
|
||||
'length' => '20',
|
||||
'default' => '',
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// transaction_id
|
||||
array(
|
||||
'name' => 'transaction_id',
|
||||
'type' => 'varchar',
|
||||
'length' => '256',
|
||||
'cache_key' => true,
|
||||
'searchable' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// gateway
|
||||
array(
|
||||
'name' => 'gateway',
|
||||
'type' => 'varchar',
|
||||
'length' => '20',
|
||||
'sortable' => true,
|
||||
),
|
||||
|
||||
// status
|
||||
array(
|
||||
'name' => 'status',
|
||||
'type' => 'varchar',
|
||||
'length' => '20',
|
||||
'default' => 'pending',
|
||||
'sortable' => true,
|
||||
'transition' => true
|
||||
),
|
||||
|
||||
// total
|
||||
array(
|
||||
'name' => 'total',
|
||||
'type' => 'decimal',
|
||||
'length' => '18,9',
|
||||
'default' => '0',
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// rate
|
||||
array(
|
||||
'name' => 'rate',
|
||||
'type' => 'decimal',
|
||||
'length' => '10,5',
|
||||
'default' => '1.00000',
|
||||
),
|
||||
|
||||
// date_created
|
||||
array(
|
||||
'name' => 'date_created',
|
||||
'type' => 'datetime',
|
||||
'default' => '', // Defaults to current time in query class
|
||||
'created' => true,
|
||||
'date_query' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// date_modified
|
||||
array(
|
||||
'name' => 'date_modified',
|
||||
'type' => 'datetime',
|
||||
'default' => '', // Defaults to current time in query class
|
||||
'modified' => true,
|
||||
'date_query' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// uuid
|
||||
array(
|
||||
'uuid' => true,
|
||||
)
|
||||
);
|
||||
}
|
@ -0,0 +1,255 @@
|
||||
<?php
|
||||
/**
|
||||
* Orders Schema Class.
|
||||
*
|
||||
* @package EDD
|
||||
* @subpackage Database\Schemas
|
||||
* @copyright Copyright (c) 2018, Easy Digital Downloads, LLC
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
||||
* @since 3.0
|
||||
*/
|
||||
namespace EDD\Database\Schemas;
|
||||
|
||||
// Exit if accessed directly
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
use EDD\Database\Schema;
|
||||
|
||||
/**
|
||||
* Orders Schema Class.
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
class Orders extends Schema {
|
||||
|
||||
/**
|
||||
* Array of database column objects.
|
||||
*
|
||||
* @since 3.0
|
||||
* @var array
|
||||
*/
|
||||
public $columns = array(
|
||||
|
||||
// id
|
||||
array(
|
||||
'name' => 'id',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'extra' => 'auto_increment',
|
||||
'primary' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// parent
|
||||
array(
|
||||
'name' => 'parent',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'default' => '0',
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// order_number
|
||||
array(
|
||||
'name' => 'order_number',
|
||||
'type' => 'varchar',
|
||||
'length' => '255',
|
||||
'searchable' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// status
|
||||
array(
|
||||
'name' => 'status',
|
||||
'type' => 'varchar',
|
||||
'length' => '20',
|
||||
'default' => 'pending',
|
||||
'sortable' => true,
|
||||
'transition' => true
|
||||
),
|
||||
|
||||
// type
|
||||
array(
|
||||
'name' => 'type',
|
||||
'type' => 'varchar',
|
||||
'length' => '20',
|
||||
'default' => 'sale',
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// user_id
|
||||
array(
|
||||
'name' => 'user_id',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'default' => '0',
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// customer_id
|
||||
array(
|
||||
'name' => 'customer_id',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'default' => '0',
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// email
|
||||
array(
|
||||
'name' => 'email',
|
||||
'type' => 'varchar',
|
||||
'length' => '100',
|
||||
'searchable' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// ip
|
||||
array(
|
||||
'name' => 'ip',
|
||||
'type' => 'varchar',
|
||||
'length' => '60',
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// gateway
|
||||
array(
|
||||
'name' => 'gateway',
|
||||
'type' => 'varchar',
|
||||
'length' => '100',
|
||||
'sortable' => true,
|
||||
'default' => 'manual',
|
||||
),
|
||||
|
||||
// mode
|
||||
array(
|
||||
'name' => 'mode',
|
||||
'type' => 'varchar',
|
||||
'length' => '20'
|
||||
),
|
||||
|
||||
// currency
|
||||
array(
|
||||
'name' => 'currency',
|
||||
'type' => 'varchar',
|
||||
'length' => '20',
|
||||
'validate' => 'strtoupper',
|
||||
),
|
||||
|
||||
// payment_key
|
||||
array(
|
||||
'name' => 'payment_key',
|
||||
'type' => 'varchar',
|
||||
'length' => '64',
|
||||
'searchable' => true,
|
||||
),
|
||||
|
||||
// tax_rate_id
|
||||
array(
|
||||
'name' => 'tax_rate_id',
|
||||
'type' => 'bigint',
|
||||
'length' => '20',
|
||||
'unsigned' => true,
|
||||
'default' => null,
|
||||
'allow_null' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// subtotal
|
||||
array(
|
||||
'name' => 'subtotal',
|
||||
'type' => 'decimal',
|
||||
'length' => '18,9',
|
||||
'default' => '0',
|
||||
'sortable' => true,
|
||||
'validate' => 'edd_sanitize_amount'
|
||||
),
|
||||
|
||||
// discount
|
||||
array(
|
||||
'name' => 'discount',
|
||||
'type' => 'decimal',
|
||||
'length' => '18,9',
|
||||
'default' => '0',
|
||||
'sortable' => true,
|
||||
'validate' => 'edd_sanitize_amount'
|
||||
),
|
||||
|
||||
// tax
|
||||
array(
|
||||
'name' => 'tax',
|
||||
'type' => 'decimal',
|
||||
'length' => '18,9',
|
||||
'default' => '0',
|
||||
'sortable' => true,
|
||||
'validate' => 'edd_sanitize_amount'
|
||||
),
|
||||
|
||||
// total
|
||||
array(
|
||||
'name' => 'total',
|
||||
'type' => 'decimal',
|
||||
'length' => '18,9',
|
||||
'default' => '0',
|
||||
'sortable' => true,
|
||||
'validate' => 'edd_sanitize_amount'
|
||||
),
|
||||
|
||||
// rate
|
||||
array(
|
||||
'name' => 'rate',
|
||||
'type' => 'decimal',
|
||||
'length' => '10,5',
|
||||
'default' => '1.00000',
|
||||
),
|
||||
|
||||
// date_created
|
||||
array(
|
||||
'name' => 'date_created',
|
||||
'type' => 'datetime',
|
||||
'default' => '', // Defaults to current time in query class
|
||||
'created' => true,
|
||||
'date_query' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// date_modified
|
||||
array(
|
||||
'name' => 'date_modified',
|
||||
'type' => 'datetime',
|
||||
'default' => '', // Defaults to current time in query class
|
||||
'modified' => true,
|
||||
'date_query' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// date_completed
|
||||
array(
|
||||
'name' => 'date_completed',
|
||||
'type' => 'datetime',
|
||||
'default' => null,
|
||||
'allow_null' => true,
|
||||
'date_query' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// date_refundable
|
||||
array(
|
||||
'name' => 'date_refundable',
|
||||
'type' => 'datetime',
|
||||
'default' => null,
|
||||
'allow_null' => true,
|
||||
'date_query' => true,
|
||||
'sortable' => true
|
||||
),
|
||||
|
||||
// uuid
|
||||
array(
|
||||
'uuid' => true,
|
||||
)
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user