wn-builder-plugin icon indicating copy to clipboard operation
wn-builder-plugin copied to clipboard

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

Open dimti opened this issue 3 years ago • 3 comments

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 avatar Nov 26 '22 16:11 dimti

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

dimti avatar Nov 26 '22 17:11 dimti

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

bennothommo avatar Nov 27 '22 02:11 bennothommo

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

dimti avatar Nov 27 '22 06:11 dimti

Fixed as of https://github.com/wintercms/wn-builder-plugin/commit/ac6afd6242c39e26956c90ab93d9cb4bfd497e26.

bennothommo avatar Sep 09 '24 07:09 bennothommo