87 lines
1.9 KiB
Markdown
87 lines
1.9 KiB
Markdown
###### **FK 規則更新**
|
||
|
||
FK\_act\_bom\_actItem1 刪除規則設為 cascade
|
||
|
||
FK\_pro\_order\_followers 刪除規則設為 cascade
|
||
|
||
FK\_pro\_order\_activity 刪除規則設為 cascade
|
||
|
||
FK\_pro\_order\_detail\_pro\_order 刪除規則設為 cascade
|
||
|
||
FK\_pro\_order\_detail\_followers 刪除規則設為 沒有動作
|
||
|
||
FK\_activity\_relating\_activity 刪除規則設為 cascade
|
||
|
||
FK\_pro\_order\_auto\_enroll 刪除規則設為 NULL
|
||
|
||
|
||
|
||
###### **資料表欄位更新**
|
||
|
||
actitem 加上 sort\_order(int) 欄位
|
||
|
||
activity\_relating 加上 has\_yang\_limit(bit) 欄位
|
||
|
||
activity\_relating 加上 has\_chao\_limit(bit) 欄位
|
||
|
||
activity\_relating 加上 yang\_limit\_count(int) 欄位
|
||
|
||
activity\_relating 加上 chao\_limit\_count(int) 欄位
|
||
|
||
\## follower 加上 is\_auto\_enroll(bit) 欄位
|
||
|
||
\## follower 加上 auto\_enroll\_start\_date(datetime) 欄位
|
||
|
||
\## follower 加上 auto\_enroll\_receipt\_title(nvarchar(50)) 欄位
|
||
|
||
\## follower 加上 auto\_enroll\_receipt\_address(nvarchar(200)) 欄位
|
||
|
||
\## follower 加上 auto\_enroll\_is\_receipt(bit) 欄位
|
||
|
||
company 加上 last\_auto\_order\_no(nvarchar(20)) 欄位
|
||
|
||
pro\_order 加上 au\_num(int) 欄位 並加上 constraint:
|
||
|
||
	ALTER TABLE pro\_order
|
||
|
||
	ADD CONSTRAINT FK\_pro\_order\_auto\_enroll
|
||
|
||
	FOREIGN KEY (au\_num) REFERENCES auto\_enroll(num);
|
||
|
||
|
||
|
||
###### **新增資料表 auto\_enroll**
|
||
|
||
num int 不允許 Null
|
||
|
||
f\_num int 不允許 Null
|
||
|
||
start\_date date 允許 Null
|
||
|
||
end\_date date 允許 Null
|
||
|
||
receipt\_title nvarchar(MAX) 允許 Null
|
||
|
||
receipt\_address nchar(200) 不允許 Null
|
||
|
||
|
||
|
||
ALTER TABLE auto\_enroll
|
||
|
||
ADD CONSTRAINT FK\_auto\_enroll\_followers
|
||
|
||
FOREIGN KEY (f\_num) REFERENCES followers(num);
|
||
|
||
|
||
|
||
ALTER TABLE \[dbo].\[auto\_enroll]
|
||
|
||
ADD CONSTRAINT PK\_auto\_enroll PRIMARY KEY (num);
|
||
|
||
|
||
|
||
num 識別規格設為 是
|
||
|
||
Model.edmx auto\_enroll.num 屬性 StoreGeneratedPattern 設為 Identity
|
||
|