# storeengine/2.1.0/includes/database/create-api-keys.php

StoreEngine — Complete eCommerce Solution with Memberships, Licensing, Affiliates &amp; More, version 2.1.0. 32 lines.

- Page: https://pluginprobe.com/plugins/storeengine/2.1.0/code/includes/database/create-api-keys.php
- Raw: https://pluginprobe.com/plugins/storeengine/2.1.0/raw/includes/database/create-api-keys.php
- Modified: 2025-07-31T09:22:38+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/storeengine/2.1.0/code/includes/database/create-api-keys.php#L10-L20`.

```php
<?php

namespace StoreEngine\Database;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

class CreateApiKeys {

	public static function up( $prefix, $charset_collate ) {
		$table_name = $prefix . 'storeengine_api_keys';
		$sql        = "CREATE TABLE IF NOT EXISTS {$table_name} (
			`key_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
			`user_id` bigint(20) unsigned NOT NULL,
			`description` varchar(200) DEFAULT NULL,
			`permissions` varchar(10) NOT NULL,
			`consumer_key` char(64) NOT NULL,
			`consumer_secret` char(43) NOT NULL,
			`nonces` longtext,
			`truncated_key` char(7) NOT NULL,
			`last_access` TIMESTAMP DEFAULT NULL,
			`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
			PRIMARY KEY (`key_id`),
			KEY `consumer_key` (`consumer_key`),
			KEY `consumer_secret` (`consumer_secret`)
        ) $charset_collate;";

		dbDelta( $sql );
	}
}

```
