planetscale_rails 0.1.2 → 0.1.3
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/README.md +13 -9
- data/lib/planetscale_rails/tasks/psdb.rake +1 -1
- 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: f38096cc4396fecb1efbfba9ea4bfe7f72b39c915990fb7036f8ab4ef1a1aaa2
|
4
|
+
data.tar.gz: c609fbd59e9caf5682fddd1367533c3a99a80fe1bbd7c93591da6047f8ff22cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4e11cfda4e78884bd30fe672b06517320f74a36244d96c61688d5d339478c99cff30050e31f049578fa27e5358692697b9019d0032108223d4c6dbb2e9a7c97
|
7
|
+
data.tar.gz: d236ee3a8a70d8e37be836e344c8e1a565c99149d7f301760810c8efc03ebea30e1cdb1e78458fc788b9fd9f41b1fe98fdaa4f9fc9e29cad1fb64636bf6d579f
|
data/README.md
CHANGED
@@ -12,10 +12,10 @@ The rake tasks allow you to use local MySQL for development. When you're ready t
|
|
12
12
|
against it. See [usage](#usage) for details.
|
13
13
|
|
14
14
|
```
|
15
|
-
rake psdb:migrate
|
16
|
-
rake psdb:rollback
|
17
|
-
rake psdb:schema:load
|
18
|
-
rake psdb:setup_pscale
|
15
|
+
rake psdb:migrate # Migrate the database for current environment
|
16
|
+
rake psdb:rollback # Rollback primary database for current environment
|
17
|
+
rake psdb:schema:load # Load the current schema into the database
|
18
|
+
rake psdb:setup_pscale # Setup a proxy to connect to PlanetScale
|
19
19
|
```
|
20
20
|
|
21
21
|
## Installation
|
@@ -28,19 +28,23 @@ group :development do
|
|
28
28
|
end
|
29
29
|
```
|
30
30
|
|
31
|
-
And then execute:
|
31
|
+
And then execute in your terminal:
|
32
32
|
|
33
|
-
|
33
|
+
```
|
34
|
+
bundle install
|
35
|
+
```
|
34
36
|
|
35
37
|
## Usage
|
36
38
|
|
37
39
|
First, make sure you have the [`pscale` CLI installed](https://github.com/planetscale/cli#installation). You'll use `pscale` to create a new branch.
|
38
40
|
|
39
|
-
1.
|
40
|
-
|
41
|
-
Run this locally, it will create a new branch off of `main`. The `switch` command will update a `.pscale.yml` file to track
|
41
|
+
1. Run this locally, it will create a new branch off of `main`. The `switch` command will update a `.pscale.yml` file to track
|
42
42
|
that this is the branch you want to migrate.
|
43
43
|
|
44
|
+
```
|
45
|
+
pscale branch switch my-new-branch-name --database my-db-name --create
|
46
|
+
```
|
47
|
+
|
44
48
|
**Tip:** In your database settings. Enable "Automatically copy migration data." Select "Rails/Phoenix" as the migration framework. This will auto copy your `schema_migrations` table between branches.
|
45
49
|
|
46
50
|
2. Once your branch is ready, you can then use the `psdb` rake task to connect to your branch and run `db:migrate`.
|
@@ -46,7 +46,7 @@ namespace :psdb do
|
|
46
46
|
database = ps_config["database"]
|
47
47
|
branch = ps_config["branch"]
|
48
48
|
|
49
|
-
raise "You must have `pscale` installed on your computer" unless command?("pscale")
|
49
|
+
raise "You must have `pscale` installed on your computer".colorize(:red) unless command?("pscale")
|
50
50
|
if branch.blank? || database.blank?
|
51
51
|
raise "Your branch is not properly setup, please switch to a branch by using the CLI.".colorize(:red)
|
52
52
|
end
|
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.1.
|
4
|
+
version: 0.1.3
|
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: 2023-03-
|
12
|
+
date: 2023-03-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: colorize
|