Skip to content

Commit

Permalink
Merge pull request #6229 from sai-gillingham/hotfix/merge_oss_43_fix
Browse files Browse the repository at this point in the history
dbalの3バージョンから削除されたfetchColumn関数をfetchOneに更新。
  • Loading branch information
dotani1111 authored Jun 24, 2024
2 parents 3948ddf + 9b0786c commit 2791d1f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions app/DoctrineMigrations/Version20210216120000.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ final class Version20210216120000 extends AbstractMigration
public function up(Schema $schema): void
{
// データ存在チェック
$count = $this->connection->fetchColumn("SELECT COUNT(*) FROM dtb_block WHERE block_name = 'Googleアナリティクス'");
$count = $this->connection->fetchOne("SELECT COUNT(*) FROM dtb_block WHERE block_name = 'Googleアナリティクス'");
if ($count > 0) {
return;
}

// idを取得する
$id = $this->connection->fetchColumn('SELECT MAX(id) FROM dtb_block');
$id = $this->connection->fetchOne('SELECT MAX(id) FROM dtb_block');
$id++;

$this->addSql("INSERT INTO dtb_block (id, block_name, file_name, use_controller, deletable, create_date, update_date, device_type_id, discriminator_type) VALUES ($id, 'Googleアナリティクス', 'google_analytics', false, false, '2021-02-16 12:00:00', '2021-02-16 12:00:00', 10, 'block')");
Expand Down
18 changes: 9 additions & 9 deletions app/DoctrineMigrations/Version20220603074035.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,55 +14,55 @@ public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs

$statusExists = $this->connection->fetchColumn(
$statusExists = $this->connection->fetchOne(
'SELECT COUNT(*) FROM mtb_csv_type WHERE id = 6'
);
if ($statusExists == 0) {
$this->addSql("INSERT INTO mtb_csv_type ('id', 'name', 'sort_no', 'discriminator_type') VALUES (6, 'Class NameCSV', 6, 'csvtype');");
}
$statusExists = $this->connection->fetchColumn(
$statusExists = $this->connection->fetchOne(
'SELECT COUNT(*) FROM mtb_csv_type WHERE id = 7'
);
if ($statusExists == 0) {
$this->addSql("INSERT INTO mtb_csv_type ('id', 'name', 'sort_no', 'discriminator_type') VALUES (7, 'Class Category CSV', 7, 'csvtype');");
}
$statusExists = $this->connection->fetchColumn(
$statusExists = $this->connection->fetchOne(
'SELECT COUNT(*) FROM dtb_csv WHERE id = 206'
);
if ($statusExists == 0) {
$this->addSql("INSERT INTO dtb_csv ('id','csv_type_id','creator_id','entity_name','field_name','reference_field_name','disp_name','sort_no','enabled','create_date','update_date','discriminator_type') VALUES ('206','6',,'Eccube\\Entity\\ClassName','id',,'規格ID','1','1','2021-05-18 01:26:41','2021-05-18 01:26:41','csv');");
}
$statusExists = $this->connection->fetchColumn(
$statusExists = $this->connection->fetchOne(
'SELECT COUNT(*) FROM dtb_csv WHERE id = 207'
);
if ($statusExists == 0) {
$this->addSql("INSERT INTO dtb_csv ('id','csv_type_id','creator_id','entity_name','field_name','reference_field_name','disp_name','sort_no','enabled','create_date','update_date','discriminator_type') VALUES ('207','6',,'Eccube\\Entity\\ClassName','name',,'規格名','2','1','2021-05-18 01:26:41','2021-05-18 01:26:41','csv');");
}
$statusExists = $this->connection->fetchColumn(
$statusExists = $this->connection->fetchOne(
'SELECT COUNT(*) FROM dtb_csv WHERE id = 208'
);
if ($statusExists == 0) {
$this->addSql("INSERT INTO dtb_csv ('id','csv_type_id','creator_id','entity_name','field_name','reference_field_name','disp_name','sort_no','enabled','create_date','update_date','discriminator_type') VALUES ('208','6',,'Eccube\\Entity\\ClassName','backend_name',,'管理名','3','1','2021-05-18 01:26:41','2021-05-18 01:26:41','csv');");
}
$statusExists = $this->connection->fetchColumn(
$statusExists = $this->connection->fetchOne(
'SELECT COUNT(*) FROM dtb_csv WHERE id = 209'
);
if ($statusExists == 0) {
$this->addSql("INSERT INTO dtb_csv ('id','csv_type_id','creator_id','entity_name','field_name','reference_field_name','disp_name','sort_no','enabled','create_date','update_date','discriminator_type') VALUES ('209','7',,'Eccube\\Entity\\ClassCategory','id',,'規格分類ID','1','1','2021-05-18 01:26:41','2021-05-18 01:26:41','csv');");
}
$statusExists = $this->connection->fetchColumn(
$statusExists = $this->connection->fetchOne(
'SELECT COUNT(*) FROM dtb_csv WHERE id = 210'
);
if ($statusExists == 0) {
$this->addSql("INSERT INTO dtb_csv ('id','csv_type_id','creator_id','entity_name','field_name','reference_field_name','disp_name','sort_no','enabled','create_date','update_date','discriminator_type') VALUES ('210','7',,'Eccube\\Entity\\ClassCategory','ClassName','id','規格ID','2','1','2021-05-18 01:26:41','2021-05-18 01:26:41','csv');");
}
$statusExists = $this->connection->fetchColumn(
$statusExists = $this->connection->fetchOne(
'SELECT COUNT(*) FROM dtb_csv WHERE id = 211'
);
if ($statusExists == 0) {
$this->addSql("INSERT INTO dtb_csv ('id','csv_type_id','creator_id','entity_name','field_name','reference_field_name','disp_name','sort_no','enabled','create_date','update_date','discriminator_type') VALUES ('211','7',,'Eccube\\Entity\\ClassCategory','name',,'規格分類名','3','1','2021-05-18 01:26:41','2021-05-18 01:26:41','csv');");
}
$statusExists = $this->connection->fetchColumn(
$statusExists = $this->connection->fetchOne(
'SELECT COUNT(*) FROM dtb_csv WHERE id = 212'
);
if ($statusExists == 0) {
Expand Down

0 comments on commit 2791d1f

Please sign in to comment.