修复新建数据库缺少is_deleted列的问题
在CREATE TABLE语句中直接添加is_deleted字段,确保新建数据库时就包含该列。 修改了三个表的建表语句: - fabrics表 - fabric_stock_in表 - fabric_consumption表 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -42,7 +42,8 @@ class DatabaseManager:
|
|||||||
unit TEXT DEFAULT '米',
|
unit TEXT DEFAULT '米',
|
||||||
timestamp TEXT,
|
timestamp TEXT,
|
||||||
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||||
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
is_deleted INTEGER DEFAULT 0
|
||||||
)
|
)
|
||||||
''')
|
''')
|
||||||
|
|
||||||
@@ -194,6 +195,7 @@ class DatabaseManager:
|
|||||||
note TEXT,
|
note TEXT,
|
||||||
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||||
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
is_deleted INTEGER DEFAULT 0,
|
||||||
FOREIGN KEY (model) REFERENCES fabrics(model)
|
FOREIGN KEY (model) REFERENCES fabrics(model)
|
||||||
)
|
)
|
||||||
''')
|
''')
|
||||||
@@ -216,6 +218,7 @@ class DatabaseManager:
|
|||||||
unit TEXT,
|
unit TEXT,
|
||||||
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||||
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
is_deleted INTEGER DEFAULT 0,
|
||||||
FOREIGN KEY (style_number) REFERENCES garments(style_number),
|
FOREIGN KEY (style_number) REFERENCES garments(style_number),
|
||||||
FOREIGN KEY (model) REFERENCES fabrics(model)
|
FOREIGN KEY (model) REFERENCES fabrics(model)
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user