Files
apache
wp-content
mu-plugins
plugins
activitypub
audioigniter
authldap
companion-auto-update
disable-wordpress-core-update
easy-digital-downloads
assets
includes
adjustments
admin
api
blocks
cart
checkout
compat
currency
customers
database
engine
queries
rows
schemas
tables
class-adjustment-meta.php
class-adjustments.php
class-customer-addresses.php
class-customer-email-addresses.php
class-customer-meta.php
class-customers.php
class-log-meta.php
class-logs-api-request-meta.php
class-logs-api-requests.php
class-logs-file-download-meta.php
class-logs-file-downloads.php
class-logs.php
class-note-meta.php
class-notes.php
class-order-addresses.php
class-order-adjustment-meta.php
class-order-adjustments.php
class-order-item-meta.php
class-order-items.php
class-order-meta.php
class-order-transactions.php
class-orders.php
NotificationsDB.php
README.md
downloads
emails
extensions
gateways
libraries
logs
models
notes
orders
payments
reports
traits
users
utils
EDD_SL_Plugin_Updater.php
actions.php
ajax-functions.php
class-base-object.php
class-component.php
class-easy-digital-downloads.php
class-edd-cache-helper.php
class-edd-cli.php
class-edd-cron.php
class-edd-customer-query.php
class-edd-customer.php
class-edd-db-customer-meta.php
class-edd-db-customers.php
class-edd-db.php
class-edd-discount.php
class-edd-download.php
class-edd-fees.php
class-edd-html-elements.php
class-edd-license-handler.php
class-edd-logging.php
class-edd-register-meta.php
class-edd-roles.php
class-edd-session.php
class-edd-stats.php
class-stats.php
class-structured-data.php
class-utilities.php
compat-functions.php
component-functions.php
country-functions.php
customer-functions.php
date-functions.php
deprecated-functions.php
deprecated-hooks.php
discount-functions.php
download-functions.php
error-tracking.php
formatting.php
install.php
interface-edd-exception.php
mime-types.php
misc-functions.php
plugin-compatibility.php
post-types.php
privacy-functions.php
process-download.php
process-purchase.php
query-filters.php
refund-functions.php
scripts.php
shortcodes.php
tax-functions.php
template-actions.php
template-functions.php
theme-compatibility.php
user-functions.php
widgets.php
languages
templates
easy-digital-downloads.php
license.txt
readme.txt
uninstall.php
gitium
gp-premium
jetpack-protect
menu-icons
simple-local-avatars
smtp-mailer
two-factor
wp-piwik
wp-webauthn
index.php
themes
index.php
.dbsetup
.gitignore
htaccess
php.ini

100 lines
2.1 KiB
PHP

<?php
/**
* Notes Table.
*
* @package EDD
* @subpackage Database\Tables
* @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\Tables;
// Exit if accessed directly
defined( 'ABSPATH' ) || exit;
use EDD\Database\Table;
/**
* Setup the global "edd_notes" database table
*
* @since 3.0
*/
final class Notes extends Table {
/**
* Table name
*
* @access protected
* @since 3.0
* @var string
*/
protected $name = 'notes';
/**
* Database version
*
* @access protected
* @since 3.0
* @var int
*/
protected $version = 202002141;
/**
* Array of upgrade versions and methods
*
* @since 3.0
*
* @var array
*/
protected $upgrades = array(
'202002141' => 202002141,
);
/**
* Setup the database schema
*
* @access protected
* @since 3.0
* @return void
*/
protected function set_schema() {
$this->schema = "id bigint(20) unsigned NOT NULL auto_increment,
object_id bigint(20) unsigned NOT NULL default '0',
object_type varchar(20) NOT NULL default '',
user_id bigint(20) unsigned NOT NULL default '0',
content longtext NOT NULL default '',
date_created datetime NOT NULL default CURRENT_TIMESTAMP,
date_modified datetime NOT NULL default CURRENT_TIMESTAMP,
uuid varchar(100) NOT NULL default '',
PRIMARY KEY (id),
KEY object_id_type (object_id,object_type(20)),
KEY user_id (user_id),
KEY date_created (date_created)";
}
/**
* Upgrade to version 202002141
* - Change default value to `CURRENT_TIMESTAMP` for columns `date_created` and `date_modified`.
*
* @since 3.0
* @return bool
*/
protected function __202002141() {
// Update `date_created`.
$result = $this->get_db()->query( "
ALTER TABLE {$this->table_name} MODIFY COLUMN `date_created` datetime NOT NULL default CURRENT_TIMESTAMP;
" );
// Update `date_modified`.
$result = $this->get_db()->query( "
ALTER TABLE {$this->table_name} MODIFY COLUMN `date_modified` datetime NOT NULL default CURRENT_TIMESTAMP;
" );
return $this->is_success( $result );
}
}