Skip to content

Commit

Permalink
make ref_id nullable
Browse files Browse the repository at this point in the history
Hi,

According to the error and PoolPort source and the mentioned function, ref_id should be nullable :

Error:
    SQLSTATE[HY000]: General error: 1364 Field 'ref_id' doesn't have a default value (SQL: insert into `gateway_transactions` (`id`, `port`, `price`, `status`, `ip`, `created_at`, `updated_at`) values (1477224769, MELLAT, 1000, INIT, 192.168.10.1, 2016-10-23 15:42:50, 2016-10-23 15:42:50))

Insert function :
    protected function newTransaction()
	{
		$uid = $this->getTimeId();
		$this->transactionId = $this->getTable()->insert([
			'id' => $uid,
			'port' => $this->getPortName(),
			'price' => $this->amount,
			'status' => Enum::TRANSACTION_INIT,
			'ip' => Request::getClientIp(),
			'created_at' => Carbon::now(),
			'updated_at' => Carbon::now(),
		]) ? $uid : null;

		return $this->transactionId;
	}

poolport source includes this line : 

    `ref_id` varchar(255) COLLATE utf8_persian_ci DEFAULT NULL,
  • Loading branch information
Ram-yar authored Oct 23, 2016
1 parent c329925 commit 380af27
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function up()
Enum::ZARINPAL,
]);
$table->decimal('price', 15, 2);
$table->string('ref_id', 100);
$table->string('ref_id', 100)->nullable();
$table->string('tracking_code', 50)->nullable();
$table->string('card_number', 50)->nullable();
$table->enum('status', [
Expand Down

0 comments on commit 380af27

Please sign in to comment.