Skip to content

Commit

Permalink
Profile: correct contact_number_verified default
Browse files Browse the repository at this point in the history
  • Loading branch information
dpslwk committed Jul 8, 2019
1 parent f7265cf commit 7c8c9f8
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/HMS/Mappings/HMS.Entities.Profile.dcm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ HMS\Entities\Profile:
nullable: true
contactNumberVerified:
type: boolean
default: false
nullable: false
options:
default: false
dateOfBirth:
type: date
column: date_of_birth
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace Database\Migrations;

use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema as Schema;

class Version20190708231036_alter_profile_contact_number_verified_default extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('ALTER TABLE profile CHANGE contact_number_verified contact_number_verified TINYINT(1) DEFAULT \'0\' NOT NULL');
}

/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('ALTER TABLE profile CHANGE contact_number_verified contact_number_verified TINYINT(1) NOT NULL');
}
}

0 comments on commit 7c8c9f8

Please sign in to comment.