1

We have an issue where the super-table fix-content-tables needs to be run. This fixes the issue on local and development environments.

The problem is we have a very restricted production environment from the customer and need to trigger the repair from the CLI (deploy time command) otherwise it has timeout issues running it from frontend.

What's the best way for us to achieve this?

1 Answer 1

3

Under the hood, the Super Table fix is running a migration behind a controller, which you can call in a content migration directly in your project. I have done the same, due needing to script it in a deployment.

<?php

namespace craft\contentmigrations;

use craft\db\Migration;
use verbb\supertable\migrations\m190120_000000_fix_supertablecontent_tables;

/**
 * m190412_102156_fix_super_table_content_tables migration.
 *
 * Runs the fix content table migration part of Super Table plugin
 */
class m190412_102156_fix_super_table_content_tables extends Migration
{

    public function safeUp()
    {
        echo "    > Starting migration for fixing Super Table content...\n";
        (new m190120_000000_fix_supertablecontent_tables())->safeUp();

        return true;
    }

    /**
     * @inheritdoc
     */
    public function safeDown()
    {
        echo "m190412_102156_fix_super_table_content_tables cannot be reverted.\n";
        return false;
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.