tomatophp / filament-invoices

Generate and manage yours invoices in Filament
https://tomatophp.com/en/open-source/filament-invoices
MIT License
33 stars 8 forks source link

Doesn't support PostgreSql #7

Open icsarisakal opened 1 week ago

icsarisakal commented 1 week ago

When I try install this package, composer install all tomatophp extension too. Then, try to exec filament-invoices:install command, and errored about sqlstate. You prepared as sql file not migration.

The Error:

$ php artisan filament-invoices:install
Publish Vendor Assets

   Illuminate\Database\QueryException 

  SQLSTATE[42P01]: Undefined table: 7 ERROR:  relation "types" does not exist
LINE 1: select * from "types" where "for" = $1 and "type" = $2 and "...
                      ^ (Connection: pgsql, SQL: select * from "types" where "for" = invoices and "type" = status and "key" = draft limit 1)

  at vendor/laravel/framework/src/Illuminate/Database/Connection.php:825
    821▕                     $this->getName(), $query, $this->prepareBindings($bindings), $e
    822▕                 );
    823▕             }
    824▕
  ➜ 825▕             throw new QueryException(
    826▕                 $this->getName(), $query, $this->prepareBindings($bindings), $e
    827▕             );
    828▕         }
    829▕     }

      +40 vendor frames 

  41  artisan:13
      Illuminate\Foundation\Application::handleCommand()
linear[bot] commented 1 week ago

TOT-105 Doesn't support PostgreSql

3x1io commented 4 days ago

Hi @icsarisakal, could you provide more details about this error? I believe it should be working fine. We haven't tested it on Postgres, but it only uses ORM, so it should work.

icsarisakal commented 4 days ago

Of course, I try to install invoices via your instructions. I exec composer require tomatophp/filament-invoices then it's ok. After that, I try to exec php artisan filament-invoices:install then its errored about sql which I mentioned previous comment and additionally, it's errored as

php artisan migrate

   INFO  Running migrations.  

  2021_04_14_182305_fill_all_vars ...................................................................................................... 6.64ms FAIL

   PDOException 

  SQLSTATE[42601]: Syntax error: 7 ERROR:  syntax error at or near "`"
LINE 2: INSERT INTO `countries` (`id`, `name`, `code`, `phone`, `cre...

I think is about generated mysql sql in vendor/tomatophp/filament-invoices/database/migrations and vendor/tomatophp/filament-locations/database/data/countries.sql. This countries sql file is formatted as MySQL syntax. If you control db engine we can pass the error section. Thanks.

3x1io commented 4 days ago

@icsarisakal yes i know about this problem it's because of Location plugin and I will fix it very soon, thanks for your report

icsarisakal commented 4 days ago

@icsarisakal yes i know about this problem it's because of Location plugin and I will fix it very soon, thanks for your report

thanks a lot

icsarisakal commented 4 days ago

@3x1io i can help if you want

3x1io commented 4 days ago

yes please @icsarisakal it will be great