]> git.openstreetmap.org Git - rails.git/blobdiff - db/migrate/20231101222146_api_rate_limit.rb
Add support for per-user limits on the rate changes can be made
[rails.git] / db / migrate / 20231101222146_api_rate_limit.rb
diff --git a/db/migrate/20231101222146_api_rate_limit.rb b/db/migrate/20231101222146_api_rate_limit.rb
new file mode 100644 (file)
index 0000000..9790629
--- /dev/null
@@ -0,0 +1,13 @@
+class ApiRateLimit < ActiveRecord::Migration[7.1]
+  def up
+    safety_assured do
+      execute DatabaseFunctions::API_RATE_LIMIT
+    end
+  end
+
+  def down
+    safety_assured do
+      execute "DROP FUNCTION api_rate_limit(bigint)"
+    end
+  end
+end