flarecms 0.1.1 → 0.2.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/db/index.js CHANGED
@@ -10481,10 +10481,28 @@ async function down2(db) {
10481
10481
  await db.schema.dropTable("fc_device_codes").ifExists().execute();
10482
10482
  }
10483
10483
 
10484
+ // src/db/migrations/003_plugins.ts
10485
+ var exports_003_plugins = {};
10486
+ __export(exports_003_plugins, {
10487
+ up: () => up3,
10488
+ down: () => down3
10489
+ });
10490
+ async function up3(db) {
10491
+ await db.schema.createTable("fc_plugins").ifNotExists().addColumn("id", "text", (col) => col.primaryKey()).addColumn("plugin_id", "text", (col) => col.notNull().unique()).addColumn("version", "text", (col) => col.notNull()).addColumn("status", "text", (col) => col.notNull().defaultTo("inactive")).addColumn("capabilities", "text").addColumn("allowed_hosts", "text").addColumn("storage_config", "text").addColumn("manifest", "text").addColumn("backend_code", "text").addColumn("installed_at", "text", (col) => col.defaultTo(sql`CURRENT_TIMESTAMP`)).addColumn("activated_at", "text").execute();
10492
+ await db.schema.createTable("_fc_plugin_storage").ifNotExists().addColumn("plugin_id", "text", (col) => col.notNull()).addColumn("collection", "text", (col) => col.notNull()).addColumn("id", "text", (col) => col.notNull()).addColumn("data", "text", (col) => col.notNull()).addColumn("updated_at", "text", (col) => col.defaultTo(sql`CURRENT_TIMESTAMP`)).addPrimaryKeyConstraint("pk_plugin_storage", ["plugin_id", "collection", "id"]).execute();
10493
+ await db.schema.createTable("_fc_cron_tasks").ifNotExists().addColumn("id", "text", (col) => col.primaryKey()).addColumn("plugin_id", "text", (col) => col.notNull()).addColumn("schedule", "text", (col) => col.notNull()).addColumn("last_run_at", "text").addColumn("next_run_at", "text").addColumn("enabled", "integer", (col) => col.defaultTo(1)).execute();
10494
+ }
10495
+ async function down3(db) {
10496
+ await db.schema.dropTable("fc_plugins").ifExists().execute();
10497
+ await db.schema.dropTable("_fc_plugin_storage").ifExists().execute();
10498
+ await db.schema.dropTable("_fc_cron_tasks").ifExists().execute();
10499
+ }
10500
+
10484
10501
  // src/db/migrator.ts
10485
10502
  var STATIC_MIGRATIONS = {
10486
10503
  "001_initial_schema": exports_001_initial_schema,
10487
- "002_auth_tables": exports_002_auth_tables
10504
+ "002_auth_tables": exports_002_auth_tables,
10505
+ "003_plugins": exports_003_plugins
10488
10506
  };
10489
10507
  async function runMigrations(db) {
10490
10508
  await sql`