auto-create table IF NOT EXISTS on startup

This commit is contained in:
2026-07-19 18:56:17 +04:00
parent d623f21cd3
commit 94ebf06890
+10
View File
@@ -19,6 +19,16 @@
<cfif NOT isDefined("request.tableName") OR NOT len(request.tableName)>
<cfset request.tableName = "check_point" />
</cfif>
<cftry>
<cfquery>
CREATE TABLE IF NOT EXISTS #request.tableName# (
id SERIAL PRIMARY KEY,
value INTEGER NOT NULL
)
</cfquery>
<cfcatch type="database"></cfcatch>
</cftry>
<cfreturn true />
</cffunction>