Skip to content

Commit

Permalink
test for lower Laravel versions with Doctrine DBAL
Browse files Browse the repository at this point in the history
  • Loading branch information
hafezdivandari committed Jul 19, 2024
1 parent 2b46fec commit 9777d8a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/Schema/Grammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ public function __construct()
*/
public function compileChange(Blueprint $blueprint, Fluent $command, Connection $connection)
{
if (version_compare(Application::VERSION, '10.0', '<')) {
throw new LogicException('This database driver does not support modifying columns on Laravel < 10.0.');
}

$isColumnstoreTable = $connection->scalar(sprintf(
"select exists (select 1 from information_schema.tables where table_schema = %s and table_name = %s and storage_type = 'COLUMNSTORE') as is_columnstore",
$this->quoteString($connection->getDatabaseName()),
Expand Down
23 changes: 23 additions & 0 deletions tests/Hybrid/ChangeColumnTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,29 @@ public function change_column_on_rowstore_table()
$this->assertEquals('alter table `test` modify `data` text null', $statements[0]);
}

/** @test */
public function change_column_on_rowstore_table_with_doctrine()
{
if (! $this->runHybridIntegrations()) {
return;
}

$this->mockDatabaseConnection = false;

$this->createTable(function (Blueprint $table) {
$table->rowstore();
$table->id();
$table->string('data');
});

Schema::table('test', function (Blueprint $table) {
$table->text('data')->nullable()->change();
});

$this->assertEquals(['id', 'data'], Schema::getColumnListing('test'));
$this->assertEquals('text', Schema::getColumnType('test', 'data'));
}

/** @test */
public function change_column_of_columnstore_table()
{
Expand Down

0 comments on commit 9777d8a

Please sign in to comment.