mirror of
https://github.com/rekywhyd/WebGIS_PengentasanKemiskinan.git
synced 2026-07-10 19:33:07 +00:00
Tampilan awal
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('tempat_ibadah', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('nama_tempat');
|
||||
$table->integer('radius_meter')->default(500);
|
||||
$table->decimal('lat', 10, 7);
|
||||
$table->decimal('lng', 10, 7);
|
||||
$table->string('alamat')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('tempat_ibadah');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('rumah_miskin', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('nama_kepala_keluarga');
|
||||
$table->decimal('lat', 10, 7);
|
||||
$table->decimal('lng', 10, 7);
|
||||
$table->string('alamat')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('rumah_miskin');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::rename('rumah_miskin', 'penerima_bantuan');
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::rename('penerima_bantuan', 'rumah_miskin');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('tempat_ibadah', function (Blueprint $table) {
|
||||
$table->enum('jenis_tempat_ibadah', ['Masjid', 'Gereja Katolik', 'Gereja Protestan', 'Vihara', 'Pura', 'Klenteng'])->nullable()->after('nama_tempat');
|
||||
$table->string('kontak_person')->nullable()->after('alamat');
|
||||
});
|
||||
|
||||
Schema::table('penerima_bantuan', function (Blueprint $table) {
|
||||
$table->foreignId('id_tempat_ibadah')->nullable()->after('id')->constrained('tempat_ibadah')->nullOnDelete();
|
||||
$table->string('nik_kepala_keluarga')->nullable()->unique()->after('nama_kepala_keluarga');
|
||||
$table->string('nomor_kk')->nullable()->after('nik_kepala_keluarga');
|
||||
$table->integer('jumlah_tanggungan')->nullable()->after('alamat');
|
||||
$table->string('foto_kondisi_rumah')->nullable()->after('jumlah_tanggungan');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('penerima_bantuan', function (Blueprint $table) {
|
||||
$table->dropForeign(['id_tempat_ibadah']);
|
||||
$table->dropColumn(['id_tempat_ibadah', 'nik_kepala_keluarga', 'nomor_kk', 'jumlah_tanggungan', 'foto_kondisi_rumah']);
|
||||
});
|
||||
|
||||
Schema::table('tempat_ibadah', function (Blueprint $table) {
|
||||
$table->dropColumn(['jenis_tempat_ibadah', 'kontak_person']);
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user