Commit 84becc3f authored by Hermann Mayer's avatar Hermann Mayer
Browse files

Added Doctrine Migration Bundle. Build first migration class to fit the production env.

parent 99ed7a09
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ class AppKernel extends Kernel
            new Presta\SitemapBundle\PrestaSitemapBundle(),
            new Jity\TagGeneratorBundle\JityTagGeneratorBundle(),
            new Nelmio\SolariumBundle\NelmioSolariumBundle(),
            new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
        );

        if (in_array($this->getEnvironment(), array('dev', 'test'))) {
+30 −0
Original line number Diff line number Diff line
<?php

namespace Application\Migrations;

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

/**
 * Auto-generated Migration: Please modify to your need!
 */
class Version20121126174815 extends AbstractMigration
{
    public function up(Schema $schema)
    {
        // this up() migration is autogenerated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");
        
        $this->addSql("ALTER TABLE comment ADD authorName VARCHAR(255) DEFAULT NULL, ADD authorEmail VARCHAR(255) DEFAULT NULL, ADD authorWebsite VARCHAR(255) DEFAULT NULL, ADD authorTwitterNickname VARCHAR(255) DEFAULT NULL");
        $this->addSql("ALTER TABLE category CHANGE name name VARCHAR(50) NOT NULL");
    }

    public function down(Schema $schema)
    {
        // this down() migration is autogenerated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");
        
        $this->addSql("ALTER TABLE category CHANGE name name VARCHAR(100) NOT NULL");
        $this->addSql("ALTER TABLE comment DROP authorName, DROP authorEmail, DROP authorWebsite, DROP authorTwitterNickname");
    }
}
+5.45 KiB (639 KiB)

File changed.

No diff preview for this file type.

+4 −8
Original line number Diff line number Diff line
@@ -13,12 +13,6 @@
    "autoload": {
        "psr-0": { "": "src/" }
    },
    "repositories": [
        {
            "type": "vcs",
            "url": "http://github.com/kostiklv/PrestaSitemapBundle"
        }
    ],
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.1.*",
@@ -41,11 +35,13 @@
        "stof/doctrine-extensions-bundle": "dev-master",
        "xi/breadcrumbs-bundle": "dev-master",
        "hwi/oauth-bundle": "dev-master",
        "mobiledetect/mobiledetectlib": "dev-master",
        "suncat/mobile-detect-bundle": "dev-master",
        "excelwebzone/recaptcha-bundle": "dev-master",
        "presta/sitemap-bundle": "dev-sitemap-dumper",
        "presta/sitemap-bundle": "dev-master",
        "jity/tag-generator": "dev-master",
        "nelmio/solarium-bundle": "1.0.x-dev"
        "nelmio/solarium-bundle": "1.0.x-dev",
        "doctrine/doctrine-migrations-bundle": "dev-master"
    },
    "scripts": {
        "post-install-cmd": [
+211 −104

File changed.

Preview size limit exceeded, changes collapsed.