<?php

use Spatie\LaravelSettings\Migrations\SettingsMigration;

return new class extends SettingsMigration
{
    public function up(): void
    {
        $this->migrator->inGroup('blog', function ($blueprint): void {
            $blueprint->add('posts_per_page', 10);
            $blueprint->add('allow_comments', true);
            $blueprint->add('comment_order', 'asc');
            $blueprint->add('show_views', true);
            $blueprint->add('show_author', true);
            $blueprint->add('date_format', 'Y-m-d');
            $blueprint->add('close_comments_on_old_posts', false);
            $blueprint->add('close_comments_days', 90);
        });

        $this->migrator->inGroup('comment', function ($blueprint): void {
            $blueprint->add('guest_can_comment', true);
            $blueprint->add('require_moderation', false);
            $blueprint->add('rate_limit_per_minute', 5);
            $blueprint->add('enable_website_field', true);
            $blueprint->add('forbidden_words', '');
        });

        $this->migrator->inGroup('seo', function ($blueprint): void {
            $blueprint->add('robots_index', true);
            $blueprint->add('twitter_site', null);
            $blueprint->add('canonical_force_https', false);
        });
    }
};
