Differential D1408 Diff 3739 src/database/migrations/2020_05_21_080131_create_transactions_table.php
Changeset View
Changeset View
Standalone View
Standalone View
src/database/migrations/2020_05_21_080131_create_transactions_table.php
Show All 19 Lines | public function up() | ||||
$table->string('id', 36)->primary(); | $table->string('id', 36)->primary(); | ||||
$table->string('user_email')->nullable(); | $table->string('user_email')->nullable(); | ||||
$table->string('object_id', 36)->index(); | $table->string('object_id', 36)->index(); | ||||
$table->string('object_type', 36)->index(); | $table->string('object_type', 36)->index(); | ||||
$table->string('type', 8); | $table->string('type', 8); | ||||
$table->integer('amount')->nullable(); | $table->integer('amount')->nullable(); | ||||
$table->string('description')->nullable(); | $table->string('description')->nullable(); | ||||
$table->string('transaction_id', 36)->nullable()->index(); | $table->string('transaction_id', 36)->nullable()->index(); | ||||
$table->timestamps(); | $table->timestamp('created_at')->useCurrent(); | ||||
$table->timestamp('updated_at')->useCurrent(); | |||||
$table->index(['object_id', 'object_type']); | $table->index(['object_id', 'object_type']); | ||||
} | } | ||||
); | ); | ||||
} | } | ||||
/** | /** | ||||
* Reverse the migrations. | * Reverse the migrations. | ||||
* | * | ||||
* @return void | * @return void | ||||
*/ | */ | ||||
public function down() | public function down() | ||||
{ | { | ||||
Schema::dropIfExists('transactions'); | Schema::dropIfExists('transactions'); | ||||
} | } | ||||
} | } |