create-fullstack-scaffold 0.6.2 → 0.6.4
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/package.json
CHANGED
package/template/package.json
CHANGED
|
@@ -105,11 +105,13 @@ export async function closeDb(): Promise<void> {
|
|
|
105
105
|
async function stampJournalIfPushBuilt(migrationsFolder: string): Promise<void> {
|
|
106
106
|
if (!_client || !('execute' in _client)) return
|
|
107
107
|
|
|
108
|
-
//
|
|
109
|
-
|
|
110
|
-
|
|
108
|
+
// 普适判定:库里有任何业务表 && 账本为空 = push 建库形态。
|
|
109
|
+
// 不能锚定具体表名——preset 组合差异大(forum/plugin 无 todos、
|
|
110
|
+
// 多数 preset 无 tenants,0.6.2/0.6.3 两次部署事故均源于此)
|
|
111
|
+
const bizTables = await _client.execute(
|
|
112
|
+
"SELECT COUNT(*) AS c FROM sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite_%' AND name != '__drizzle_migrations'"
|
|
111
113
|
)
|
|
112
|
-
if (Number(
|
|
114
|
+
if (Number(bizTables.rows[0]?.c ?? 0) < 1) return
|
|
113
115
|
|
|
114
116
|
const journalTable = await _client.execute(
|
|
115
117
|
"SELECT COUNT(*) AS c FROM sqlite_master WHERE type='table' AND name='__drizzle_migrations'"
|