<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateHostelPostsTable extends Migration {
	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up() {
		Schema::create( 'hostel_post_crawls', function ( Blueprint $table ) {
			$table->increments( 'id' );
			$table->string( 'user_post' )->nullable();
			$table->string( 'user_post_image', 1000 )->nullable();
			$table->string( 'user_post_phone' )->nullable();
			$table->text( 'content' )->nullable();
			$table->text( 'source_link' )->nullable();
			$table->string( 'province_id' )->nullable();
			$table->string( 'district_id' )->nullable();
			$table->string( 'ward_id' )->nullable();
			$table->text( 'address' )->nullable();
			$table->timestamps();
		} );

		Schema::create( 'hostel_post_crawl_medias', function ( Blueprint $table ) {
			$table->increments( 'id' );
			$table->string( 'media', 1000 )->nullable();
			$table->integer( 'hostel_post_crawl_id' )->nullable();
		} );
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down() {
		Schema::dropIfExists( 'hostel_posts' );
	}
}
