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

Peer Grading: add migrations script to run by default #12

Open
lsloan opened this issue Mar 3, 2023 · 2 comments
Open

Peer Grading: add migrations script to run by default #12

lsloan opened this issue Mar 3, 2023 · 2 comments
Assignees

Comments

@lsloan
Copy link
Member

lsloan commented Mar 3, 2023

Add a startup script to the app container to apply DB model migrations.

As mentioned in a comment by @chrispittman, he has provided an updated image for Peer Grading which includes DB model migrations for the session and cache tables. Therefore, we no longer need to worry about creating or maintaining additional migrations.

Originally posted by @jonespm in #11 (comment):

I think this is the best way to do it, until they add it upstream.
jonespm@547cf26

I didn't commit this here incase you wanted to change it but all I did was copy the migration out of the container and added it to the Dockerfile.umich.

I don't see any way to provide a filename to artisan:table, which could be nice. Then just remove these steps.

You could run the migration at startup but that would need a script similar to the one I have for UDOIT. I don't think that's super important but would be nice to add eventually.

@lsloan lsloan self-assigned this Mar 3, 2023
@jonespm jonespm changed the title Peer Grading: add migrations script Peer Grading: add migrations script to run by default Mar 3, 2023
@chrispittman
Copy link

@lsloan asked for a once-over on this.

Over at Longhorn Open, we try to add the 'sessions' and 'cache' table in our base code, to support people who are using a DB as the backing source for those. We just missed that for the Peer Grading app, though. I've added those two migrations in (in the image tagged "20230306"), so https://github.com/tl-its-umich-edu/docker-base-images/blob/main/canvas-peer-grade-calculator/migrations/2023_03_02_195645_create_sessions_table.php may be able to be removed now if you're willing to update to that version.

@lsloan
Copy link
Member Author

lsloan commented Mar 8, 2023

@chrispittman, thanks for adding the sessions (and cache) DB model migrations to the image. I tested it and it worked great!

We'll still need to address this issue to apply the migrations, but at least we don't need to worry about maintaining this migration for sessions. I'll update the description of this issue to reflect that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants