app
bootstrap
config
database
factories
migrations
2014_10_12_000000_create_users_table.php
2014_10_12_100000_create_password_resets_table.php
2019_08_19_000000_create_failed_jobs_table.php
2020_07_23_072249_create_homes.php
2020_07_23_111936_update_homes_images_downloaded.php
2020_07_23_125915_update_homes_with_comment.php
seeds
.gitignore
public
resources
routes
storage
tests
.editorconfig
.env.example
.gitattributes
.gitignore
.styleci.yml
README.md
artisan
composer.json
composer.lock
package-lock.json
package.json
phpunit.xml
server.php
webpack.mix.js
44 lines
1.4 KiB
PHP
44 lines
1.4 KiB
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
class CreateHomes extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('homes', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->string('title')->comment('A title');
|
|
$table->integer('price')->comment('Total price of the house');
|
|
$table->integer('surface')->comment('Home surface');
|
|
$table->integer('garden_surface')->nullable()->comment('Garden surface');
|
|
$table->integer('rooms')->nullable()->comment('How many rooms');
|
|
$table->char('energy')->nullable()->comment('Energy Economy');
|
|
$table->char('ges')->nullable()->comment('GES');
|
|
$table->text('description')->nullable()->comment('description of the house');
|
|
$table->string('city')->comment('City');
|
|
$table->json('pictures')->nullable()->comment('List of photos');
|
|
$table->json('map')->nullable()->comment('lat and lng');
|
|
$table->string('url')->comment('Origin');
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('homes');
|
|
}
|
|
}
|