2709 search results for Doctrine

... /configuration/doctrine.html#doctrine-dbal-configuration for more information. Otherwise, migrations might be generated a bit differently and it might cause generating migration instructions diff continuously on every run. Also ...
... experience already :). Anyways, here is a good README: https://github.com/knpuniversity/doctrine-queries/blob/master/README.md. You don't think you'll need to do the Doctrine database steps - so you can skip those (but ...
weaverryan
weaverryan
Read Full Comment
... non-ASCII characters, you'll need to build the Content-Disposition header manually, but then it also may not work in all browsers :/. If you want to remove the characters, https://github.com/doctrine/inflector/blob ...
weaverryan
weaverryan
Read Full Comment
... before MySql, so I would like to know if it's possibile to use PostgreSql with Symfony/Docrine. Symfony doesn't care about which DB engine you use, but Doctrine does. I'm not sure if Doctrine supports Postgres but you ...
MolloKhan
MolloKhan
Read Full Comment
... password: YES). This is my configuration file for doctrine. app/config/packages/doctrine.yml: ` parameters: database_host: localhost database_name: article_data database_user: root database_password ...
O.S.C.A.R
O.S.C.A.R
Read Full Comment
Hey Tomasz N.! So... this is likely a bug in the MsSQL driver inside Doctrine. I don't know for sure, but I had a Doctrine guy look at this, and, at first glance, what you're trying to do seems reasonable and we don't ...
weaverryan
weaverryan
Read Full Comment
... something up recently, which caused maker bundle to be set at an earlier version. I've just fixed that. About the doctrine/migrations issue, you have the correct fix (thanks for sharing). We'll be adding a note or fix ...
weaverryan
weaverryan
Read Full Comment
... [Doctrine\DBAL\Exception\ConnectionException] An exception occured in driver: SQLSTATE[HY000] [2002] Connection refused
... Doctrine is probably trying to convert an array (that was set on an entity by Alice) into a string while saving. I would remove the alice lines one-by-one until this error goes away (like you were doing). When you ...
weaverryan
weaverryan
Read Full Comment
... I've been fiddling around with something that I can't quite get my head around to work with Doctrine. Simply put I have filters, accounts and transactions. I try to filter a transaction into the right category but to do ...
Mark Ernst
Mark Ernst
Read Full Comment
... inverse sides", you always have an owning and an inverse sides, we explain it here: https://symfonycasts.com/screencast/doctrine-relations/many-to-many#owning-versus-inverse-sides . So basically, because of Tag entity is ...
... /screencast/doctrine-queries/filters#passing-values-to-configuring-a-filter - if you don't call setParameter() in the listener, then you'll get the error "Parameter 'discontinued' does not exist." If you do not get this error ...
weaverryan
weaverryan
Read Full Comment
... expression/criteria stuff (example http://stackoverflow.com/questions/5349790/how-do-i-use-a-complex-criteria-inside-a-doctrine-2-entitys-repository#answer-16105183), I'll just put what I need inside of an andWhere ...
weaverryan
weaverryan
Read Full Comment
... ALL entities that do not have slug, generate a new slug (but most probably you just need to update the updatedAt field to those entities so Doctrine will think that those entities are changed and called the listener on ...
... passed to the constructor of Doctrine Connection object: http://doctrine-dbal.readthedocs.org/en/latest/reference/configuration.html. So, if you're a bit brave, you might be able to debug it there. Also, in config.yml, here ...
weaverryan
weaverryan
Read Full Comment
36 lines | migrations/Version20210902132832.php
// ... lines 1 - 2
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 Version20210902132832 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 answer ADD question_id INT NOT NULL');
$this->addSql('ALTER TABLE answer ADD CONSTRAINT FK_9474526C1E27F6BF FOREIGN KEY (question_id) REFERENCES question (id)');
$this->addSql('CREATE INDEX IDX_9474526C1E27F6BF ON answer (question_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE answer DROP FOREIGN KEY FK_9474526C1E27F6BF');
$this->addSql('DROP INDEX IDX_9474526C1E27F6BF ON answer');
$this->addSql('ALTER TABLE answer DROP question_id');
}
}
See Code Block in Script
32 lines | migrations/Version20210902130926.php
// ... lines 1 - 2
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 Version20210902130926 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('CREATE TABLE answer (id INT AUTO_INCREMENT NOT NULL, content LONGTEXT NOT NULL, username VARCHAR(255) NOT NULL, votes INT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE answer');
}
}
See Code Block in Script
29 lines | src/Migrations/Version20180501142420.php
// ... lines 1 - 2
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20180501142420 extends AbstractMigration
{
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('CREATE TABLE tag (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, slug VARCHAR(180) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, UNIQUE INDEX UNIQ_389B783989D9B62 (slug), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('DROP TABLE tag');
}
}
See Code Block in Script
33 lines | src/Migrations/Version20180901184346.php
// ... lines 1 - 2
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20180901184346 extends AbstractMigration
{
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE article ADD author_id INT NOT NULL');
$this->addSql('ALTER TABLE article ADD CONSTRAINT FK_23A0E66F675F31B FOREIGN KEY (author_id) REFERENCES user (id)');
$this->addSql('CREATE INDEX IDX_23A0E66F675F31B ON article (author_id)');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE article DROP FOREIGN KEY FK_23A0E66F675F31B');
$this->addSql('DROP INDEX IDX_23A0E66F675F31B ON article');
$this->addSql('ALTER TABLE article DROP author_id');
}
}
See Code Block in Script
33 lines | src/Migrations/Version20180901184346.php
// ... lines 1 - 2
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20180901184346 extends AbstractMigration
{
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE article ADD author_id INT NOT NULL');
$this->addSql('ALTER TABLE article ADD CONSTRAINT FK_23A0E66F675F31B FOREIGN KEY (author_id) REFERENCES user (id)');
$this->addSql('CREATE INDEX IDX_23A0E66F675F31B ON article (author_id)');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE article DROP FOREIGN KEY FK_23A0E66F675F31B');
$this->addSql('DROP INDEX IDX_23A0E66F675F31B ON article');
$this->addSql('ALTER TABLE article DROP author_id');
}
}
See Code Block in Script