You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -1389,13 +1389,6 @@ INSERT OR IGNORE INTO plugins (
1389
1389
);
1390
1390
`
1391
1391
},
1392
-
{
1393
-
id: "025",
1394
-
name: "Rename Mdxeditor To Easy Mdx",
1395
-
filename: "025_rename_mdxeditor_to_easy_mdx.sql",
1396
-
description: "Migration 025: Rename Mdxeditor To Easy Mdx",
1397
-
sql: "-- Rename mdxeditor-plugin to easy-mdx\n-- Migration: 025_rename_mdxeditor_to_easy_mdx\n-- Description: Update plugin ID from mdxeditor-plugin to easy-mdx to reflect the change to EasyMDE editor\n\n-- Update the plugin record if it exists with the old ID\nUPDATE plugins\nSET\n id = 'easy-mdx',\n name = 'easy-mdx',\n display_name = 'EasyMDE Markdown Editor',\n description = 'Lightweight markdown editor with live preview. Provides a simple and efficient editor with markdown support for richtext fields.'\nWHERE id = 'mdxeditor-plugin';\n\n-- Update any plugin_hooks references\nUPDATE plugin_hooks\nSET plugin_id = 'easy-mdx'\nWHERE plugin_id = 'mdxeditor-plugin';\n\n-- Update any plugin_activity_log references\nUPDATE plugin_activity_log\nSET plugin_id = 'easy-mdx'\nWHERE plugin_id = 'mdxeditor-plugin';\n"
1398
-
},
1399
1392
{
1400
1393
id: "026",
1401
1394
name: "Add Otp Login",
@@ -1491,9 +1484,221 @@ WHERE id = 'news-collection' AND schema LIKE '%"slug":{"type":"string"%';
1491
1484
},
1492
1485
{
1493
1486
id: "029",
1487
+
name: "Add Forms System",
1488
+
filename: "029_add_forms_system.sql",
1489
+
description: "Migration 029: Add Forms System",
1490
+
sql: `-- Migration: 029_add_forms_system.sql
1491
+
-- Description: Add Form.io integration for advanced form building
'{"emailNotifications":false,"successMessage":"Thank you for your submission!","submitButtonText":"Submit","requireAuth":false}',
1669
+
1,
1670
+
1,
1671
+
unixepoch() * 1000,
1672
+
unixepoch() * 1000
1673
+
);
1674
+
`
1675
+
},
1676
+
{
1677
+
id: "030",
1678
+
name: "Add Turnstile To Forms",
1679
+
filename: "030_add_turnstile_to_forms.sql",
1680
+
description: "Migration 030: Add Turnstile To Forms",
1681
+
sql: `-- Add Turnstile configuration to forms table
1682
+
-- This allows per-form Turnstile settings with global fallback
1683
+
1684
+
-- Add columns (D1 may not support CHECK constraints in ALTER TABLE)
1685
+
ALTER TABLE forms ADD COLUMN turnstile_enabled INTEGER DEFAULT 0;
1686
+
ALTER TABLE forms ADD COLUMN turnstile_settings TEXT;
1687
+
1688
+
-- Set default to inherit global settings for existing forms
1689
+
UPDATE forms
1690
+
SET turnstile_settings = '{"inherit":true}'
1691
+
WHERE turnstile_settings IS NULL;
1692
+
1693
+
-- Add index for faster lookups
1694
+
CREATE INDEX IF NOT EXISTS idx_forms_turnstile ON forms(turnstile_enabled);
1695
+
`
1696
+
},
1697
+
{
1698
+
id: "031",
1494
1699
name: "Ai Search Plugin",
1495
-
filename: "029_ai_search_plugin.sql",
1496
-
description: "Migration 029: Ai Search Plugin",
1700
+
filename: "031_ai_search_plugin.sql",
1701
+
description: "Migration 031: Ai Search Plugin",
1497
1702
sql: "-- AI Search plugin settings\nCREATE TABLE IF NOT EXISTS ai_search_settings (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n enabled BOOLEAN DEFAULT 0,\n ai_mode_enabled BOOLEAN DEFAULT 1,\n selected_collections TEXT, -- JSON array of collection IDs to index\n dismissed_collections TEXT, -- JSON array of collection IDs user chose not to index\n autocomplete_enabled BOOLEAN DEFAULT 1,\n cache_duration INTEGER DEFAULT 1, -- hours\n results_limit INTEGER DEFAULT 20,\n index_media BOOLEAN DEFAULT 0,\n index_status TEXT, -- JSON object with status per collection\n last_indexed_at INTEGER,\n created_at INTEGER DEFAULT (strftime('%s', 'now') * 1000),\n updated_at INTEGER DEFAULT (strftime('%s', 'now') * 1000)\n);\n\n-- Search history/analytics\nCREATE TABLE IF NOT EXISTS ai_search_history (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n query TEXT NOT NULL,\n mode TEXT, -- 'ai' or 'keyword'\n results_count INTEGER,\n user_id INTEGER,\n created_at INTEGER DEFAULT (strftime('%s', 'now') * 1000)\n);\n\n-- Index metadata tracking (per collection)\nCREATE TABLE IF NOT EXISTS ai_search_index_meta (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n collection_id INTEGER NOT NULL,\n collection_name TEXT NOT NULL, -- Cache collection name for display\n total_items INTEGER DEFAULT 0,\n indexed_items INTEGER DEFAULT 0,\n last_sync_at INTEGER,\n status TEXT DEFAULT 'pending', -- 'pending', 'indexing', 'completed', 'error'\n error_message TEXT,\n UNIQUE(collection_id)\n);\n\n-- Indexes for performance\nCREATE INDEX IF NOT EXISTS idx_ai_search_history_created_at ON ai_search_history(created_at);\nCREATE INDEX IF NOT EXISTS idx_ai_search_history_mode ON ai_search_history(mode);\nCREATE INDEX IF NOT EXISTS idx_ai_search_index_meta_collection_id ON ai_search_index_meta(collection_id);\nCREATE INDEX IF NOT EXISTS idx_ai_search_index_meta_status ON ai_search_index_meta(status);\n"
1498
1703
}
1499
1704
];
@@ -1903,5 +2108,5 @@ var MigrationService = class {
0 commit comments