| @@ 23-33 (lines=11) @@ | ||
| 20 | */ |
|
| 21 | public function up() |
|
| 22 | { |
|
| 23 | Schema::create($this->table_attachments, function(Blueprint $table) { |
|
| 24 | $table->increments('id'); |
|
| 25 | $table->string('name'); |
|
| 26 | $table->string('original_name'); |
|
| 27 | $table->text('description')->nullable(); |
|
| 28 | $table->boolean('is_main')->default(false)->index(); |
|
| 29 | $table->integer('user_id')->nullable()->unsigned()->index(); |
|
| 30 | $table->timestamps(); |
|
| 31 | ||
| 32 | $table->foreign('user_id')->references('id')->on('users')->onDelete('SET NULL')->onUpdate('CASCADE'); |
|
| 33 | }); |
|
| 34 | ||
| 35 | Schema::create('attachables', function(Blueprint $table) { |
|
| 36 | $table->integer('attachment_id')->unsigned(); |
|
| @@ 10-22 (lines=13) @@ | ||
| 7 | ||
| 8 | class CreateSocialAccountsTable extends Migration |
|
| 9 | { |
|
| 10 | public function up() |
|
| 11 | { |
|
| 12 | Schema::create('social_accounts', function(Blueprint $table) { |
|
| 13 | $table->increments('id'); |
|
| 14 | $table->integer('user_id')->unsigned()->nullable()->index(); |
|
| 15 | $table->string('provider')->index(); |
|
| 16 | $table->string('provider_user_id'); |
|
| 17 | $table->text('provider_user_info')->nullable(); |
|
| 18 | $table->timestamps(); |
|
| 19 | ||
| 20 | $table->foreign('user_id')->references('id')->on('users')->onDelete('CASCADE')->onUpdate('CASCADE'); |
|
| 21 | }); |
|
| 22 | } |
|
| 23 | ||
| 24 | /** |
|
| 25 | * Reverse the migrations. |
|