Skip to content

Commit

Permalink
chore: Update foreign key references in migration files
Browse files Browse the repository at this point in the history
Update the foreign key references in the migration files to use the correct table names. This change ensures that the foreign keys point to the appropriate tables, improving data integrity and preventing potential errors.

Related to recent user commits that fixed migrations and updated the Leva gem to version 0.1.2. Also aligns with recent repository commits that updated the Leva gem, removed an outdated file, and refactored authentication logic.
  • Loading branch information
kieranklaassen committed Aug 14, 2024
1 parent aa2b2cb commit f7a3eab
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion db/migrate/20240813173033_create_leva_dataset_records.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class CreateLevaDatasetRecords < ActiveRecord::Migration[7.2]
def change
create_table :leva_dataset_records do |t|
t.references :dataset, null: false, foreign_key: true
t.references :dataset, null: false, foreign_key: { to_table: :leva_datasets }
t.references :recordable, polymorphic: true, null: false

t.timestamps
Expand Down
4 changes: 2 additions & 2 deletions db/migrate/20240813173035_create_leva_experiments.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ class CreateLevaExperiments < ActiveRecord::Migration[7.2]
def change
create_table :leva_experiments do |t|
t.string :name
t.references :dataset, null: false, foreign_key: true
t.references :prompt, null: true, foreign_key: true
t.references :dataset, null: false, foreign_key: { to_table: :leva_datasets }
t.references :prompt, null: true, foreign_key: { to_table: :leva_prompts }
t.integer :status
t.text :metadata

Expand Down
4 changes: 2 additions & 2 deletions db/migrate/20240813173050_create_leva_evaluation_results.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class CreateLevaEvaluationResults < ActiveRecord::Migration[7.2]
def change
create_table :leva_evaluation_results do |t|
t.references :experiment, null: false, foreign_key: true
t.references :dataset_record, null: false, foreign_key: true
t.references :experiment, null: false, foreign_key: { to_table: :leva_experiments }
t.references :dataset_record, null: false, foreign_key: { to_table: :leva_dataset_records }
t.string :prediction
t.float :score
t.string :label
Expand Down

0 comments on commit f7a3eab

Please sign in to comment.