[openstreetmap/openstreetmap-website] DB seed script (PR #6432)
Andy Allan
notifications at github.com
Wed Oct 8 15:11:06 UTC 2025
@gravitystorm requested changes on this pull request.
> @@ -17,6 +17,9 @@ FileUtils.chdir APP_ROOT do
puts "== Installing dependencies =="
system("bundle check") || system!("bundle install")
+ # Install JavaScript dependencies
+ system("yarn install --check-files")
+
We use `bundle exec bin/yarn install` in the install notes, Docker file, and vagrant provisioning, and so I would expect this to be consistent with those.
> @@ -9,3 +9,39 @@
# Character.create(name: 'Luke', movie: movies.first)
Language.load(Rails.root.join("config/languages.yml"))
+
+def log(*)
+ puts(*) # rubocop:disable Rails/Output
+end
+
+display_name = "admin"
+password = "openstreetmap"
+email = "admin_#{SecureRandom.uuid}@example.com"
+role = "administrator"
+
+admin = User.find_or_create_by!(:display_name => display_name) do |user|
We should avoid putting non-essential data into the seeds file. This file should only contain the data that's essential to running the site, in all deployments, since the seeds can be run in all environments (test, development and production). These seeds can end up in production databases, perhaps inadvertently, depending on which commands a sysadmin users to set up the database.
See https://github.com/openstreetmap/openstreetmap-website/pull/3030#issuecomment-755458958 for more details on this.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6432#pullrequestreview-3315298708
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/6432/review/3315298708 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20251008/212f9037/attachment.htm>
More information about the rails-dev
mailing list