Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

会員CSVダウンロード項目にポイントを追加 #4804

Merged
merged 3 commits into from
Dec 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions app/DoctrineMigrations/Version20201218044542.php
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
}
}
1 change: 1 addition & 0 deletions src/Eccube/Resource/doctrine/import_csv/en/dtb_csv.csv
Original file line number Diff line number Diff line change
Expand Up @@ -203,3 +203,4 @@ id,csv_type_id,creator_id,entity_name,field_name,reference_field_name,disp_name,
202,5,,Eccube\\Entity\\Category,Parent,id,Parent Category ID,4,1,2017-03-07 10:14:00,2017-03-07 10:14:00,csv
203,5,,Eccube\\Entity\\Category,level,,Level,5,1,2017-03-07 10:14:00,2017-03-07 10:14:00,csv
204,1,,Eccube\\Entity\\ProductClass,TaxRule,tax_rate,Tax Rate,"31","0","2017-03-07 10:14:00","2017-03-07 10:14:00","csv"
205,2,,Eccube\\Entity\\Customer,point,,Point,32,1,2017-03-07 10:14:00,2017-03-07 10:14:00,csv
1 change: 1 addition & 0 deletions src/Eccube/Resource/doctrine/import_csv/ja/dtb_csv.csv
Original file line number Diff line number Diff line change
Expand Up @@ -203,3 +203,4 @@
"202","5",,"Eccube\\Entity\\Category","Parent","id","親カテゴリID","4","1","2017-03-07 10:14:00","2017-03-07 10:14:00","csv"
"203","5",,"Eccube\\Entity\\Category","level",,"階層","5","1","2017-03-07 10:14:00","2017-03-07 10:14:00","csv"
"204","1",,"Eccube\\Entity\\ProductClass","TaxRule","tax_rate","税率","31","0","2017-03-07 10:14:00","2017-03-07 10:14:00","csv"
"205","2",,"Eccube\\Entity\\Customer","point",,"ポイント","33","1","2017-03-07 10:14:00","2017-03-07 10:14:00","csv"