Skip to content

Commit

Permalink
Alter table na tabela users já existente
Browse files Browse the repository at this point in the history
  • Loading branch information
mgescobar committed Nov 29, 2024
1 parent fb58f90 commit 846c2ec
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions database/migrations/2024_11_29_185241_add_new_fields.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->string('city', 60)->nullable();
$table->string('state', 20)->nullable();
$table->string('linkedin', 101)->nullable()->unique();
$table->string('discord', 33)->nullable()->unique();
});
}

/**
* Reverse the migrations.
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn(['city', 'state', 'linkedin', 'discord']);
});
}
};

0 comments on commit 846c2ec

Please sign in to comment.