migrate_water_withdrawal_demo.php 1.3 KB

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /** Optional, isolated withdrawal display fixtures; no production withdrawal ledger is created. */
  3. require dirname(__DIR__).'/vendor/autoload.php';
  4. \Dotenv\Dotenv::createUnsafeMutable(dirname(__DIR__))->load();
  5. \support\App::loadAllConfig(['route']);
  6. use plugin\saiadmin\app\model\water\WaterWithdrawalDemo;
  7. use Illuminate\Database\Schema\Blueprint;
  8. if (!in_array('--apply', $argv, true)) {
  9. echo "Plan: create sa_water_withdrawal_demo for labelled display-only fixtures.\n";
  10. exit;
  11. }
  12. $model = new WaterWithdrawalDemo();
  13. $schema = $model->getConnection()->getSchemaBuilder();
  14. if (!$schema->hasTable($model->getTable())) {
  15. $schema->create($model->getTable(), function (Blueprint $table) {
  16. $table->bigIncrements('id');
  17. $table->string('batch', 80)->index();
  18. $table->string('reference', 100)->unique();
  19. $table->string('applicant_name', 100);
  20. $table->string('kind_label', 40);
  21. $table->string('channel_label', 40);
  22. $table->unsignedBigInteger('amount_cents');
  23. $table->string('status', 20)->default('pending');
  24. $table->dateTime('created_at')->index();
  25. $table->comment('仅供展示的提现测试申请,不代表真实余额或打款指令');
  26. });
  27. }
  28. echo "Applied: isolated withdrawal demo table ready; no real finance data changed.\n";