Skip to content

Commit

Permalink
fixed db bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Dopeamin committed Apr 20, 2021
1 parent 9aca7a6 commit f65387d
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration

###> symfony/framework-bundle ###
APP_ENV=dev
APP_ENV=prod
APP_SECRET=f1207b0d83b492679fab3da2f97ed5e9
###< symfony/framework-bundle ###

Expand Down
32 changes: 32 additions & 0 deletions migrations/Version20210420204427.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?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 Version20210420204427 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('DROP SEQUENCE user_id_seq CASCADE');
}

public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('CREATE SEQUENCE user_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/Entity/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Symfony\Component\Security\Core\Validator\Constraints as SecurityAssert;
/**
* @ORM\Entity(repositoryClass=UserRepository::class)
* @ORM\Table(name="users")
* @UniqueEntity("userName")
* @UniqueEntity("userEmail")
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Repository/OrdersRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function getByDate(\Datetime $startDate,\Datetime $endDate,Stade $stade)

$qb = $this->createQueryBuilder("e");
$qb
->andWhere('e.startDate < :to AND e.endDate > :from AND e.verified = 1 AND e.Stade = :stade ')
->andWhere('e.startDate < :to AND e.endDate > :from AND e.verified = true AND e.Stade = :stade ')
->setParameter('from', $startDate )
->setParameter('to', $endDate)
->setParameter('stade', $stade)
Expand Down

0 comments on commit f65387d

Please sign in to comment.