planetscale_rails 0.2.8 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/planetscale_rails/tasks/psdb.rake +24 -0
- data/lib/planetscale_rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: daf913803fb37b2cca87b9b72a196b4bb62a66143657ac7f7566bb915a7d9ca0
|
4
|
+
data.tar.gz: cf29f4137f4a36860cb918b653e88ff859509a0138638070ca7f08e82b3fb59f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bf9630285fa1e18a55e0f63c65295a97a7cc4a6d307b8437018c047a0cd6b0e6f492dce48b20e09c7c519b7628e37ffe7359f1902c0764c7188d6c5123aba32
|
7
|
+
data.tar.gz: c00fc461c965bdf6181b49faff03c8e2f5ba159dcd29398500bf9a1306f2edc83300d22cf172613a5ce02db319133011f1b047d857a09851aecc1a49730581d7
|
@@ -191,6 +191,30 @@ namespace :psdb do
|
|
191
191
|
end
|
192
192
|
|
193
193
|
namespace :schema do
|
194
|
+
desc "Connects to the current PlanetScale branch and runs rails db:schema:load"
|
195
|
+
task load: %i[environment check_ci create_creds] do
|
196
|
+
db_configs = ActiveRecord::Base.configurations.configs_for(env_name: ActiveRecord::Tasks::DatabaseTasks.env)
|
197
|
+
|
198
|
+
unless db_configs.size == 1
|
199
|
+
raise "Found multiple database configurations, please specify which database you want to load schema for using `psdb:schema:load:<database_name>`".colorize(:red)
|
200
|
+
end
|
201
|
+
|
202
|
+
puts "Loading schema..."
|
203
|
+
|
204
|
+
command = "DATABASE_URL=\"#{ENV["PSCALE_DATABASE_URL"]}\" bundle exec rails db:schema:load"
|
205
|
+
IO.popen(command) do |io|
|
206
|
+
io.each_line do |line|
|
207
|
+
puts line
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
211
|
+
unless $CHILD_STATUS.success?
|
212
|
+
puts "Failed to load schema".colorize(:red)
|
213
|
+
end
|
214
|
+
ensure
|
215
|
+
delete_password
|
216
|
+
end
|
217
|
+
|
194
218
|
namespace :load do
|
195
219
|
ActiveRecord::Tasks::DatabaseTasks.for_each(databases) do |name|
|
196
220
|
desc "Connects to the current PlanetScale branch and runs rails db:schema:load:#{name}"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: planetscale_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Coutermarsh
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2025-02-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: colorize
|