<?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 Version20240116084813 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
$recordsToInsert = [
[
'name' => 'Premium Services',
'slug' => 'premium_services',
'template' => 'premium_services',
'class' => null,
'content' => 'Premium Services', // Your content here
'seo_title' => null,
'seo_meta_keyword' => null,
'seo_description' => null,
'is_active' => 1,
'deleted' => 1,
'created_at' => '2023-11-30 13:16:32',
'updated_at' => '2023-11-30 13:17:37',
'deleted_at' => null,
],
];
foreach ($recordsToInsert as $record) {
$slugExists = $this->connection->fetchAssociative(
'SELECT id FROM cms_pages WHERE slug = :slug',
['slug' => $record['slug']]
);
if ($slugExists === false) {
$this->addSql('INSERT INTO cms_pages (name, slug, template, class, content, seo_title, seo_meta_keyword, seo_description, is_active, deleted, created_at, updated_at, deleted_at) VALUES (:name, :slug, :template, :class, :content, :seo_title, :seo_meta_keyword, :seo_description, :is_active, :deleted, :created_at, :updated_at, :deleted_at)', $record);
}
}
}
public function down(Schema $schema): void
{
}
}