Skip to content

Commit

Permalink
swp_user_reset_password_request checks
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanJelicSF committed Feb 6, 2024
1 parent a603ede commit 331b65f
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public function up(Schema $schema): void
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');

$this->addSql('CREATE SEQUENCE swp_user_reset_password_request_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE TABLE swp_user_reset_password_request (
id INT NOT NULL,
$this->addSql('CREATE SEQUENCE IF NOT EXISTS swp_user_reset_password_request_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE TABLE IF NOT EXISTS swp_user_reset_password_request (
id INT NOT NULL,
user_id INT NOT NULL,
selector VARCHAR(20) NOT NULL,
hashed_token VARCHAR(100) NOT NULL,
Expand All @@ -32,9 +32,10 @@ public function up(Schema $schema): void
PRIMARY KEY(id)
)'
);
$this->addSql('CREATE INDEX IDX_53CA7BFAA76ED395 ON swp_user_reset_password_request (user_id)');
$this->addSql('CREATE INDEX IF NOT EXISTS IDX_53CA7BFAA76ED395 ON swp_user_reset_password_request (user_id)');
$this->addSql('COMMENT ON COLUMN swp_user_reset_password_request.requested_at IS \'(DC2Type:datetime_immutable)\'');
$this->addSql('COMMENT ON COLUMN swp_user_reset_password_request.expires_at IS \'(DC2Type:datetime_immutable)\'');
$this->addSql('ALTER TABLE swp_user_reset_password_request DROP CONSTRAINT IF EXISTS FK_53CA7BFAA76ED395');
$this->addSql('ALTER TABLE swp_user_reset_password_request ADD CONSTRAINT FK_53CA7BFAA76ED395 FOREIGN KEY (user_id) REFERENCES swp_user (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
}

Expand Down

0 comments on commit 331b65f

Please sign in to comment.