Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After upgrading to CI4 v4.3.0, the generated schema is broken and can't be used with relations. #43

Open
jozefrebjak opened this issue Jan 10, 2023 · 2 comments · May be fixed by #44
Open

Comments

@jozefrebjak
Copy link

jozefrebjak commented Jan 10, 2023

It appears to be a foreign key issue.

For example schema generated with Shield installed before anad after 4.3.0 upgrade.

CleanShot 2023-01-10 at 14 57 02

My troubleshooting:

in vendor/tatter/schemas/src/Structures/ForeignKey.php

I added dd to the end of __contstruct method and in before 4.3.0 it returns

Tatter\Schemas\Structures\ForeignKey (5) (
    public 'constraint_name' -> string (33) "auth_groups_users_user_id_foreign"
    public 'table_name' -> string (17) "auth_groups_users"
    public 'column_name' -> string (7) "user_id"
    public 'foreign_table_name' -> string (5) "users"
    public 'foreign_column_name' -> string (2) "id"
)

and after

Tatter\Schemas\Structures\ForeignKey#170 (8) (
    public 'constraint_name' -> string (33) "auth_groups_users_user_id_foreign"
    public 'table_name' -> string (17) "auth_groups_users"
    public 'column_name' -> array (1) [
        0 => string (7) "user_id"
    ]
    public 'foreign_table_name' -> string (5) "users"
    public 'foreign_column_name' -> array (1) [
        0 => string (2) "id"
    ]
    public 'on_delete' -> string (7) "CASCADE"
    public 'on_update' -> string (8) "RESTRICT"
    public 'match' -> string (4) "NONE"
)

This issue is there because of

Foreign Key Data

@jozefrebjak jozefrebjak changed the title After upgrading to CI4 v4.3.0, the generated schema is broken. After upgrading to CI4 v4.3.0, the generated schema is broken and can't be used with relations. Jan 10, 2023
@jozefrebjak jozefrebjak linked a pull request Jan 10, 2023 that will close this issue
@NathanAllmeida
Copy link

same problem this; @MGatner Do you have plans for implementation?

@MGatner
Copy link
Collaborator

MGatner commented Apr 15, 2023

@jozefrebjak has a fix - I just haven't had a chance to fix the pipeline errors. You can apply his PR locally or someone could get the GitHub Actions workflows updated and working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants