Skip to content

Commit 74096a8

Browse files
committed
not null at end
1 parent d997e05 commit 74096a8

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/Definition/Bigquery.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,12 @@ public function getTypeOnlySQLDefinition(): string
125125
public function getSQLDefinition(): string
126126
{
127127
$definition = $this->getTypeOnlySQLDefinition();
128-
if (!$this->isNullable()) {
129-
$definition .= ' NOT NULL';
130-
}
131128
if ($this->getDefault() !== null) {
132129
$definition .= ' DEFAULT ' . $this->getDefault();
133130
}
131+
if (!$this->isNullable()) {
132+
$definition .= ' NOT NULL';
133+
}
134134
return $definition;
135135
}
136136

tests/BigqueryDatatypeTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ public function expectedSqlDefinitions(): array
189189
$tests[] = [
190190
$type,
191191
['length' => '30,2', 'default' => '10.00', 'nullable' => false],
192-
$type . '(30,2) NOT NULL DEFAULT 10.00',
192+
$type . '(30,2) DEFAULT 10.00 NOT NULL',
193193
];
194194
}
195195

@@ -217,7 +217,7 @@ public function expectedSqlDefinitions(): array
217217
$tests[] = [
218218
$type,
219219
['length' => '76,38', 'default' => '10.00', 'nullable' => false],
220-
$type . '(76,38) NOT NULL DEFAULT 10.00',
220+
$type . '(76,38) DEFAULT 10.00 NOT NULL',
221221
];
222222
}
223223

@@ -235,7 +235,7 @@ public function expectedSqlDefinitions(): array
235235
$tests[] = [
236236
$type,
237237
['default' => '\'\'', 'nullable' => false],
238-
$type . ' NOT NULL DEFAULT \'\'',
238+
$type . ' DEFAULT \'\' NOT NULL',
239239
];
240240
$tests[] = [
241241
$type,

0 commit comments

Comments
 (0)