Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrations table clean up #121

Open
wants to merge 1 commit into
base: lar-53
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions app/ImplementingPartner.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ class ImplementingPartner extends Model
use SoftDeletes;
protected $dates = ['deleted_at'];

/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'implementing_partners';

public function agency()
{
return $this->belongsTo('App\Agency');
Expand Down
14 changes: 14 additions & 0 deletions database/migrations/2014_10_12_000000_create_users_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ public function up()
Schema::create('users', function (Blueprint $table) {
$table->increments('id')->unsigned();
$table->string('name');
$table->string('last_name', 100)->nullable();
$table->string('middle_name', 100)->nullable();// not mandatory
$table->string('first_name', 100)->nullable();
$table->tinyInteger("gender")->default(0);
$table->string('email')->nullable();
$table->string('phone')->nullable();
Expand All @@ -23,6 +26,17 @@ public function up()
$table->string('password', 60);
$table->string("image", 100)->nullable();
$table->integer('uid')->nullable();
$table->string('sms_code')->nullable();
$table->boolean('phone_verified')->default(false);
$table->string('email_verification_code')->nullable();
$table->boolean('email_verified')->default(false);
// $table->string("remember_token", 100)->nullable();
$table->date('date_registered')->nullable();
$table->tinyInteger('status')->nullable();
$table->string('reason', 25)->nullable();
$table->date('status_date')->nullable();
$table->integer('implementing_partner_id')->unsigned();

$table->rememberToken();

$table->softDeletes();
Expand Down
31 changes: 29 additions & 2 deletions database/migrations/2016_09_01_130828_pt_setup_tables.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public function up()
$table->string('name');
$table->string('description', 100)->nullable();
$table->date('start_date');
$table->date('enrollment_date');
$table->date('end_date');
$table->integer('user_id')->unsigned();
$table->foreign('user_id')->references('id')->on('users');
Expand Down Expand Up @@ -122,7 +123,7 @@ public function up()
$table->increments('id')->unsigned();
$table->integer('user_id')->unsigned();
$table->integer('round_id')->unsigned();
// $table->tinyInteger('status')->default(0);
$table->tinyInteger('status')->default(0);

$table->softDeletes();
$table->timestamps();
Expand All @@ -149,6 +150,10 @@ public function up()
$table->tinyInteger('incomplete_results')->default(0);
$table->string('comment', 250)->nullable();
$table->integer('verified_by')->nullable();
$table->integer('approved_by')->nullable();
$table->string('approved_comment', 250)->nullable();
$table->integer('download_status')->nullable();
$table->date('date_approved');
$table->foreign('enrolment_id')->references('id')->on('enrolments');
$table->softDeletes();
$table->timestamps();
Expand All @@ -167,6 +172,26 @@ public function up()
$table->softDeletes();
$table->timestamps();
});

//Evaluated results used in audit trail
Schema::create('evaluated_results', function(Blueprint $table)
{
$table->increments('id')->unsigned();
$table->integer('pt_id')->unsigned();
$table->integer('participant_id')->unsigned();
$table->string('reason_for_change');
$table->string('results');
$table->integer('user_id')->unsigned();
$table->softDeletes();
$table->timestamps();

});

Schema::create('tmp_resultset', function(Blueprint $table)
{
$table->integer('pt_id')->unsigned();
$table->text('answers');
});
}

/**
Expand All @@ -186,6 +211,8 @@ public function down()
Schema::dropIfExists('lots');
Schema::dropIfExists('rounds');
Schema::dropIfExists('materials');
Schema::dropIfExists('programs');
Schema::dropIfExists('programs');
Schema::dropIfExists('evaluated_results');
Schema::dropIfExists('tmp_resultset');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public function up()
$table->increments('id')->unsigned();
$table->tinyInteger('template');
$table->string('message');
$table->string('description');
$table->softDeletes();
$table->timestamps();
});
Expand Down
40 changes: 0 additions & 40 deletions database/migrations/2017_06_21_064353_update_users_table.php

This file was deleted.

This file was deleted.

37 changes: 0 additions & 37 deletions database/migrations/2017_09_06_105832_date_user_registered.php

This file was deleted.

39 changes: 0 additions & 39 deletions database/migrations/2017_09_14_105907_participant_rejection.php

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function up()
$table->integer('county_id')->unsigned();
});

Schema::table('users', function (Blueprint $table) {
/* Schema::table('users', function (Blueprint $table) {
$table->integer('implementing_partner_id')->unsigned()->nullable();
});

Expand All @@ -42,7 +42,7 @@ public function up()
echo "agencies seeded!\n";
\DB::unprepared(file_get_contents(base_path() . "/database/seeds/implementing_partners.sql"));
echo "implementing partners seeded!\n";
\DB::enableQueryLog();
\DB::enableQueryLog();*/
}

/**
Expand All @@ -52,8 +52,7 @@ public function up()
*/
public function down()
{
Schema::drop('implementing_partner_user');
Schema::drop('implementing_partner_county');
Schema::drop('county_implementing_partner');
Schema::drop('implementing_partners');
Schema::drop('agencies');
}
Expand Down
35 changes: 0 additions & 35 deletions database/migrations/2018_03_26_160605_update_pt_table.php

This file was deleted.

3 changes: 2 additions & 1 deletion database/seeds/DatabaseSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ public function run()
Model::unguard();

$this->call(PTSeeder::class);

$this->call(DesignationSeeder::class);

Model::reguard();
}
}
Loading