Fix timestamp bugs for collaborations and rewards
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
<?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 Version20251007115926 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Timestamps. Add create and update timestamps to Project Collaborations and Rewards.';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql(<<<'SQL'
|
||||
ALTER TABLE project_collaboration ADD date_created DATETIME NOT NULL, ADD date_updated DATETIME NOT NULL
|
||||
SQL);
|
||||
$this->addSql(<<<'SQL'
|
||||
ALTER TABLE project_reward ADD date_created DATETIME NOT NULL, ADD date_updated DATETIME NOT NULL
|
||||
SQL);
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql(<<<'SQL'
|
||||
ALTER TABLE project_reward DROP date_created, DROP date_updated
|
||||
SQL);
|
||||
$this->addSql(<<<'SQL'
|
||||
ALTER TABLE project_collaboration DROP date_created, DROP date_updated
|
||||
SQL);
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,8 @@ use ApiPlatform\Doctrine\Orm\State\Options;
|
||||
use ApiPlatform\Metadata as API;
|
||||
use App\ApiResource\LocalizedApiResourceTrait;
|
||||
use App\ApiResource\MoneyWithConversion;
|
||||
use App\ApiResource\TimestampedCreationApiResource;
|
||||
use App\ApiResource\TimestampedUpdationApiResource;
|
||||
use App\Entity\Project\Reward;
|
||||
use App\State\ApiResourceStateProvider;
|
||||
use App\State\Project\RewardStateProcessor;
|
||||
@@ -29,6 +31,8 @@ use Symfony\Component\Validator\Constraints as Assert;
|
||||
class RewardApiResource
|
||||
{
|
||||
use LocalizedApiResourceTrait;
|
||||
use TimestampedCreationApiResource;
|
||||
use TimestampedUpdationApiResource;
|
||||
|
||||
#[API\ApiProperty(identifier: true, writable: false)]
|
||||
public int $id;
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Entity\Project;
|
||||
|
||||
use App\ApiResource\TimestampedCreationApiResource;
|
||||
use App\ApiResource\TimestampedUpdationApiResource;
|
||||
use App\Entity\Trait\LocalizedEntityTrait;
|
||||
use App\Entity\Trait\TimestampedCreationEntity;
|
||||
use App\Entity\Trait\TimestampedUpdationEntity;
|
||||
use App\Mapping\Provider\EntityMapProvider;
|
||||
use App\Repository\Project\CollaborationRepository;
|
||||
use AutoMapper\Attribute\MapProvider;
|
||||
@@ -18,8 +18,8 @@ use Gedmo\Mapping\Annotation as Gedmo;
|
||||
class Collaboration
|
||||
{
|
||||
use LocalizedEntityTrait;
|
||||
use TimestampedCreationApiResource;
|
||||
use TimestampedUpdationApiResource;
|
||||
use TimestampedCreationEntity;
|
||||
use TimestampedUpdationEntity;
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
|
||||
@@ -6,6 +6,8 @@ use App\Entity\EmbeddableMoney as Money;
|
||||
use App\Entity\Interface\LocalizedEntityInterface;
|
||||
use App\Entity\Trait\LocalizedEntityTrait;
|
||||
use App\Entity\Trait\MigratedEntity;
|
||||
use App\Entity\Trait\TimestampedCreationEntity;
|
||||
use App\Entity\Trait\TimestampedUpdationEntity;
|
||||
use App\Mapping\Provider\EntityMapProvider;
|
||||
use App\Repository\Project\RewardRepository;
|
||||
use AutoMapper\Attribute\MapProvider;
|
||||
@@ -25,6 +27,8 @@ class Reward implements LocalizedEntityInterface
|
||||
{
|
||||
use MigratedEntity;
|
||||
use LocalizedEntityTrait;
|
||||
use TimestampedCreationEntity;
|
||||
use TimestampedUpdationEntity;
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
|
||||
Reference in New Issue
Block a user