<?php
namespace QuizPress\Database;

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


class CreateGuestTokenTable {

	public static function up( $prefix, $charset_collate ) {
		$table_name = $prefix . 'quizpress_guest_tokens';

		$sql = "CREATE TABLE $table_name (
            id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
            token VARCHAR(64) NOT NULL,
            created_at DATETIME NOT NULL,
            PRIMARY KEY (id),
            UNIQUE KEY token (token)
        ) $charset_collate;";

		dbDelta( $sql );
	}
}
