Skip to content

Commit e7c755a

Browse files
authored
Merge pull request #12 from maximehuran/feature/columns-name
2 parents 6860808 + 081323a commit e7c755a

File tree

3 files changed

+48
-6
lines changed

3 files changed

+48
-6
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
3+
/*
4+
* This file is part of Monsieur Biz' Blog plugin for Sylius.
5+
*
6+
* (c) Monsieur Biz <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE.txt
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace MonsieurBiz\SyliusBlogPlugin\Migrations;
15+
16+
use Doctrine\DBAL\Schema\Schema;
17+
use Doctrine\Migrations\AbstractMigration;
18+
19+
/**
20+
* Auto-generated Migration: Please modify to your needs!
21+
*/
22+
final class Version20250818200725 extends AbstractMigration
23+
{
24+
public function getDescription(): string
25+
{
26+
return '';
27+
}
28+
29+
public function up(Schema $schema): void
30+
{
31+
// this up() migration is auto-generated, please modify it to your needs
32+
$this->addSql('ALTER TABLE monsieurbiz_blog_article CHANGE thumbnailImage thumbnail_image VARCHAR(255) DEFAULT NULL, CHANGE publishedAt published_at DATETIME DEFAULT NULL');
33+
$this->addSql('ALTER TABLE monsieurbiz_blog_article_translation CHANGE metaTitle meta_title VARCHAR(255) DEFAULT NULL, CHANGE metaKeywords meta_keywords VARCHAR(255) DEFAULT NULL, CHANGE metaImage meta_image VARCHAR(255) DEFAULT NULL, CHANGE metaDescription meta_description LONGTEXT DEFAULT NULL');
34+
}
35+
36+
public function down(Schema $schema): void
37+
{
38+
// this down() migration is auto-generated, please modify it to your needs
39+
$this->addSql('ALTER TABLE monsieurbiz_blog_article CHANGE published_at publishedAt DATETIME DEFAULT NULL, CHANGE thumbnail_image thumbnailImage VARCHAR(255) DEFAULT NULL');
40+
$this->addSql('ALTER TABLE monsieurbiz_blog_article_translation CHANGE meta_title metaTitle VARCHAR(255) DEFAULT NULL, CHANGE meta_keywords metaKeywords VARCHAR(255) DEFAULT NULL, CHANGE meta_image metaImage VARCHAR(255) DEFAULT NULL, CHANGE meta_description metaDescription LONGTEXT DEFAULT NULL');
41+
}
42+
}

src/Resources/config/doctrine/Article.orm.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020

2121
<field name="video" nullable="true" />
2222

23-
<field name="thumbnailImage" nullable="true" />
23+
<field name="thumbnailImage" column="thumbnail_image" nullable="true" />
2424

2525
<field name="type" />
2626

2727
<field name="state" />
2828

29-
<field name="publishedAt" type="datetime" nullable="true" />
29+
<field name="publishedAt" column="published_at" type="datetime" nullable="true" />
3030

3131
<field name="createdAt" column="created_at" type="datetime_immutable">
3232
<gedmo:timestampable on="create"/>

src/Resources/config/doctrine/ArticleTranslation.orm.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
<field name="description" type="text" />
1616
<field name="content" type="text"/>
1717

18-
<field name="metaTitle" nullable="true"/>
19-
<field name="metaDescription" type="text" nullable="true"/>
20-
<field name="metaKeywords" nullable="true"/>
21-
<field name="metaImage" nullable="true" />
18+
<field name="metaTitle" column="meta_title" nullable="true"/>
19+
<field name="metaDescription" column="meta_description" type="text" nullable="true"/>
20+
<field name="metaKeywords" column="meta_keywords" nullable="true"/>
21+
<field name="metaImage" column="meta_image" nullable="true" />
2222

2323
<field name="createdAt" column="created_at" type="datetime_immutable">
2424
<gedmo:timestampable on="create"/>

0 commit comments

Comments
 (0)