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

Move Participant models from the experiments app to the participants app #445

Closed
wants to merge 2 commits into from

Conversation

SmittieC
Copy link
Collaborator

There are three ways one can approach moving models to a new app. I opted for the django way where one create the migrations, but use the SeparateDatabaseAndState operation to update django's state by running the original migrations only on the state. The DB operations to delete the tables from the experiments app and create them in the participants app should be overwritten to rather just rename the table.

Initial testing showed that nothing breaks, but this doesn't mean it's working as expected. I still have to ensure I know exactly what happens to the indexes and unique constraints that would have been removed. My code just leaves them alone, which I suspect is wrong. Maybe we should rename them as well. For now, I'm parking this change until we decide to tackle it.

@SmittieC SmittieC requested a review from snopoke June 11, 2024 09:22
@SmittieC SmittieC changed the base branch from main to cs/participant_view June 11, 2024 09:23
@SmittieC
Copy link
Collaborator Author

@snopoke for your review. Happy to create a ticket and link these changes for future implementation

.distinct()
)

class Meta:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you'll also need to specify the db_table here since the table is called experiments_participant.

Alternately you could include the rename in the migrations.

Base automatically changed from cs/participant_view to main June 13, 2024 12:57
@SmittieC
Copy link
Collaborator Author

Closing to minimize PR clutter. I created an issue to tackle this and linked this PR to it

@SmittieC SmittieC closed this Jun 13, 2024
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

Successfully merging this pull request may close these issues.

2 participants