<?php

namespace GemBoards\Database;

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

use GemBoards\Utils\Helper;

class CreateBookmarksTable {

	public static function up( $prefix, $charset_collate ) {
		$table_name = $prefix . Helper::BOOKMARKS_TABLE_NAME;
		$sql        = "CREATE TABLE $table_name (
            id BIGINT(20) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
            user_id BIGINT(20) NOT NULL,
            project_id BIGINT(20) NOT NULL,
            target_object_id BIGINT(20) NOT NULL,
            target_object_type VARCHAR(255) NOT NULL,
            created_at DATETIME DEFAULT CURRENT_TIMESTAMP
        ) $charset_collate;";
		dbDelta( $sql );
	}

}
