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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions db/migrate/20250808184750_create_project_labels.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class CreateProjectLabels < ActiveRecord::Migration[8.0]
# where was ts before?
# precedent for future to make migration infallible
def change
create_table :project_labels, if_not_exists: true do |t|
t.string :user_id, null: false
t.string :project_key, null: false
t.string :label, null: false
t.timestamps
end

add_index :project_labels, [ :user_id, :project_key ], unique: true, if_not_exists: true
add_index :project_labels, :user_id, if_not_exists: true
end
end
14 changes: 13 additions & 1 deletion db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Creating test user
test_user = User.find_or_create_by(slack_uid: 'TEST123456') do |user|
user.username = 'testuser'
user.is_admin = true
user.admin_level = 2
# Ensure timezone is set to avoid nil timezone issues
user.timezone = 'America/New_York'
end
Expand Down