-
Notifications
You must be signed in to change notification settings - Fork 660
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4804 from k-yamamura/feature-customercsv
会員CSVダウンロード項目にポイントを追加
- Loading branch information
Showing
3 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace DoctrineMigrations; | ||
|
||
use Doctrine\DBAL\Schema\Schema; | ||
use Doctrine\Migrations\AbstractMigration; | ||
|
||
/** | ||
* Auto-generated Migration: Please modify to your needs! | ||
*/ | ||
final class Version20201218044542 extends AbstractMigration | ||
{ | ||
public function up(Schema $schema) : void | ||
{ | ||
$pointExists = $this->connection->fetchColumn("SELECT COUNT(*) FROM dtb_csv WHERE csv_type_id = 2 AND field_name = 'point'"); | ||
|
||
if ($pointExists == 0) { | ||
$sortNo = $this->connection->fetchColumn('SELECT MAX(sort_no) + 1 FROM dtb_csv WHERE csv_type_id = 2'); | ||
$this->addSql("INSERT INTO dtb_csv ( | ||
csv_type_id, creator_id, entity_name, field_name, disp_name, sort_no, enabled, create_date, update_date, discriminator_type | ||
) VALUES ( | ||
2, null, ?, 'point', 'ポイント', $sortNo, false, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'csv' | ||
)", | ||
['Eccube\\\\Entity\\\\Customer']); | ||
} | ||
} | ||
|
||
public function down(Schema $schema) : void | ||
{ | ||
// this down() migration is auto-generated, please modify it to your needs | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters