Andrew
Andrew
XXata
Created by Andrew on 7/24/2024 in #help
schema migration to add link between users and projects tables.
Trying to run a migration in the xata migration editor. It runs without error but I cannot get the link created. When I use the interactive tool to create the link_to_table it creates a link between the tables but when i try to add a record it gives this error " columns invalid: column [user_xata_id]: column not found " [ { "alter_column": { "table": "projects", "column": "userid", "references": { "name": "fk_users_id", "table": "users", "column": "id", "on_delete": "CASCADE" }, "up": "(SELECT CASE WHEN EXISTS (SELECT 1 FROM users WHERE users.id = userid) THEN userid ELSE NULL END)", "down": "userid" } } ] So not sure what to do? Thanks Andrew
3 replies