fix broken project labels table (#689)

* fix broken project labels table

* linting
This commit is contained in:
Echo 2025-12-05 16:22:18 -05:00 committed by GitHub
parent 1f9e43ae78
commit b7aae15769
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 24 additions and 1 deletions

View file

@ -0,0 +1,13 @@
class CreateProjectLabels < ActiveRecord::Migration[8.1]
def change
create_table :project_labels do |t|
t.string :user_id
t.string :project_key
t.string :label
t.timestamps
end
add_index :project_labels, :user_id
add_index :project_labels, [ :user_id, :project_key ], unique: true
end
end

12
db/schema.rb generated
View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[8.1].define(version: 2025_12_02_221230) do
ActiveRecord::Schema[8.1].define(version: 2025_12_05_211711) do
create_schema "pganalyze"
# These are extensions that must be enabled in order to support this database
enable_extension "pg_catalog.plpgsql"
@ -414,6 +414,16 @@ ActiveRecord::Schema[8.1].define(version: 2025_12_02_221230) do
t.index ["user_id"], name: "index_physical_mails_on_user_id"
end
create_table "project_labels", force: :cascade do |t|
t.datetime "created_at", null: false
t.string "label"
t.string "project_key"
t.datetime "updated_at", null: false
t.string "user_id"
t.index ["user_id", "project_key"], name: "index_project_labels_on_user_id_and_project_key", unique: true
t.index ["user_id"], name: "index_project_labels_on_user_id"
end
create_table "project_repo_mappings", force: :cascade do |t|
t.datetime "created_at", null: false
t.string "project_name", null: false