“Laravel -Änderungsspaltenentyp” Code-Antworten

Laravel Fremdschlüssel

Schema::table('posts', function (Blueprint $table) {
    $table->unsignedBigInteger('user_id');

    $table->foreign('user_id')->references('id')->on('users');
});
OR
Schema::table('posts', function (Blueprint $table) {
    $table->foreignId('user_id')->constrained();
});
Courageous Cod

Laravel -Änderungsspaltenentyp

php artisan make:migration change_sometable_in_finance_table --table=finance

public function up()
{
    Schema::table('sometable', function (Blueprint $table) {
        $table->text('text')->change();
    });
}
Excited Echidna

Laravel Drop -Säule

// To drop a column, use the dropColumn method on the schema builder.
// Before dropping columns from a SQLite database, you will need to add
// the doctrine/dbal dependency to your composer.json file and run the
// composer update command in your terminal to install the library:

Schema::table('users', function (Blueprint $table) {
    $table->dropColumn('votes');
});
Yingfufu

Laravel -Änderungsspalte

Schema::table('users', function (Blueprint $table) {
    $table->string('name', 50)->nullable()->change();
});
Alberto Peripolli

Laravel -Migration Änderung des Säulenentyps

public function up()
{
    Schema::table('sometable', function (Blueprint $table) {
        $table->text('text')->change();
    });
}
hmt

Migrationen erforderlich Field Laravel

$table->string('foo')->nullable(false)->change();
r00ster

Ähnliche Antworten wie “Laravel -Änderungsspaltenentyp”

Fragen ähnlich wie “Laravel -Änderungsspaltenentyp”

Weitere verwandte Antworten zu “Laravel -Änderungsspaltenentyp” auf PHP

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen