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

Rename meta columns in page translation from camel case to snake case #67

Merged
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
59 changes: 15 additions & 44 deletions .github/workflows/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,57 +9,38 @@ jobs:

recipe:

runs-on: ubuntu-latest
name: Flex recipe (PHP ${{ matrix.php }}, Sylius ${{ matrix.sylius }})

env:
SYMFONY_ENDPOINT: http://127.0.0.1/
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php: ['7.4', '8.0', '8.1']
sylius: ['~1.8.0', '~1.9.0', '~1.10.0', '~1.11.0', '~1.12.0']
php: ['8.0', '8.1', '8.2']
sylius: ['~1.11.0', '~1.12.0']
include:
- php: '8.1'
sylius: '~1.12.0'
sylius_paypal: '~1.5.0'
exclude:
- php: '8.0'
sylius: '~1.8.0'
- php: '8.0'
sylius: '~1.9.0'
- php: '8.1'
sylius: '~1.8.0'
- php: '8.1'
sylius: '~1.9.0'
- php: '7.4'
sylius: '~1.11.0'
- php: '7.4'
- php: '8.2'
sylius: '~1.12.0'
sylius_paypal: '~1.5.0'

steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: gd, intl, json
ini-values: date.timezone=UTC

- name: Set project php-version
run: |
echo ${{ matrix.php }} > .php-version
echo "${{ matrix.php }}" > .php-version

- uses: actions/checkout@v3
with:
path: plugin

# Run the server at the start so it can download the recipes!
- name: Run standalone symfony flex server
run: |
echo ${{ github.token }} | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
docker run --rm --name flex -d -v $PWD/plugin/recipes:/var/www/flex/var/repo/private/monsieurbiz/sylius-cms-page-plugin -p 80:80 docker.pkg.github.com/monsieurbiz/docker/symfony-flex-server:latest contrib official
docker ps

- run: mkdir -p /home/runner/{.composer/cache,.config/composer}

- uses: actions/cache@v3
Expand All @@ -69,9 +50,6 @@ jobs:
key: composer2-php:${{ matrix.php }}-sylius:${{ matrix.sylius }}-${{ github.sha }}
restore-keys: composer2-php:${{ matrix.php }}-sylius:${{ matrix.sylius }}-

- name: Update composer
run: sudo composer self-update

- name: Composer Github Auth
run: composer config -g github-oauth.github.com ${{ github.token }}

Expand All @@ -84,7 +62,7 @@ jobs:
working-directory: ./sylius
run: |
composer require --no-install --no-scripts --no-progress sylius/sylius="${{ matrix.sylius }}"

# Fix Paypal 1.5 on Sylius 1.12 and PHP 8.1
- name: Make sure to install the required version of Sylius Paypal Plugin
if: ${{ matrix.sylius_paypal }}
Expand All @@ -96,20 +74,13 @@ jobs:
working-directory: ./sylius
run: |
composer config --no-plugins allow-plugins true
composer config repositories.plugin '{"type": "path", "url": "../plugin/"}'
composer config extra.symfony.allow-contrib true
composer config secure-http false
composer config --unset platform.php

- name: Require plugin without install
working-directory: ./sylius
run: |
composer require --no-install --no-scripts monsieurbiz/sylius-cms-page-plugin="*@dev"
composer config --no-plugins extra.symfony.allow-contrib true
composer config --no-plugins secure-http false
composer config --no-plugins --unset platform.php
composer config --no-plugins extra.symfony.docker false
composer config --no-plugins --json extra.symfony.endpoint '["https://api.github.com/repos/monsieurbiz/symfony-recipes/contents/index.json?ref=flex/master","flex://defaults"]'

- name: Composer install
- name: Require plugin & install all dependencies
working-directory: ./sylius
run: |
composer install

- name: Show flex server logs
run: docker logs --tail 100 flex
composer require monsieurbiz/sylius-cms-page-plugin="*@dev"
10 changes: 4 additions & 6 deletions .github/workflows/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ jobs:

security:

name: Security check (PHP ${{ matrix.php }})

runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php: ['7.4', '8.0', '8.1']
php: ['8.0', '8.1', '8.2']

steps:
- uses: actions/checkout@v3
Expand All @@ -23,11 +25,10 @@ jobs:
with:
php-version: ${{ matrix.php }}
extensions: gd, intl, json
ini-values: date.timezone=UTC

- name: Set project php-version
run: |
echo ${{ matrix.php }} > .php-version
echo "${{ matrix.php }}" > .php-version

- uses: actions/cache@v3
id: cache-composer
Expand All @@ -38,9 +39,6 @@ jobs:

- run: mkdir -p /home/runner/{.composer/cache,.config/composer}

- name: Update composer
run: sudo composer self-update

- name: Composer Github Auth
run: composer config -g github-oauth.github.com ${{ github.token }}

Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ jobs:

php:

name: Quality tests (PHP ${{ matrix.php }})

runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php: ['8.0', '8.1']
php: ['8.0', '8.1', '8.2']

env:
SYMFONY_ARGS: --no-tls
Expand All @@ -23,21 +25,19 @@ jobs:

steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '16'

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: gd, intl, json
ini-values: date.timezone=UTC

- name: Set project php-version
run: |
echo ${{ matrix.php }} > .php-version
echo "${{ matrix.php }}" > .php-version

- name: Install symfony CLI
run: |
Expand All @@ -53,9 +53,6 @@ jobs:

- run: mkdir -p /home/runner/{.composer/cache,.config/composer}

- name: Update composer
run: sudo composer self-update

- name: Composer Github Auth
run: composer config -g github-oauth.github.com ${{ github.token }}

Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ SYMFONY=cd ${APP_DIR} && symfony
COMPOSER=symfony composer
CONSOLE=${SYMFONY} console
export COMPOSE_PROJECT_NAME=cms-page
export MIGRATIONS_NAMESPACE=MonsieurBiz\\SyliusCmsPagePlugin\\Migrations
export USER_UID=$(shell id -u)
PLUGIN_NAME=sylius-${COMPOSE_PROJECT_NAME}-plugin
COMPOSE=docker-compose
Expand Down Expand Up @@ -138,7 +139,7 @@ test.container: ## Lint the symfony container
${CONSOLE} lint:container

test.yaml: ## Lint the symfony Yaml files
${CONSOLE} lint:yaml ../../recipes ../../src/Resources/config
${CONSOLE} lint:yaml ../../src/Resources/config

test.schema: ## Validate MySQL Schema
${CONSOLE} doctrine:schema:validate
Expand Down Expand Up @@ -169,6 +170,9 @@ sylius.assets: ## Install all assets with symlinks
messenger.setup: ## Setup Messenger transports
${CONSOLE} messenger:setup-transports

doctrine.diff: ## Doctrine diff
${CONSOLE} doctrine:migration:diff --namespace="${MIGRATIONS_NAMESPACE}"

###
### PLATFORM
### ¯¯¯¯¯¯¯¯
Expand Down
7 changes: 7 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@
"phpspec": "phpspec run"
},
"extra": {
"symfony": {
"docker": false,
"endpoint": [
"https://api.github.com/repos/monsieurbiz/symfony-recipes/contents/index.json?ref=flex/master",
"flex://defaults"
]
},
"branch-alias": {
"dev-master": "1.0-dev"
}
Expand Down

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions recipes/1.0-dev/manifest.json

This file was deleted.

40 changes: 40 additions & 0 deletions src/Migrations/Version20240613100143.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

/*
* This file is part of Monsieur Biz' Cms Page plugin for Sylius.
*
* (c) Monsieur Biz <sylius@monsieurbiz.com>
*
* For the full copyright and license information, please view the LICENSE.txt
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace MonsieurBiz\SyliusCmsPagePlugin\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20240613100143 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}

public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE monsieurbiz_cms_page_translation CHANGE metaTitle meta_title VARCHAR(255) DEFAULT NULL, CHANGE metaKeywords meta_keywords VARCHAR(255) DEFAULT NULL, CHANGE metaDescription meta_description LONGTEXT DEFAULT NULL');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE monsieurbiz_cms_page_translation CHANGE meta_title metaTitle VARCHAR(255) DEFAULT NULL, CHANGE meta_keywords metaKeywords VARCHAR(255) DEFAULT NULL, CHANGE meta_description metaDescription LONGTEXT DEFAULT NULL');
}
}
6 changes: 3 additions & 3 deletions src/Resources/config/doctrine/PageTranslation.orm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
<field name="title" length="255" nullable="true" />
<field name="content" type="text" nullable="true" />
<field name="slug" length="255" nullable="true" />
<field name="metaTitle" length="255" nullable="true" />
<field name="metaKeywords" length="255" nullable="true" />
<field name="metaDescription" type="text" nullable="true" />
<field name="metaTitle" column="meta_title" length="255" nullable="true" />
<field name="metaKeywords" column="meta_keywords" length="255" nullable="true" />
<field name="metaDescription" column="meta_description" type="text" nullable="true" />
</mapped-superclass>

</doctrine-mapping>
Loading