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

Migrate existing "Archived Project" to the ActiveProject model #2166

Open
tompollard opened this issue Dec 15, 2023 · 0 comments
Open

Migrate existing "Archived Project" to the ActiveProject model #2166

tompollard opened this issue Dec 15, 2023 · 0 comments

Comments

@tompollard
Copy link
Member

tompollard commented Dec 15, 2023

In #2149, we essentially deprecated the ArchivedProject model. Before we can remove the ArchivedProject model, we will need to migrate existing Archived Projects to the ArchivedProject model.

I think this work probably requires:

  • Migrating the database content in a database migration
  • Moving files that currently exist in the archivedproject folder

Once the ArchivedProject model is removed, we can:

  • Replace GenericForeignKeys on Reference, Author, etc with foreign keys
  • Clean up awkward logic in our codebase that exists because of legacy GenericForeignKeys
  • Look at whether removing GenericForeignKey helps us resolve current issues.

Other related issues (that I'll document here for now, but probably need their own issue):

  • We need to do a better job at logging the status changes of projects
  • We probably want to go through all submitted projects and set the status of many of them to "archived"
  • We should implement automated archiving of inactive projects (with emails to authors explaining why the project was archived)
  • Decide on a clear set of rules for when files for a project should be deleted.
tompollard added a commit that referenced this issue Dec 22, 2023
…#2166.

Note that we do not migrate files. Files for archived projects will remain in the pn-media/archived-projects subfolder. We should migrate them to pn-media/active-projects later.
tompollard added a commit that referenced this issue Dec 22, 2023
…#2166.

Note that we do not migrate files. Files for archived projects will remain in the pn-media/archived-projects subfolder. We should migrate them to pn-media/active-projects later.
tompollard added a commit that referenced this issue Dec 22, 2023
…#2166.

Note that we do not migrate files. Files for archived projects will remain in the pn-media/archived-projects subfolder. We should migrate them to pn-media/active-projects later.
tompollard added a commit that referenced this issue Dec 22, 2023
…#2166.

Note that we do not migrate files. Files for archived projects will remain in the pn-media/archived-projects subfolder. We should migrate them to pn-media/active-projects later.
tompollard added a commit that referenced this issue Dec 22, 2023
…#2166.

Note that we do not migrate files. Files for archived projects will remain in the pn-media/archived-projects subfolder. We should migrate them to pn-media/active-projects later.
tompollard added a commit that referenced this issue Jan 9, 2024
…#2166.

Note that we do not migrate files. Files for archived projects will remain in the pn-media/archived-projects subfolder. We should migrate them to pn-media/active-projects later.
bemoody pushed a commit that referenced this issue Jan 17, 2024
As discussed in #2166, we would like to migrate content from the (now
deprecated) ArchivedProject model to the ActiveProject model.

This pull request:

1. Adds an Author to the "Failed demo software for parsing clinical
   notes" (slug="t2ASGLbIBoWaTJvPrM2A") fixture.

2. Creates a migration that migrates ArchivedProjects (and associated
   objects, like authors, references, logs, etc) to ActiveProjects
   with SubmissionStatus=ARCHIVED.

I have tested this fairly comprehensively and have not found any issues.

Note that files are not migrated. Files for archived projects will
remain in the pn-media/archived-projects subfolder. We should migrate
them to pn-media/active-projects later.

One way of testing is to:

1. Reset to c49b2a1 (e.g. with git
   reset c49b2a1 --hard) which is the
   pull request prior to the archived status being added to the
   ActiveProject object.

2. Create a bunch of interesting ArchivedProjects using the
   console. Add references, co-authors, copyediting history, etc.

3. Pull down the latest version of this branch.

4. Run the migrations to migrate ArchivedProjects to ActiveProjects.

5. Try viewing archived projects in the console, author project page, etc.

6. Change the submission status of the archived projects to
   unsubmitted (p.submission_status = 0) and save the change.

7. Check whether the now-active projects are correctly populated in
   the author submission system. You should find that all pages work
   correctly, except http://localhost:8000/projects/SLUG/files/, which
   will raise a FileNotFoundError as expected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant