2019_02_12_195938_add_balance_due_at_and_updated_at_to_transactions_table.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. // Copyright 2019 Hackware SpA <human@hackware.cl>
  3. // This file is part of "Hackware Web Services Wallet" and licensed under
  4. // the terms of the GNU Affero General Public License version 3, or (at your
  5. // option) a later version. You should have received a copy of this license
  6. // along with the software. If not, see <https://www.gnu.org/licenses/>.
  7. use Illuminate\Support\Facades\Schema;
  8. use Illuminate\Database\Schema\Blueprint;
  9. use Illuminate\Database\Migrations\Migration;
  10. class AddBalanceDueAtAndUpdatedAtToTransactionsTable extends Migration
  11. {
  12. /**
  13. * Run the migrations.
  14. *
  15. * @return void
  16. */
  17. public function up()
  18. {
  19. Schema::table('transactions', function (Blueprint $table) {
  20. $table->decimal('balance', 16, 8)->after('amount');
  21. $table->timestamp('due_at')->nullable()->after('detail');
  22. $table->timestamp('updated_at')->nullable()->after('created_at');
  23. });
  24. }
  25. /**
  26. * Reverse the migrations.
  27. *
  28. * @return void
  29. */
  30. public function down()
  31. {
  32. Schema::table('transactions', function (Blueprint $table) {
  33. $table->dropColumn('balance', 'due_at', 'updated_at');
  34. });
  35. }
  36. }