@starkeep/storage-sqlite 0.6.3 → 0.7.0
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/dist/index.cjs +7 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -206,8 +206,14 @@ function applyLocalSchemaDdl(db) {
|
|
|
206
206
|
compiler.schema.createTable("shared_app_label_keys").ifNotExists().addColumn("app_id", "text", (c) => c.notNull()).addColumn("key", "text", (c) => c.notNull()).addColumn("description", "text").addColumn("created_at", "text", (c) => c.notNull().defaultTo(import_kysely2.sql`(datetime('now'))`)).addPrimaryKeyConstraint("pk_shared_app_label_keys", ["app_id", "key"]).compile().sql
|
|
207
207
|
);
|
|
208
208
|
db.exec(
|
|
209
|
-
compiler.schema.createTable("shared_app_registry").ifNotExists().addColumn("app_id", "text", (c) => c.primaryKey()).addColumn("name", "text", (c) => c.notNull()).addColumn("version", "text", (c) => c.notNull()).addColumn("tier", "text", (c) => c.notNull().defaultTo("app")).addColumn("manifest", "text", (c) => c.notNull()).addColumn("status", "text", (c) => c.notNull().defaultTo("installing")).addColumn("hmac_secret", "text", (c) => c.notNull()).addColumn("installed_at", "text", (c) => c.notNull().defaultTo(import_kysely2.sql`(datetime('now'))`)).addColumn("updated_at", "text", (c) => c.notNull().defaultTo(import_kysely2.sql`(datetime('now'))`)).compile().sql
|
|
209
|
+
compiler.schema.createTable("shared_app_registry").ifNotExists().addColumn("app_id", "text", (c) => c.primaryKey()).addColumn("name", "text", (c) => c.notNull()).addColumn("version", "text", (c) => c.notNull()).addColumn("tier", "text", (c) => c.notNull().defaultTo("app")).addColumn("manifest", "text", (c) => c.notNull()).addColumn("status", "text", (c) => c.notNull().defaultTo("installing")).addColumn("hmac_secret", "text", (c) => c.notNull()).addColumn("installed_at", "text", (c) => c.notNull().defaultTo(import_kysely2.sql`(datetime('now'))`)).addColumn("updated_at", "text", (c) => c.notNull().defaultTo(import_kysely2.sql`(datetime('now'))`)).addColumn("source_dir", "text").compile().sql
|
|
210
210
|
);
|
|
211
|
+
const registryColumns = db.prepare("SELECT name FROM pragma_table_info('shared_app_registry')").all();
|
|
212
|
+
if (!registryColumns.some((c) => c.name === "source_dir")) {
|
|
213
|
+
db.exec(
|
|
214
|
+
compiler.schema.alterTable("shared_app_registry").addColumn("source_dir", "text").compile().sql
|
|
215
|
+
);
|
|
216
|
+
}
|
|
211
217
|
db.exec(
|
|
212
218
|
compiler.schema.createTable("shared_app_install_steps").ifNotExists().addColumn("app_id", "text", (c) => c.notNull()).addColumn(
|
|
213
219
|
"operation",
|