mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-05 19:38:27 +01:00
Generate expected schemata for Calendar
Summary: Ref T1191. - There was a varchar(50) column. I changed it to `text64`, since this length is unusual. - There was an int(3) column. I changed it to `int32`, since this length is unusual. Test Plan: Ran migrations, saw warnings disappear from config tool. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T1191 Differential Revision: https://secure.phabricator.com/D10524
This commit is contained in:
parent
a42e4a867e
commit
6bfe8b5984
7 changed files with 34 additions and 0 deletions
|
@ -0,0 +1,2 @@
|
|||
ALTER TABLE {$NAMESPACE}_calendar.calendar_event
|
||||
CHANGE status status INT UNSIGNED NOT NULL;
|
2
resources/sql/autopatches/20140919.schema.02.calname.sql
Normal file
2
resources/sql/autopatches/20140919.schema.02.calname.sql
Normal file
|
@ -0,0 +1,2 @@
|
|||
ALTER TABLE {$NAMESPACE}_calendar.calendar_holiday
|
||||
CHANGE name name VARCHAR(64) NOT NULL COLLATE utf8_general_ci;
|
|
@ -1300,6 +1300,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorCalendarEventViewController' => 'applications/calendar/controller/PhabricatorCalendarEventViewController.php',
|
||||
'PhabricatorCalendarHoliday' => 'applications/calendar/storage/PhabricatorCalendarHoliday.php',
|
||||
'PhabricatorCalendarHolidayTestCase' => 'applications/calendar/storage/__tests__/PhabricatorCalendarHolidayTestCase.php',
|
||||
'PhabricatorCalendarSchemaSpec' => 'applications/calendar/storage/PhabricatorCalendarSchemaSpec.php',
|
||||
'PhabricatorCalendarViewController' => 'applications/calendar/controller/PhabricatorCalendarViewController.php',
|
||||
'PhabricatorCampfireProtocolAdapter' => 'infrastructure/daemon/bot/adapter/PhabricatorCampfireProtocolAdapter.php',
|
||||
'PhabricatorChangeParserTestCase' => 'applications/repository/worker/__tests__/PhabricatorChangeParserTestCase.php',
|
||||
|
@ -4208,6 +4209,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorCalendarEventViewController' => 'PhabricatorCalendarController',
|
||||
'PhabricatorCalendarHoliday' => 'PhabricatorCalendarDAO',
|
||||
'PhabricatorCalendarHolidayTestCase' => 'PhabricatorTestCase',
|
||||
'PhabricatorCalendarSchemaSpec' => 'PhabricatorConfigSchemaSpec',
|
||||
'PhabricatorCalendarViewController' => 'PhabricatorCalendarController',
|
||||
'PhabricatorCampfireProtocolAdapter' => 'PhabricatorBotBaseStreamingProtocolAdapter',
|
||||
'PhabricatorChangeParserTestCase' => 'PhabricatorWorkingCopyTestCase',
|
||||
|
|
|
@ -37,6 +37,12 @@ final class PhabricatorCalendarEvent
|
|||
public function getConfiguration() {
|
||||
return array(
|
||||
self::CONFIG_AUX_PHID => true,
|
||||
self::CONFIG_COLUMN_SCHEMA => array(
|
||||
'dateFrom' => 'epoch',
|
||||
'dateTo' => 'epoch',
|
||||
'status' => 'uint32',
|
||||
'description' => 'text',
|
||||
),
|
||||
) + parent::getConfiguration();
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,15 @@ final class PhabricatorCalendarHoliday extends PhabricatorCalendarDAO {
|
|||
public function getConfiguration() {
|
||||
return array(
|
||||
self::CONFIG_TIMESTAMPS => false,
|
||||
self::CONFIG_COLUMN_SCHEMA => array(
|
||||
'day' => 'date',
|
||||
'name' => 'text64',
|
||||
),
|
||||
self::CONFIG_KEY_SCHEMA => array(
|
||||
'day' => array(
|
||||
'columns' => array('day'),
|
||||
),
|
||||
),
|
||||
) + parent::getConfiguration();
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorCalendarSchemaSpec
|
||||
extends PhabricatorConfigSchemaSpec {
|
||||
|
||||
public function buildSchemata() {
|
||||
$this->buildLiskSchemata('PhabricatorCalendarDAO');
|
||||
}
|
||||
|
||||
}
|
|
@ -292,6 +292,9 @@ abstract class PhabricatorConfigSchemaSpec extends Phobject {
|
|||
case 'double':
|
||||
$column_type = 'double';
|
||||
break;
|
||||
case 'date':
|
||||
$column_type = 'date';
|
||||
break;
|
||||
default:
|
||||
$column_type = pht('<unknown>');
|
||||
$charset = pht('<unknown>');
|
||||
|
|
Loading…
Add table
Reference in a new issue