<?php

namespace GemBoards\Database;

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

use GemBoards\Utils\Helper;

class CreatePermissionsTable {

	public static function up( $prefix, $charset_collate ) {
		$table_name = $prefix . Helper::ROLES_TABLE_NAME;
		$sql        = "CREATE TABLE IF NOT EXISTS $table_name (
            id INT AUTO_INCREMENT PRIMARY KEY,
            user_id BIGINT UNSIGNED NOT NULL,
            object_id BIGINT UNSIGNED NOT NULL,
            object_type VARCHAR(20),
            role VARCHAR(200)
        ) $charset_collate;";
		dbDelta( $sql );
	}

}
