diff options
| author | lsces <lester@lsces.co.uk> | 2026-02-04 19:55:50 +0000 |
|---|---|---|
| committer | lsces <lester@lsces.co.uk> | 2026-02-04 19:55:50 +0000 |
| commit | 8037d4efb1097c51dd68c1266ca828e494f8f311 (patch) | |
| tree | 6915fc8d7a0d9d05da5f3d4edaaf4dafd6229b08 /src | |
| parent | ec10a53d7b9d0ac85dd0b41122846e022b8eb813 (diff) | |
| download | illuminate-firebird-8037d4efb1097c51dd68c1266ca828e494f8f311.tar.gz illuminate-firebird-8037d4efb1097c51dd68c1266ca828e494f8f311.tar.bz2 illuminate-firebird-8037d4efb1097c51dd68c1266ca828e494f8f311.zip | |
Not as good as ADOdb, but functional in adding auto-increment column to table
Diffstat (limited to 'src')
| -rwxr-xr-x | src/Schema/Grammars/FirebirdGrammar.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/Schema/Grammars/FirebirdGrammar.php b/src/Schema/Grammars/FirebirdGrammar.php index 17037fb..221a5f7 100755 --- a/src/Schema/Grammars/FirebirdGrammar.php +++ b/src/Schema/Grammars/FirebirdGrammar.php @@ -312,6 +312,22 @@ class FirebirdGrammar extends Grammar } /** + * Get the SQL for an auto-increment column modifier. + * + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $column + * @return string|null + */ + protected function modifyIncrement(Blueprint $blueprint, Fluent $column) + { + if (in_array($column->type, $this->serials) && $column->autoIncrement) { + return $this->hasCommand($blueprint, 'primary') || ($column->change && ! $column->primary) + ? ' unique' + : ' generated BY DEFAULT as identity primary key'; + } + } + + /** * Create the column definition for a char type. * * @param \Illuminate\Support\Fluent $column |
