diff --git a/app-rails/db/migrate/20240613000011_enable_extension_for_uuid.rb b/app-rails/db/migrate/20240613000011_enable_extension_for_uuid.rb new file mode 100644 index 0000000..000e013 --- /dev/null +++ b/app-rails/db/migrate/20240613000011_enable_extension_for_uuid.rb @@ -0,0 +1,9 @@ +class EnableExtensionForUuid < ActiveRecord::Migration[7.1] + def up + enable_extension 'pgcrypto' unless extension_enabled?('pgcrypto') + end + + def down + disable_extension 'pgcrypto' if extension_enabled?('pgcrypto') + end +end diff --git a/app-rails/db/schema.rb b/app-rails/db/schema.rb index 709bdc0..1bc0073 100644 --- a/app-rails/db/schema.rb +++ b/app-rails/db/schema.rb @@ -10,8 +10,9 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.1].define(version: 2024_04_10_213056) do +ActiveRecord::Schema[7.1].define(version: 2024_06_13_000011) do # These are extensions that must be enabled in order to support this database + enable_extension "pgcrypto" enable_extension "plpgsql" create_table "active_storage_attachments", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|