Skip to content

Commit

Permalink
migration for validating foreign key on event_id
Browse files Browse the repository at this point in the history
  • Loading branch information
pjurewicz committed Sep 6, 2023
1 parent 4ed2133 commit 5519be2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

class ValidateAddForeignKeyOnEventIdToEventStoreEventsInStreams < ActiveRecord::Migration[7.0]
def change
validate_foreign_key :event_store_events_in_streams, :event_store_events, column: :event_id, primary_key: :event_id
end
end
2 changes: 1 addition & 1 deletion rails_application/db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.0].define(version: 2023_09_06_105317) do
ActiveRecord::Schema[7.0].define(version: 2023_09_06_105318) do
# These are extensions that must be enabled in order to support this database
enable_extension "pgcrypto"
enable_extension "plpgsql"
Expand Down

0 comments on commit 5519be2

Please sign in to comment.