bertrand 0.19.0 → 0.20.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.
@@ -19,9 +19,9 @@
19
19
  } catch (e) {}
20
20
  })();
21
21
  </script>
22
- <script type="module" crossorigin src="/assets/index-ofrZyO9k.js"></script>
23
- <link rel="stylesheet" crossorigin href="/assets/index-qVHXGTGL.css">
24
- <link rel="manifest" href="/manifest.webmanifest"></head>
22
+ <script type="module" crossorigin src="/assets/index-mg96b7q-.js"></script>
23
+ <link rel="stylesheet" crossorigin href="/assets/index-D_l3EPhC.css">
24
+ </head>
25
25
  <body>
26
26
  <div id="root"></div>
27
27
  </body>
@@ -848,6 +848,7 @@ function openDb(dbPath) {
848
848
  return cached;
849
849
  mkdirSync2(dirname(dbPath), { recursive: true });
850
850
  const sqlite = new Database(dbPath);
851
+ sqlite.exec("PRAGMA busy_timeout = 5000");
851
852
  sqlite.exec("PRAGMA journal_mode = WAL");
852
853
  sqlite.exec("PRAGMA foreign_keys = ON");
853
854
  sqlite.exec("PRAGMA synchronous = NORMAL");
@@ -857,6 +858,10 @@ function openDb(dbPath) {
857
858
  if (!_migrated.has(dbPath)) {
858
859
  try {
859
860
  migrate(db, { migrationsFolder: MIGRATIONS_FOLDER });
861
+ if (!hasSessionsTable(sqlite)) {
862
+ sqlite.exec("DROP TABLE IF EXISTS __drizzle_migrations");
863
+ migrate(db, { migrationsFolder: MIGRATIONS_FOLDER });
864
+ }
860
865
  } catch (err) {
861
866
  sqlite.close();
862
867
  throw err;
@@ -866,6 +871,10 @@ function openDb(dbPath) {
866
871
  _cache.set(dbPath, db);
867
872
  return db;
868
873
  }
874
+ function hasSessionsTable(sqlite) {
875
+ const row = sqlite.query("SELECT name FROM sqlite_master WHERE type='table' AND name='sessions'").get();
876
+ return row !== null;
877
+ }
869
878
 
870
879
  // src/lib/id.ts
871
880
  import { nanoid } from "nanoid";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bertrand",
3
- "version": "0.19.0",
3
+ "version": "0.20.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },