# bookit/2.6.0.5/includes/classes/database/Coupons.php

Bookit — Booking &amp; Appointment Calendar, version 2.6.0.5. 35 lines.

- Page: https://pluginprobe.com/plugins/bookit/2.6.0.5/code/includes/classes/database/Coupons.php
- Raw: https://pluginprobe.com/plugins/bookit/2.6.0.5/raw/includes/classes/database/Coupons.php
- Modified: 2026-09-14T17:08:02+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/bookit/2.6.0.5/code/includes/classes/database/Coupons.php#L10-L20`.

```php
<?php

namespace Bookit\Classes\Database;

use Bookit\Classes\Vendor\DatabaseModel;

class Coupons extends DatabaseModel {

	/**
	 * Create Table
	 */
	public static function create_table() {
		global $wpdb;
		require_once ABSPATH . 'wp-admin/includes/upgrade.php';

		$table_name  = self::_table();
		$primary_key = self::$primary_key;

		$sql = "CREATE TABLE IF NOT EXISTS  {$table_name} (
			`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
			`discount` INT UNSIGNED NOT NULL,
			`code` VARCHAR(255) NOT NULL,
			`usage_limit` INT UNSIGNED DEFAULT NULL,
			`once_per_user` INT UNSIGNED DEFAULT NULL,
			`services` longtext DEFAULT NULL,
			`staff` longtext DEFAULT NULL,
			`created_at` DATETIME NOT NULL,
    		`updated_at` DATETIME NOT NULL,
			PRIMARY KEY ({$primary_key})
		) {$wpdb->get_charset_collate()};";

		maybe_create_table( $table_name, $sql );
	}
}

```
