| Total Complexity | 2 |
| Total Lines | 42 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class CreatePostsTable extends Migration |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Run the migrations. |
||
| 11 | * |
||
| 12 | * @return void |
||
| 13 | */ |
||
| 14 | public function up() |
||
| 15 | { |
||
| 16 | Schema::create('posts', function (Blueprint $table) { |
||
| 17 | $table->id('id'); |
||
| 18 | $table->foreignId('category_id')->constrained('post_categories'); |
||
| 19 | $table->foreignId('user_id')->constrained(); |
||
| 20 | |||
| 21 | /*$table->integer('category_id')->unsigned(); |
||
| 22 | $table->foreign('category_id')->references('id')->on('post_categories');*/ |
||
| 23 | |||
| 24 | $table->string('title'); |
||
| 25 | $table->text('intro_text'); |
||
| 26 | $table->text('body'); |
||
| 27 | $table->boolean('featured')->default(0); |
||
| 28 | $table->text('before_content')->nullable(); |
||
| 29 | $table->text('after_content')->nullable(); |
||
| 30 | $table->string('introimage')->nullable(); |
||
| 31 | $table->string('introimage_alt')->nullable(); |
||
| 32 | |||
| 33 | $table->datetime('publish_at')->nullable(); |
||
| 34 | $table->datetime('publish_until')->nullable(); |
||
| 35 | //$table->boolean('is_published')->default(false); |
||
| 36 | $table->string('slug'); |
||
| 37 | $table->timestamps(); |
||
| 38 | }); |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Reverse the migrations. |
||
| 43 | * |
||
| 44 | * @return void |
||
| 45 | */ |
||
| 46 | public function down() |
||
| 49 | } |
||
| 50 | } |
||
| 51 |