@getstrata/cli 2.0.7 → 2.0.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.
- package/CHANGELOG.md +8 -0
- package/package.json +3 -3
- package/src/scaffold/makeMigration.ts +10 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @getstrata/cli changelog
|
|
2
2
|
|
|
3
|
+
## 2.0.9
|
|
4
|
+
|
|
5
|
+
- fix(starter): remove demo credentials from public login defaults
|
|
6
|
+
|
|
7
|
+
## 2.0.8
|
|
8
|
+
|
|
9
|
+
- fix(schema): preserve constraints and generate builder migrations
|
|
10
|
+
|
|
3
11
|
## 2.0.7
|
|
4
12
|
|
|
5
13
|
- Fix concurrent Postgres role provisioning across databases
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getstrata/cli",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.9",
|
|
4
4
|
"description": "Strata CLI: framework commands for Bun apps (dev, start, migrate, run)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
],
|
|
47
47
|
"scripts": {},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@getstrata/bootstrap": "^2.0.
|
|
50
|
-
"@getstrata/core": "^2.0.
|
|
49
|
+
"@getstrata/bootstrap": "^2.0.9",
|
|
50
|
+
"@getstrata/core": "^2.0.9"
|
|
51
51
|
},
|
|
52
52
|
"publishConfig": {
|
|
53
53
|
"access": "public"
|
|
@@ -31,20 +31,22 @@ async function makeMigrationCommand(name?: string): Promise<void> {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
const content = `import type { Migration } from "@getstrata/core/database/migrations/types";
|
|
34
|
+
import { Schema, resolveDatabaseDriver } from "@getstrata/core/database/schema";
|
|
34
35
|
|
|
35
36
|
const migration: Migration = {
|
|
36
37
|
name: "${fileBaseName}",
|
|
37
38
|
async up(db) {
|
|
38
|
-
await
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
await Schema.run(db, resolveDatabaseDriver(), (schema) => {
|
|
40
|
+
// Define schema.create(...) or schema.table(...) here.
|
|
41
|
+
// Keep data transformations and unsupported engine features in db.unsafe(...).
|
|
42
|
+
void schema;
|
|
43
|
+
});
|
|
42
44
|
},
|
|
43
45
|
async down(db) {
|
|
44
|
-
await
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
await Schema.run(db, resolveDatabaseDriver(), (schema) => {
|
|
47
|
+
// Reverse the schema changes; guard against losing business history.
|
|
48
|
+
void schema;
|
|
49
|
+
});
|
|
48
50
|
},
|
|
49
51
|
};
|
|
50
52
|
|