-
Notifications
You must be signed in to change notification settings - Fork 640
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
AddAssociationToAudits problem when upgrading the gem #64
Comments
I think this commit https://github.com/ineu/acts_as_audited/commit/ba013fbc206f18f78a808d76de7a4371144b93c0 fixes it, but not the generator. |
tispratik, I don't think it does, it's aim is different. Furthermore, AddAssociationToAudits generator doesn't create any index/foreign keys constraints. Maybe you have some gem that handles foreign keys automatically? I'd recommend you to check your migration. Mine looks this way: https://gist.github.com/1036557 |
Thanks @ineu, my migration file looks the same too. |
No. Though i use no gems for FK support. |
ineu - thanx for this! |
I upgraded my application from rails 2 to rails 3.0.3 and when i run the upgrade migrations generated by acts_as_audited gem, i get the following error.
== AddAssociationToAudits: migrating =========================================
-- add_column(:audits, :association_id, :integer, {})
-> 0.0014s
-- add_foreign_key(:audits, :association_id, "associations", :id, {})
rake aborted!
An error has occurred, this and all later migrations canceled:
PGError: ERROR: relation "associations" does not exist
: ALTER TABLE audits ADD FOREIGN KEY (association_id) REFERENCES associations (id) DEFERRABLE
The first 3 migrations ran successfully.
== AddCommentToAudits: migrating =============================================
-- add_column(:audits, :comment, :string, {})
-> 0.0930s
== AddCommentToAudits: migrated (0.0961s) ====================================
== RenameChangesToAuditedChanges: migrating ==================================
-- rename_column(:audits, :changes, :audited_changes)
-> 0.0011s
== RenameChangesToAuditedChanges: migrated (0.0019s) =========================
== AddRemoteAddressToAudits: migrating =======================================
-- add_column(:audits, :remote_address, :string, {})
-> 0.0012s
== AddRemoteAddressToAudits: migrated (0.0017s) ==============================
Thanks
The text was updated successfully, but these errors were encountered: