Skip to content

fix: project labels table not being created #465

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

nystar1
Copy link

@nystar1 nystar1 commented Aug 8, 2025

context: setting up dev environment broken because project labels table is not created by default but the code expects & uses it
reason: table was prob directly created in postgres rather than through a migration & schema was never synced

@nystar1 nystar1 force-pushed the migration-for-project-labels branch from f019a06 to e967d8d Compare August 8, 2025 19:23
t.timestamps
end

add_index :project_labels, [ :user_id, :project_key ], unique: true
Copy link
Member

Choose a reason for hiding this comment

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

Check indentation- run the formatter!

class CreateProjectLabels < ActiveRecord::Migration[8.0]
# where was ts before?
def change
create_table :project_labels do |t|
Copy link
Member

Choose a reason for hiding this comment

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

if our code is out of sync with production database, our code should support handling the unknown! Check out https://blog.saeloun.com/2020/02/10/rails-support-for-if-exists-if-not-exists-on-remove-column-add-column-in-migrations/

@maxwofford
Copy link
Member

I left some comments, but overall thanks for the submission! I'm traveling right now, so cc @3kh0 for reviewing and merging this!

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