Skip to content

Instantly share code, notes, and snippets.

@brandonsueur
Last active August 19, 2019 16:46
Show Gist options
  • Save brandonsueur/8d11178b31cc976d95e30fa7403cea06 to your computer and use it in GitHub Desktop.
Save brandonsueur/8d11178b31cc976d95e30fa7403cea06 to your computer and use it in GitHub Desktop.
Code php
<?php
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('first_name', 50);
$table->string('last_name', 50);
$table->string('username', 50);
$table->string('phone')->nullable();
$table->string('address')->nullable();
$table->string('email')->unique();
$table->enum('role', ['salaried', 'admin', 'super-admin'])->nullable();
$table->enum('user_type', ['carrier', 'hospital', 'gesnord'])->nullable();
$table->datetime('last_login_at')->nullable();
$table->string('address_ip')->nullable();
$table->string('password');
$table->tinyInteger('verified')->default(false);
$table->timestamp('banned')->nullable();
$table->rememberToken();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCompaniesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('companies', function (Blueprint $table) {
$table->bigIncrements('id');
//$table->unsignedBigInteger('boss_id');
$table->string('name', 50)->unique();
$table->string('phone')->nullable();
$table->string('address')->nullable();
$table->tinyInteger('legal_redress')->default(false);
$table->tinyInteger('judicial_liquidation')->default(false);
$table->string('net_profit');
$table->string('turnover');
$table->bigInteger('employees_count');
$table->string('customer_reference');
$table->tinyInteger('verified')->default(false);
$table->timestamp('banned')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('companies');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment