<?php
namespace GemBoards\Database;

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

use GemBoards\Utils\Helper;

class CreateColumnsTable {

	public static function up( $prefix, $charset_collate ) {
		$table_name = $prefix . Helper::BOARD_COLUMN_TABLE_NAME;
		$sql        = "CREATE TABLE IF NOT EXISTS $table_name (
            id BIGINT(20) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
            board_id BIGINT(20) UNSIGNED NOT NULL,
            title VARCHAR(255),
            slug VARCHAR(100),
            color VARCHAR(20) default NULL,
            sort_order INT
        ) $charset_collate;";
		dbDelta( $sql );
	}

}
