我在使用合金的鈦工作室中創建了一些模型。我希望某些列是date
或boolean
,但在運行應用程序時它不接受它。爲什麼Titanium不接受日期作爲SQLite中的列類型?
以下數據類型被接受並映射到適當的 SQLite的類型:字符串,VARCHAR,INT,TINYINT,SMALLINT BIGINT,雙, 浮子,十進制,號碼,日期,日期時間和布爾值。
但是當我運行我的應用程序,我在控制檯中這條消息:
[WARN] : "date" is not a valid sqlite field, using TEXT instead
[WARN] : "date" is not a valid sqlite field, using TEXT instead
[WARN] : "boolean" is not a valid sqlite field, using INTEGER instead
[WARN] : "boolean" is not a valid sqlite field, using INTEGER instead
也許我的設置我的模型正確了?這裏是我的代碼:
exports.definition = {
config: {
columns: {
"availability_end": "date",
"availability_start": "date",
"deleted": "boolean",
"duration": "integer",
"title": "text",
},
adapter: {
type: "sql",
collection_name: "videos"
}
},
/* the rest of the model definition... */