wintercms / wn-builder-plugin

GUI for building plugins in Winter CMS
MIT License
34 stars 12 forks source link

Blueprint type before $table, uncomment migration code block, replace create, drop to table and curly brace position #50

Open dimti opened 1 year ago

dimti commented 1 year ago

Migration generated without Blueprint type of $table and commented migration code block - why? Better - place migration code block without comments and with true typing

Replace:

<?php namespace {namespace};

use Schema;
use Winter\Storm\Database\Updates\Migration;

class {className} extends Migration
{
    public function up()
    {
        // Schema::create('{tableNamePrefix}_table', function($table)
        // {
        // });
    }

    public function down()
    {
        // Schema::drop('{tableNamePrefix}_table');
    }
}

To:

<?php namespace {namespace};

use Schema;
use Winter\Storm\Database\Schema\Blueprint;
use Winter\Storm\Database\Updates\Migration;

class {className} extends Migration
{
    public function up()
    {
        Schema::table('{tableNamePrefix}_table', function (Blueprint $table) {

        });
    }

    public function down()
    {
        Schema::table('{tableNamePrefix}_table', function (Blueprint $table) {

        });
    }
}
dimti commented 1 year ago

Correct "stubs" https://github.com/dimti/wn-builder-plugin/commit/b6f95931f932c5793983535dc805102b276b34d5

bennothommo commented 1 year ago

@dimti happy to merge in a PR, if you could provide your changes as one. :)

dimti commented 1 year ago

@bennothommo Okey, i need resolved for https://github.com/wintercms/wn-builder-plugin/pull/52, because changes on that subject - checkouted from them