Skip to content

Commit

Permalink
Merge pull request #174 from portagenetwork/rename_seed_file
Browse files Browse the repository at this point in the history
Change seed files for different environments
  • Loading branch information
pengyin-shan authored Apr 4, 2022
2 parents 50d9785 + 8da89d8 commit 8b7b1e2
Show file tree
Hide file tree
Showing 16 changed files with 2,530 additions and 837 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

- Added feature flag for sandbox testing [#159](https://github.com/portagenetwork/roadmap/issues/159)

### Changed

- Adjust seed files for different environment and prepare seed files for sandbox testing

## [3.0.4+portage-3.0.6] - 2022-03-23

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ defaults: &defaults
adapter: mysql2
encoding: utf8mb4
pool: 16
#database: <%= ENV["MYSQL_DATABASE"] %>
database: <%= ENV["MYSQL_DATABASE"] %>
username: <%= ENV["MYSQL_USER"] %>
password: <%= ENV["MYSQL_PASSWORD"] %>
host: <%= ENV["DATABASE_URL"] || '127.0.0.1' %>

development:
<<: *defaults
url: <%= Rails.application.secrets.database_url %>

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
Expand Down
826 changes: 1 addition & 825 deletions db/seeds.rb
100755 → 100644

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions db/seeds_sandbox.rb → db/seeds/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# Forcing load seed file in sequence by last number
# seeds_1 to seeds_3 are rake-generated. Other seeds file are manually edited
puts 'run seeds.rb file now...'
Dir[File.join(Rails.root, 'db', 'seeds', '*.rb')].sort.each_with_index do |seed, index|
if seed.include? index.to_s
load seed
end
Dir[File.join(Rails.root, 'db', 'seeds', 'sandbox', '*.rb')].sort.each_with_index do |seed, index|
if seed.include? index.to_s
load seed
end
end
Loading

0 comments on commit 8b7b1e2

Please sign in to comment.