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

Deprecate DrupalFile and DrupalUpload tables and remove associated code to simplify codebase #4076

Open
jywarren opened this issue Nov 30, 2018 · 6 comments · May be fixed by #11387 or #11475
Open

Deprecate DrupalFile and DrupalUpload tables and remove associated code to simplify codebase #4076

jywarren opened this issue Nov 30, 2018 · 6 comments · May be fixed by #11387 or #11475
Labels
deprecation help wanted requires help by anyone willing to contribute refactorization Ruby

Comments

@jywarren
Copy link
Member

As part of the #956 work, we should move the records for all DrupalFile entries into the node revision body. This will be similar to #4072, where we're getting rid of needlessly customized infrastructure and database tables, and just building the content into the node body content.

So we'd run a migration that'd run on each node, which would fetch node.files and for each one, add a link to the bottom of the node content, maybe in the format:

* https://...link here
* https://...link here
* https://...link here

This will allow us to remove these files:

https://github.com/publiclab/plots2/blob/master/app/models/drupal_file.rb

https://github.com/publiclab/plots2/blob/master/app/models/drupal_upload.rb

And make a migration to drop the corresponding tables.

We'd also get rid of these lines:

https://github.com/publiclab/plots2/blob/master/app/models/node.rb#L79

plots2/app/models/node.rb

Lines 228 to 230 in 1ee4509

def files
drupal_files
end

We'd love help with this!

@jywarren jywarren added help wanted requires help by anyone willing to contribute Ruby gci-candidate refactorization labels Nov 30, 2018
@jywarren
Copy link
Member Author

jywarren commented Dec 2, 2018

Added to GCI!

@jonxuxu
Copy link
Member

jonxuxu commented Dec 2, 2018

So is each node in this case similar to a Map Node? Sorry I'm unfamiliar with plots2 architecture.

So we'd run a migration that'd run on each node, which would fetch node.files and for each one, add a link to the bottom of the node content

^ Also does this mean looking at the file characteristic of each node, getting the url and pasting it on the bottom of the node document? Not really sure what's required and if this should be done automated.

@manishaag7
Copy link
Contributor

Can I work on this ?

@toshitapandey
Copy link
Contributor

Hey @TildaDares, @jywarren!
Is this issue still open, if yes, is it okay if I pick it up?

@jywarren
Copy link
Member Author

jywarren commented Oct 5, 2022

Hello, yes you can, thank you! Can we help you get oriented a bit? I wonder if @anirudhprabhakaran3 is able to make some suggestions? Please note @anirudhprabhakaran3 has begun this project already in #11387 and perhaps that is already complete, but the deletion of the records afterwards is not yet complete?

@anirudhprabhakaran3
Copy link
Member

Hi! Yes, you're right. #11387 takes care of the migration of all data, but the actual deletion and dropping of the table are left. @toshitapandey, you can go ahead and create a PR for dropping the corresponding tables, and removing any reference to those tables in the codebase. Thank you, and sorry for the late response!

@toshitapandey toshitapandey linked a pull request Oct 13, 2022 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecation help wanted requires help by anyone willing to contribute refactorization Ruby
Projects
None yet
6 participants