migrate add
This commit is contained in:
parent
5c9fd90aa0
commit
f74fc59e70
|
|
@ -0,0 +1,23 @@
|
|||
<?php namespace Tps\Tps\Updates;
|
||||
|
||||
use Schema;
|
||||
use October\Rain\Database\Updates\Migration;
|
||||
|
||||
class BuilderTableCreateTpsTpsTestCategories extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::create('tps_tps_test_categories', function($table)
|
||||
{
|
||||
$table->engine = 'InnoDB';
|
||||
$table->increments('id')->unsigned();
|
||||
$table->string('title');
|
||||
$table->text('description');
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('tps_tps_test_categories');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<?php namespace Tps\Tps\Updates;
|
||||
|
||||
use Schema;
|
||||
use October\Rain\Database\Updates\Migration;
|
||||
|
||||
class BuilderTableCreateTpsTpsTestQuestions extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::create('tps_tps_test_questions', function($table)
|
||||
{
|
||||
$table->engine = 'InnoDB';
|
||||
$table->increments('id')->unsigned();
|
||||
$table->string('title');
|
||||
$table->text('description')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('tps_tps_test_questions');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
<?php namespace Tps\Tps\Updates;
|
||||
|
||||
use Schema;
|
||||
use October\Rain\Database\Updates\Migration;
|
||||
|
||||
class BuilderTableUpdateTpsTpsTestQuestions extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::table('tps_tps_test_questions', function($table)
|
||||
{
|
||||
$table->integer('test_id');
|
||||
$table->string('question');
|
||||
$table->text('answers');
|
||||
$table->dropColumn('title');
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::table('tps_tps_test_questions', function($table)
|
||||
{
|
||||
$table->dropColumn('test_id');
|
||||
$table->dropColumn('question');
|
||||
$table->dropColumn('answers');
|
||||
$table->string('title', 191);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
<?php namespace Tps\Tps\Updates;
|
||||
|
||||
use Schema;
|
||||
use October\Rain\Database\Updates\Migration;
|
||||
|
||||
class BuilderTableUpdateTpsTpsTests extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::rename('tps_tps_test_categories', 'tps_tps_tests');
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::rename('tps_tps_tests', 'tps_tps_test_categories');
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue