<?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 Version20231130071813 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' => 'Login',
'slug' => 'login',
'template' => 'login',
'class' => null,
'content' => 'Login', // 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,
],
[
'name' => 'Home Owner Register',
'slug' => 'home-owner-register',
'template' => 'home-owner-register',
'class' => null,
'content' => 'Home Owner Register', // 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,
],
[
'name' => 'Education',
'slug' => 'education',
'template' => 'education',
'class' => null,
'content' => 'Education', // 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,
],
[
'name' => 'Directory Profile',
'slug' => 'directory_profile',
'template' => 'directory_profile',
'class' => null,
'content' => 'Directory Profile', // 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
{
$recordsToRemove = [
[
'name' => 'Login',
'slug' => 'login',
'template' => 'login',
'class' => null,
'content' => '<h1 style=\"box-sizing: border-box; margin: 0px 0px 28px; font-weight: 700; line-height: 64px; font-size: 57px; padding: 0px; width: 800px; color: rgb(0, 0, 0); font-family: GeorgiaBold; outline: none !important;\">Login</h1>\r\n\r\n<p><span style=\"box-sizing: border-box; display: block; margin-bottom: 32px; color: rgb(99, 115, 129); font-size: 22px; line-height: 32px; font-family: Roboto, sans-serif; outline: none !important;\">Effective Date: January 1, 2022.</span></p>\r\n\r\n<p style=\"box-sizing: border-box; margin: 0px 0px 32px; padding: 0px; width: 800px; color: rgb(99, 115, 129); font-size: 22px; line-height: 32px; font-family: Roboto, sans-serif; outline: none !important;\">Login</p>', // 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,
],
[
'name' => 'Register',
'slug' => 'register',
'template' => 'register',
'class' => null,
'content' => 'Register', // 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,
],
[
'name' => 'Education',
'slug' => 'education',
'template' => 'education',
'class' => null,
'content' => 'Education', // 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,
],
[
'name' => 'Directory Profile',
'slug' => 'directory_profile',
'template' => 'directory_profile',
'class' => null,
'content' => 'Directory Profile', // 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 ($recordsToRemove as $slug) {
$this->addSql('DELETE FROM cms_pages WHERE slug = :slug', ['slug' => $slug]);
}
}
}