Azure mobile apps net客户端使用默认值添加新列
我已经有一个名为User.cs的模型类,它具有一些属性:Azure mobile apps net客户端使用默认值添加新列,azure,azure-mobile-services,Azure,Azure Mobile Services,我已经有一个名为User.cs的模型类,它具有一些属性: [JsonProperty(PropertyName = "admin")] public bool Admin { get; set; } [JsonProperty(PropertyName = "email")] public string Email { get; set; } 这给了我sqlite数据库中的admin和email列。 现在我正在更新我的应用程序。我想添加一个新属性,从而添加一个新列: [JsonPropert
[JsonProperty(PropertyName = "admin")]
public bool Admin { get; set; }
[JsonProperty(PropertyName = "email")]
public string Email { get; set; }
这给了我sqlite数据库中的admin和email列。
现在我正在更新我的应用程序。我想添加一个新属性,从而添加一个新列:
[JsonProperty(PropertyName = "owner")]
public bool Owner { get; set; }
当我将其添加到User.cs时,sqlite文件将获得一个名为owner的新列。sqlite文件的用户表中的所有现有行都会获取此新列的值NULL
我的问题:如何将现有行的值设为0(false)。根据需要,您可以做一些事情。最明显的是:
- 在服务器上更新模型以添加所有者字段
- 使用默认值更新数据库李>
- 在客户端第一次运行时(更新后),擦除SQLite数据库并重新同步所有数据