Skip to content

Commit

Permalink
fix migrations (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
algirdasc committed May 7, 2024
1 parent e965e43 commit a23ba6b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions backend/migrations/Version20240422103349.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public function up(Schema $schema): void
$this->addSql('DROP TABLE calendar_identification');
$this->addSql('DROP INDEX UNIQ_2D3A8DA6C3986294 ON expense');
$this->addSql('ALTER TABLE expense DROP statement_hash');
$this->addSql('ALTER TABLE user DROP roles');
}

public function down(Schema $schema): void
Expand All @@ -33,5 +34,6 @@ public function down(Schema $schema): void
$this->addSql('ALTER TABLE calendar_identification ADD CONSTRAINT FK_FB652D5DA40A2C8 FOREIGN KEY (calendar_id) REFERENCES calendar (id)');
$this->addSql('ALTER TABLE expense ADD statement_hash VARCHAR(255) DEFAULT NULL');
$this->addSql('CREATE UNIQUE INDEX UNIQ_2D3A8DA6C3986294 ON expense (statement_hash)');
$this->addSql('ALTER TABLE user ADD roles JSON NOT NULL');
}
}
2 changes: 1 addition & 1 deletion backend/src/Entity/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
/**
* @var Collection<Calendar>
*/
#[ORM\OneToMany(mappedBy: 'owner', targetEntity: Calendar::class)]
#[ORM\OneToMany(targetEntity: Calendar::class, mappedBy: 'owner')]
private Collection $calendars;

/**
Expand Down

0 comments on commit a23ba6b

Please sign in to comment.