Skip to content

Commit 7c8c9f8

Browse files
committed
Profile: correct contact_number_verified default
1 parent f7265cf commit 7c8c9f8

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

app/HMS/Mappings/HMS.Entities.Profile.dcm.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ HMS\Entities\Profile:
6060
nullable: true
6161
contactNumberVerified:
6262
type: boolean
63-
default: false
63+
nullable: false
64+
options:
65+
default: false
6466
dateOfBirth:
6567
type: date
6668
column: date_of_birth
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
namespace Database\Migrations;
4+
5+
use Doctrine\Migrations\AbstractMigration;
6+
use Doctrine\DBAL\Schema\Schema as Schema;
7+
8+
class Version20190708231036_alter_profile_contact_number_verified_default extends AbstractMigration
9+
{
10+
/**
11+
* @param Schema $schema
12+
*/
13+
public function up(Schema $schema)
14+
{
15+
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');
16+
17+
$this->addSql('ALTER TABLE profile CHANGE contact_number_verified contact_number_verified TINYINT(1) DEFAULT \'0\' NOT NULL');
18+
}
19+
20+
/**
21+
* @param Schema $schema
22+
*/
23+
public function down(Schema $schema)
24+
{
25+
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');
26+
27+
$this->addSql('ALTER TABLE profile CHANGE contact_number_verified contact_number_verified TINYINT(1) NOT NULL');
28+
}
29+
}

0 commit comments

Comments
 (0)