upgrade.sql

来自「Bug管理系统」· SQL 代码 · 共 30 行

SQL
30
字号
-- Run this, or portions of this, to upgrade from one
-- version to another.

-- upgrade from 2.0.6 to 2.0.7
alter table bug_attachments add ba_comment int null

/*
The SQL below might be something you want to try.  It attempts to guess
the relationship of an attachment to a comment by looking at how 
close in time they were added.  If it's just a couple seconds a part,
I assume they are related.   For me, where I have just a few users
on the system, this heuristic makes sense.   I wouldn't use it if
I had a lot of users.
*/

/*
select ba_id, bc_id 
into #t 
from bug_attachments
inner join bug_comments on ba_bug = bc_bug and 
abs(datediff(s,ba_uploaded_date, bc_date)) < 4  -- 3 seconds or less

update bug_attachments
set ba_comment = #t.bc_id
from #t where bug_attachments.ba_id = #t.ba_id

drop table #t

*/

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?