Add NOT NULL constraint to custom field value field type
This commit is contained in:
@@ -200,7 +200,7 @@ class Migrator {
|
|||||||
'id int(11) unsigned NOT NULL AUTO_INCREMENT,',
|
'id int(11) unsigned NOT NULL AUTO_INCREMENT,',
|
||||||
'subscriber_id int(11) unsigned NOT NULL,',
|
'subscriber_id int(11) unsigned NOT NULL,',
|
||||||
'custom_field_id int(11) unsigned NOT NULL,',
|
'custom_field_id int(11) unsigned NOT NULL,',
|
||||||
'value text,',
|
'value text NOT NULL,',
|
||||||
'created_at TIMESTAMP NULL,',
|
'created_at TIMESTAMP NULL,',
|
||||||
'updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,',
|
'updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,',
|
||||||
'PRIMARY KEY (id),',
|
'PRIMARY KEY (id),',
|
||||||
|
@@ -827,6 +827,7 @@ class SubscriberTest extends \MailPoetTest {
|
|||||||
$subscriber_custom_field->subscriber_id = ($custom_field !== 5) ?
|
$subscriber_custom_field->subscriber_id = ($custom_field !== 5) ?
|
||||||
$subscriber->id :
|
$subscriber->id :
|
||||||
100; // create one record with a nonexistent subscriber id
|
100; // create one record with a nonexistent subscriber id
|
||||||
|
$subscriber_custom_field->value = 'somevalue';
|
||||||
$subscriber_custom_field->save();
|
$subscriber_custom_field->save();
|
||||||
}
|
}
|
||||||
expect(SubscriberCustomField::findMany())->count(5);
|
expect(SubscriberCustomField::findMany())->count(5);
|
||||||
@@ -1170,4 +1171,4 @@ class SubscriberTest extends \MailPoetTest {
|
|||||||
\ORM::raw_execute('TRUNCATE ' . SendingQueue::$_table);
|
\ORM::raw_execute('TRUNCATE ' . SendingQueue::$_table);
|
||||||
\ORM::raw_execute('TRUNCATE ' . Setting::$_table);
|
\ORM::raw_execute('TRUNCATE ' . Setting::$_table);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user