Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /** Author: yourname :D **/
- use Illuminate\Support\Facades\Schema;
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Database\Migrations\Migration;
- class CreateAdminsTable extends Migration {
- /**
- * Run the migrations.
- *
- * @return void
- */
- public function up() {
- Schema::create('admins', function (Blueprint $table) {
- $table->increments('id');
- $table->string('email')->unique();
- $table->timestamps();
- $table->foreign('email')
- ->references('email')->on('users')
- ->onDelete('cascade');
- });
- }
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down() {
- Schema::dropIfExists('admins');
- }
- }
Add Comment
Please, Sign In to add comment