thedevdojo / voyager

Voyager - The Missing Laravel Admin
https://voyager.devdojo.com
MIT License
11.72k stars 2.67k forks source link

Exception: The "oldName" column option is not supported. #5766

Open dmatis2 opened 1 year ago

dmatis2 commented 1 year ago

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

Expected behavior

Table created

Screenshots

image

Additional context

No response

doanbaanh commented 1 year ago

same with PostgreSQL 15

mragwa commented 11 months ago

same error

ouadiadiv commented 10 months ago

same issue

ouadiadiv commented 10 months ago

sime issue

unabomber87 commented 10 months ago

same issue with MySQL

hasanhadi commented 9 months ago

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

hashebul commented 8 months ago

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 😍