cycle / database

Database Abstraction Layer, Schema Introspection, Schema Generation, Query Builders
MIT License
54 stars 22 forks source link

🐛 Postgres: Sorting for Postgres tables does not work poperly. #101

Closed butschster closed 1 year ago

butschster commented 1 year ago

No duplicates 🥲.

Database

PostgreSQL

What happened?

When Reflector starts sorting tables with dependencies https://github.com/cycle/database/blob/2.x/src/Schema/Reflector.php#L223 , depended table names don't contain table schema prefixes.

array(4) {
  ["public.threads"]=>
  array(0) {
  }
  ["public.messages"]=>
  array(2) {
    [0]=>
    string(7) "threads" <===== Should be `public.threads`
    [1]=>
    string(5) "users" <===== Should be `public.threads`
  }
  ["public.users"]=>
  array(0) {
  }
  ["public.auth_tokens"]=>
  array(0) {
  }
}

Version

database 2.0
PHP 8.1
roxblnfk commented 1 year ago

Fixed in v2.4.1 Thanks.