数据库设计和同步框架 [英] Database design and sync framework

查看:96
本文介绍了数据库设计和同步框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望这是这个问题的正确论坛,但这更多的是设计问题而不是实施问题。我目前有一个应用程序使用数据库来跟踪工作订单,有两个表待定和已完成。 待定表
包含一个状态列,用于记录工作单是否已完成,有多个已完成的状态,或者是否仍处于待处理状态。待处理的工单被发送给几个技术人员,有时多个技术人员接受相同的工作
订单,在一天结束时,所有已完成的工单都存储在已完成的表中,并且所有待处理工单的状态将更新为待定表。这意味着已完成的所有待处理工单必须在待处理表中具有状态
,以反映当前的完成或待处理状态。为了增加一个问题,各种已完成的状态存在层次结构,因此排名较低的状态不能覆盖排名较高的状态。

I hope this is the proper forum for this question but this is more of a question of design than implementation. I currently have an application that uses an database to track work orders there are two tables Pending and Completed.  The Pending table contains a Status column that records whether the work order has been completed, there are several statuses for completed, or if its still pending. Pending work orders are sent out to several technicians, sometimes multiple technicians receive the same work order, at the end of the day all completed work orders are stored in the Completed table and the statuses of all pending work orders are updated in the Pending table. Which means all the pending work orders that have been completed must have their statuses in the Pending table reflect there current complete or pending status. To add one more problem there is a hierarchy to the various completed statuses so lower ranked statuses cannot overwrite higher ranked ones.

我已经建立了一个系统,当前每个已完成的工作单一个一次并做出所有适当的改变。它运行得非常好,但代码笨重,速度慢,而且非常准确。我一直在使用同步框架,但是对于我来说,到目前为止我遇到的麻烦似乎是一个全有或全无的同步过程。

I have in place a system that currently takes in each completed work order one at a time and makes all the appropriate changes. It works extremely well but the code is bulky, slow, and extremely accurate. I've been working with the sync framework but I'm having trouble with what so far to me seems an all or nothing sync process.

此时唯一的事情是我可以想到创建一个第三个表,在其中将所有工作转储到每个记录之前,进行我的更改然后清除临时表。

At this point the only thing I can think of is to create a third table in which to dump all work into before going through each record, making my changes and then clearing the temp table.

关于此的任何想法或建议不胜感激。谢谢

Any ideas or advice on this would be appreciated. Thank you

推荐答案

你好BrownRR,

Hi BrownRR,

如果我理解你的问题,你想要根据"已完成"表中的某些数据更改"待定"表中的"状态"列。您似乎想要执行业务逻辑,而您的问题与同步相关性较低。此外,Pending和Completed表的架构
是否相同?

If I understand your question correctly, you want to make changes to the status column in the Pending table based on some data in the Completed table. It seems like you want to do business logic and your problem is less related to sync. Also, is the schema of the Pending and Completed tables the same?


这篇关于数据库设计和同步框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆