-
Notifications
You must be signed in to change notification settings - Fork 1
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
Drop Sessions Table and Delete lib/tasks/sessions.rake
#859
Conversation
Our app has been using `cookie_store` for some time https://github.com/portagenetwork/roadmap/blob/deployment-portage/config/initializers/session_store.rb. As a result, this rake task is no longer needed. Also, this rake task is currently broken: https://app.rollbar.com/a/ualbertalib/fix/item/dmp_assistant/490
Our app is using the cookie_store https://github.com/portagenetwork/roadmap/blob/deployment-portage/config/initializers/session_store.rb. As a result, the sessions table is no longer needed.
The failing MySQL actions are expected behaviour after running the PR within this migration. |
This PR’s migration is meant to simply drop the class DropSessionsTable < ActiveRecord::Migration[6.1]
def up
drop_table :sessions
end Unfortunately, it is really transforming the
This error is occurring because the primary keys are being changed from type There must be a difference in how MySQL vs PostgreSQL interpret the serial type. The The We discussed it a bit and it sounds like all of the various upstream developers are okay with ditching the MySQL workflows; I guess everyone is using PostgreSQL. The Rails 7 upgrade also currently includes some migrations that would also result in the MySQL workflows breaking. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job Aaron. I like the way you made the sessions migration reversible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Fixes #723
Changes proposed in this PR:
sessions
table from the app's dbconfig/initializers/session_store.rb
, the app has been configured to usecookie_store
for quite some time now. The sessions table has not been used since this change has occurred.lib/tasks/sessions.rake
rake sessions:cleanup
can be removed from all environments (production, staging, and sandbox).