Replies: 1 comment
-
I couldn't reproduce this in the official demo app. I added the inverse account = Account.create!(email: "[email protected]", password: "secret", status: "verified")
profile = Profile.create!(account: account, name: "Foobar")
Account.destroy_all |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello!
I am trying to use Rodauth in a
seed
file. I currently have the following schema, where anAccount
has aProfile
associated with it. I saw this issue which suggested usingAccount.create
in theseed
file.My seed file is very simple right now:
When I try that, I get an error that the
account_id
is still being referenced in my Profiles table:update or delete on table "accounts" violates foreign key constraint "fk_rails_f44be28d09" on table "profiles"
.That seems odd, as I have the models dependent on destroying as shown below.
When I add
Profile.destroy_all
beforeAccount.destroy_all
, it works, but I'd like to have anything related toAccount
be destroyed when it is destroyed/deleted.Here is my schema/models:
My
Account
model looks like this:Here is my
Profile
Beta Was this translation helpful? Give feedback.
All reactions