eOSP2/database/migrations/2019_09_19_113737_jednostki_terytorialne.php

50 lines
1.1 KiB
PHP

<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class JednostkiTerytorialne extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('wojewodztwa', function (Blueprint $table) {
// $table->increments('id');
$table->integer('id');
$table->string('name');
});
Schema::create('powiaty', function (Blueprint $table) {
$table->integer('id');
$table->integer('wojewodztwo_id');
$table->string('name');
});
Schema::create('gminy', function (Blueprint $table) {
$table->integer('id');
$table->integer('wojewodztwo_id');
$table->integer('powiat_id');
$table->string('name');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('wojewodztwa');
Schema::dropIfExists('powiaty');
Schema::dropIfExists('gminy');
}
}