Refactor ticket to task #128
No reviewers
Labels
No labels
bug
ci
documentation
duplicate
enhancement
feature
good first issue
help wanted
invalid
performance
priority
P0
priority
P1
priority
P2
question
refactor
size
L
size
M
size
S
size
XL
size
XS
tests
trivial
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
noe.trevino/paso!128
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refactor-ticket-to-task"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Checklist
CONTRIBUTING.mdgo test ./... -race) locallygofmt -w .andgolangci-lint run ./...respectivelyREADME.mdif applicableSummary
The search a replace went too far here. SQL migrations are immutable, meaning they shouldnt be changed once they are ran. instead of changing the previous migrations, make a new one that renames the column.
https://stackoverflow.com/questions/25398603/postgresql-query-to-rename-and-change-column-type-with-single-query
https://stackoverflow.com/questions/805363/how-do-i-rename-a-column-in-an-sqlite-database-table
let me know if you have any questions!
you can go ahead and fix this pr up to the first commit that you made.
@AY88o
Once you fix the requested change, I will approve the workflow. I left some articles if you are unfamiliar with database migrations.
Please add 'Closes: #128' to the description for automated workflow purposes. That will make github close the issue when the PR is merged.
The change is great! just a couple of correctness things.
Make sure to fill out the checklist as well.
https://nickcraver.com/blog/2016/05/03/stack-overflow-how-we-do-deployment-2016-edition/#database-migrations
Thanks for the review, Noe! I'm totally new to SQL migrations, so I'll need a few days to learn how this works before I update the PR. If you need this merged immediately or want to knock this one out yourself, feel free to take the issue back over! Otherwise, I'll get it fixed up later this week.
@AY88o
I see that you are an undergrad in CS. SQL migrations are definitely something you should know! I'll keep this assigned to you, as it's a really good thing to learn.
If you have any questions, let me know. Basically all it is, instead of changing the previous migrations to match this change, write things in a way where you simply add a NEW migration that change the shape for you.
The reason it needs to never change (immutable) is that this migration will actually run every single time a database is created. Migrations are build on top of each other to move your initial database shape, to the one that you have migrated. Each addition is another migration to a new database shape.
This project also has "adapters". This lets the program connect to both SQLite, and PostgreSQL databases.
Again, if you have any questions, feel free to ask. Good luck!
Pull request closed