<?php

namespace GemBoards\Database;

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


class CreateBoardVisitsTable {

	public static function up( $prefix, $charset_collate ) {
		$table_name = $prefix . 'gemboards_board_visits';
		$sql        = "CREATE TABLE $table_name (
		    id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
		    board_id bigint(20) unsigned NOT NULL,
		    user_id bigint(20) unsigned NOT NULL,
		    visited_at datetime DEFAULT CURRENT_TIMESTAMP,
		    PRIMARY KEY (id)
		) $charset_collate;";
		dbDelta( $sql );
	}

}
