Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //contact harus duluan dibikin
- Schema::create('contacts', function (Blueprint $table) {
- $table->increments('id');
- $table->char('phone', 16)->unique();//ngak yakin
- $table->enum('aktivasi', [0, 1])->default(1);
- $table->timestamps();
- $table->string('update_by');
- $table->softDeletes();
- $table->string('delete_by');
- });
- Schema::create('users', function (Blueprint $table) {
- $table->increments('id');
- $table->char('phone',16);
- $table->foreign('phone')->references('phone')->on('contacts')->onUpdate('cascade');
- //->onDelete('restrict');
- $table->string('name')->index();
- $table->char('email',60)->unique('@');
- $table->enum('status', [1, 2, 11, 12])->default(1);
- $table->string('create_by');
- $table->timestamps();
- $table->string('update_by');
- $table->softDeletes();
- $table->string('delete_by');
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement