<?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 Version20240311074646 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$recordsToInsert = [
[
'name' => 'Ads On Gixli Application',
'slug' => 'ads_on_gixli_application',
'template' => 'ads_on_gixli_application',
'class' => null,
'content' => 'Ads On Gixli Application', // Your content here
'seo_title' => null,
'seo_meta_keyword' => null,
'seo_description' => null,
'is_active' => 1,
'deleted' => 1,
'created_at' => '2024-02-26 13:16:32',
'updated_at' => '2024-02-26 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
{
// this down() migration is auto-generated, please modify it to your needs
}
}