create migration

pull/1/head
Aji Kamaludin 6 years ago
parent 0a56684c3a
commit 4a08bd5e70
No known key found for this signature in database
GPG Key ID: 23E2BDC458317AF8

@ -3,6 +3,7 @@
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema;
class AppServiceProvider extends ServiceProvider
{
@ -23,6 +24,6 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot()
{
//
Schema::defaultStringLength(191);
}
}

@ -19,6 +19,7 @@ class CreateUsersTable extends Migration
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->string('role');
$table->rememberToken();
$table->timestamps();
});

@ -0,0 +1,34 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateKelas extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('kelas', function (Blueprint $table) {
$table->bigIncrements('id');
$table->integer('periode_id');
$table->string('nama');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('kelas');
}
}

@ -0,0 +1,34 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateRole extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('role', function (Blueprint $table) {
$table->bigIncrements('id');
$table->integer('tagihan_id');
$table->integer('siswa_id');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('role');
}
}

@ -0,0 +1,35 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePeriode extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('periode', function (Blueprint $table) {
$table->bigIncrements('id');
$table->date('tgl_mulai');
$table->date('tgl_selesai');
$table->boolean('is_active');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('periode');
}
}

@ -0,0 +1,42 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateSiswa extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('siswa', function (Blueprint $table) {
$table->bigIncrements('id');
$table->integer('kelas_id');
$table->string('nama');
$table->string('tempat_lahir');
$table->date('tanggal_lahir');
$table->enum('jenis_kelamin', ['L', 'P']);
$table->text('alamat');
$table->string('nama_wali');
$table->string('telp_wali');
$table->string('pekerjaan_wali');
$table->boolean('is_yatim');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('siswa');
}
}

@ -0,0 +1,36 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTagihan extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('tagihan', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('nama');
$table->double('jumlah');
$table->boolean('wajib_semua');
$table->integer('kelas_id');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('tagihan');
}
}

@ -0,0 +1,37 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTransaksi extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('transaksi', function (Blueprint $table) {
$table->bigIncrements('id');
$table->integer('siswa_id');
$table->integer('tagihan_id');
$table->integer('diskon');
$table->boolean('is_lunas');
$table->text('keterangan');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('transaksi');
}
}

@ -0,0 +1,38 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateKeuangan extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('keuangan', function (Blueprint $table) {
$table->bigIncrements('id');
$table->integer('tabungan_id');
$table->integer('transaksi_id');
$table->enum('tipe', ['in','out']);
$table->double('jumlah');
$table->double('total_kas');
$table->text('keterangan');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('keuangan');
}
}

@ -0,0 +1,37 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTabungan extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('tabungan', function (Blueprint $table) {
$table->bigIncrements('id');
$table->integer('siswa_id');
$table->enum('tipe', ['in','out']);
$table->double('jumlah');
$table->double('saldo');
$table->text('keperluan');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('tabungan');
}
}
Loading…
Cancel
Save