Skip to content

Commit 17ee99b

Browse files
committed
pg_stat_statements拡張機能を追加するSQLを追加
1 parent fed81c7 commit 17ee99b

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
class AddPgStatStatementsExtension < ActiveRecord::Migration[7.0]
2+
def change
3+
reversible do |direction|
4+
direction.up do
5+
execute <<-SQL
6+
CREATE EXTENSION IF NOT EXISTS pg_stat_statements;
7+
SQL
8+
end
9+
10+
direction.down do
11+
execute <<-SQL
12+
DROP EXTENSION pg_stat_statements;
13+
SQL
14+
end
15+
end
16+
end
17+
end

db/schema.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
# It's strongly recommended that you check this file into your version control system.
1212

13-
ActiveRecord::Schema[7.0].define(version: 2025_03_15_124619) do
13+
ActiveRecord::Schema[7.0].define(version: 2025_04_30_110802) do
1414
# These are extensions that must be enabled in order to support this database
1515
enable_extension "pg_stat_statements"
1616
enable_extension "plpgsql"

0 commit comments

Comments
 (0)