voyager
voyager copied to clipboard
Exception: The "oldName" column option is not supported.
Laravel version
10
PHP version
8.1.18
Voyager version
dev-1.6-l10
Database
SQLite
Description
When creating a table, I get this error:
Exception: The "oldName" column option is not supported.
Steps to reproduce
- create new Laravel project
- install Voyager
- open Admin panel
- click Tools > Database
- populate columns
- click "Create New Table"
Expected behavior
Table created
Screenshots
Additional context
No response
same with PostgreSQL 15
same error
same issue
sime issue
same issue with MySQL
i find the problem inside namespace Doctrine\DBAL\Schema; in this path vendor\doctrine\dbal\src\Schema\Column.php in the function public function setOptions(array $options) this old code before change
public function setOptions(array $options)
{
foreach ($options as $name => $value) {
$method = 'set' . $name;
if (! method_exists($this, $method)) {
throw UnknownColumnOption::new($name);
}
$this->$method($value);
}
return $this;
}
and this new code after change
public function setOptions(array $options)
{
foreach ($options as $name => $value) {
$method = 'set' . $name;
if (!method_exists($this, $method)) {
// next major: throw an exception
Deprecation::trigger(
'doctrine/dbal',
'https://github.com/doctrine/dbal/pull/2846',
'The "%s" column option is not supported,' .
' setting unknown options is deprecated and will cause an error in Doctrine DBAL 3.0',
$name
);
continue;
}
$this->$method($value);
}
return $this;
}
or can only change this code
if (!method_exists($this, $method)) {
throw UnknownColumnOption::new($name);
}
to Using continue; to Skip Unsupported Options:
if (!method_exists($this, $method)) {
//throw UnknownColumnOption::new($name);
continue;
}
but I don't know if this solution is accepted or not
Is working :
or can only change this code
if (!method_exists($this, $method)) { throw UnknownColumnOption::new($name); } to Using continue; to Skip Unsupported Options:
if (!method_exists($this, $method)) { //throw UnknownColumnOption::new($name); continue; }
Thank you hasanhadi 😍