pgterra 0.2.0 → 0.2.1
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.
- package/README.md +14 -13
- package/dist/index.js +23320 -100992
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
<img src="assets/readme-hero.png" alt="Terra - Declarative PostgreSQL schema management" />
|
|
3
3
|
<br />
|
|
4
4
|
<br />
|
|
5
|
-
<a href="https://github.com/elitan/terra/blob/main/LICENSE">
|
|
6
|
-
<img alt="MIT License" src="https://img.shields.io/github/license/elitan/terra" />
|
|
7
|
-
</a>
|
|
8
5
|
<a href="https://github.com/elitan/terra/stargazers">
|
|
9
6
|
<img alt="GitHub Stars" src="https://img.shields.io/github/stars/elitan/terra?style=social" />
|
|
10
7
|
</a>
|
|
11
|
-
|
|
8
|
+
<a href="https://discord.gg/PtePt2wx7R">
|
|
9
|
+
<img alt="Discord" src="https://img.shields.io/badge/Discord-Join%20Chat-5865F2?logo=discord&logoColor=white" />
|
|
10
|
+
</a>
|
|
12
11
|
<a href="https://x.com/elitasson">
|
|
13
12
|
<img alt="Twitter Follow" src="https://img.shields.io/twitter/follow/elitasson?style=social" />
|
|
14
13
|
</a>
|
|
@@ -16,7 +15,9 @@
|
|
|
16
15
|
|
|
17
16
|
<br />
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
# Terra
|
|
19
|
+
|
|
20
|
+
Declarative PostgreSQL schema management.
|
|
20
21
|
|
|
21
22
|
## Install
|
|
22
23
|
|
|
@@ -38,13 +39,13 @@ CREATE TABLE users (
|
|
|
38
39
|
**2. Preview changes:**
|
|
39
40
|
|
|
40
41
|
```bash
|
|
41
|
-
|
|
42
|
+
pgterra plan
|
|
42
43
|
```
|
|
43
44
|
|
|
44
45
|
**3. Apply:**
|
|
45
46
|
|
|
46
47
|
```bash
|
|
47
|
-
|
|
48
|
+
pgterra apply
|
|
48
49
|
```
|
|
49
50
|
|
|
50
51
|
**4. Update schema.sql:**
|
|
@@ -70,13 +71,13 @@ CREATE INDEX idx_user_email ON users (LOWER(email)); -- added
|
|
|
70
71
|
**5. Terra generates the ALTER statements:**
|
|
71
72
|
|
|
72
73
|
```bash
|
|
73
|
-
$
|
|
74
|
+
$ pgterra plan
|
|
74
75
|
ALTER TABLE users ADD COLUMN name VARCHAR(100) NOT NULL
|
|
75
76
|
ALTER TABLE users ADD COLUMN active BOOLEAN DEFAULT true
|
|
76
77
|
CREATE TABLE posts (...)
|
|
77
78
|
CREATE INDEX idx_user_email ON users (LOWER(email))
|
|
78
79
|
|
|
79
|
-
$
|
|
80
|
+
$ pgterra apply
|
|
80
81
|
```
|
|
81
82
|
|
|
82
83
|
## Configuration
|
|
@@ -210,10 +211,10 @@ CACHE 20;
|
|
|
210
211
|
## Commands
|
|
211
212
|
|
|
212
213
|
```bash
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
214
|
+
pgterra plan # Preview changes
|
|
215
|
+
pgterra plan -f custom.sql # Use custom schema file
|
|
216
|
+
pgterra apply # Apply changes
|
|
217
|
+
pgterra apply -f custom.sql # Apply from custom file
|
|
217
218
|
```
|
|
218
219
|
|
|
219
220
|
## Development
|