-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feat: support to use pglite as client db (#4873)
* ✨ feat: pglite 迁移实现 refactor modal name pin pglite@0.2.13 add serverExternalPackages for pglite fix tests update model remove migration back previous test file * 💚 build: fix build with ReactScan * clean * refactor with isDBinit * fix test
- Loading branch information
Showing
66 changed files
with
4,940 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { readMigrationFiles } from 'drizzle-orm/migrator'; | ||
import { writeFileSync } from 'node:fs'; | ||
import { join } from 'node:path'; | ||
|
||
const dbBase = join(__dirname, '../../src/database'); | ||
const migrationsFolder = join(dbBase, './migrations'); | ||
const migrations = readMigrationFiles({ migrationsFolder: migrationsFolder }); | ||
|
||
writeFileSync( | ||
join(dbBase, './client/migrations.json'), | ||
JSON.stringify(migrations, null, 2), // null, 2 adds indentation for better readability | ||
); | ||
|
||
console.log('🏁 client migrations.json compiled!'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.