Skip to content

Commit a481720

Browse files
committed
Issue #3016011 by mikelutz, quietone, alexpott: Reroll all migrate dump files
(cherry picked from commit 2b511ec)
1 parent 82b22da commit a481720

File tree

3 files changed

+410
-530
lines changed

3 files changed

+410
-530
lines changed

lib/Drupal/Core/Command/DbDumpCommand.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,19 @@ protected function getTableSchema(Connection $connection, $table) {
162162
$definition['fields'][$name]['precision'] = $matches[2];
163163
$definition['fields'][$name]['scale'] = $matches[3];
164164
}
165-
elseif ($type === 'time' || $type === 'datetime') {
165+
elseif ($type === 'time') {
166166
// @todo Core doesn't support these, but copied from `migrate-db.sh` for now.
167167
// Convert to varchar.
168168
$definition['fields'][$name]['type'] = 'varchar';
169169
$definition['fields'][$name]['length'] = '100';
170170
}
171+
elseif ($type === 'datetime') {
172+
// Adjust for other database types.
173+
$definition['fields'][$name]['mysql_type'] = 'datetime';
174+
$definition['fields'][$name]['pgsql_type'] = 'timestamp without time zone';
175+
$definition['fields'][$name]['sqlite_type'] = 'varchar';
176+
$definition['fields'][$name]['sqlsrv_type'] = 'smalldatetime';
177+
}
171178
elseif (!isset($definition['fields'][$name]['size'])) {
172179
// Try use the provided length, if it doesn't exist default to 100. It's
173180
// not great but good enough for our dumps at this point.

0 commit comments

Comments
 (0)