home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
95.86.62.111
/
95.86.62.111.tar
/
95.86.62.111
/
ArhivaCela2612015.rar
/
ArhivaCela2612015
/
sql
/
Upgrade.sql
< prev
next >
Wrap
Text File
|
2015-01-24
|
3KB
|
195 lines
--26.02.2010
BEGIN TRANSACTION
ALTER TABLE dbo.ArhPodVidDok ADD
Naslov1 nvarchar(100) NULL,
Naslov2 nvarchar(100) NULL,
Naslov3 nvarchar(100) NULL
GO
COMMIT
--16.12.2010
BEGIN TRANSACTION
ALTER TABLE dbo.ArhDokumenti ADD
PatekaDok varchar(500) NULL
GO
COMMIT
--15.07.2011
BEGIN TRANSACTION
ALTER TABLE dbo.ArhDocSliki ADD
PatekaDoc nvarchar(200) NULL
GO
COMMIT
--07.11.2011
BEGIN TRANSACTION
CREATE TABLE dbo.ArhDokrVrska
(
Delov_God smallint NOT NULL,
Arh_Broj int NOT NULL,
PodBroevi int NOT NULL,
Sifra_Oe smallint NOT NULL,
Sifra_Dok smallint NOT NULL,
Broj_Dok int NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE dbo.ArhDokrVrska ADD CONSTRAINT
PK_ArhDokrVrska PRIMARY KEY CLUSTERED
(
Delov_God,
Arh_Broj,
PodBroevi,
Sifra_Oe,
Sifra_Dok,
Broj_Dok
) ON [PRIMARY]
GO
ALTER TABLE dbo.ArhDokrVrska ADD CONSTRAINT
FK_ArhDokrVrska_ArhDokumenti FOREIGN KEY
(
Delov_God,
Arh_Broj,
PodBroevi
) REFERENCES dbo.ArhDokumenti
(
Delov_God,
Arh_Broj,
PodBroevi
)
GO
COMMIT
--15.02.2012
BEGIN TRANSACTION
ALTER TABLE dbo.ArhDokumenti ADD
Vaznost_Dok smalldatetime NULL
GO
COMMIT
--23.05.2014--
BEGIN TRANSACTION
CREATE TABLE dbo.ArhDokrVrskaNxSe
(
Sifra_Oe smallint NOT NULL,
Sifra_Dok smallint NOT NULL,
Broj_Dok int NOT NULL,
Delov_God smallint NOT NULL,
Arh_Broj int NOT NULL,
PodBroevi int NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE dbo.ArhDokrVrskaNxSe ADD CONSTRAINT
PK_Table_1_1 PRIMARY KEY CLUSTERED
(
Sifra_Oe,
Sifra_Dok,
Broj_Dok
) ON [PRIMARY]
COMMIT
Go
BEGIN TRANSACTION
ALTER TABLE dbo.ArhDokrVrskaNxSe ADD CONSTRAINT
IX_ArhDokrVrskaNxSe UNIQUE NONCLUSTERED
(
Delov_God,
PodBroevi,
Arh_Broj
) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX IX_ArhDokrVrskaNxSe_1 ON dbo.ArhDokrVrskaNxSe
(
Sifra_Oe
) ON [PRIMARY]
COMMIT
BEGIN TRANSACTION
GO
ALTER TABLE dbo.ArhDokrVrskaNxSe ADD
ArhSifra_OE smallint NULL
GO
COMMIT
BEGIN TRANSACTION
GO
ALTER TABLE dbo.ArhDokrVrskaNxSe
DROP CONSTRAINT IX_ArhDokrVrskaNxSe
GO
ALTER TABLE dbo.ArhDokrVrskaNxSe ADD CONSTRAINT
IX_ArhDokrVrskaNxSe UNIQUE NONCLUSTERED
(
Delov_God,
PodBroevi,
Arh_Broj,
ArhSifra_OE
) ON [PRIMARY]
GO
COMMIT
--03.12.2014--
BEGIN TRANSACTION
CREATE TABLE [dbo].[ArhKonfMeniUser](
[OznPC] [varchar](20) NULL,
[Sifra_GrKor] [varchar](20) NULL,
[RbrMeni] [smallint] NULL,
[PodMeni] [varchar](30) NULL,
[RbrMoznost] [smallint] NULL,
[Moznost] [varchar](30) NULL,
[rbr] [int] NOT NULL,
[Sifra_Meni] [varchar](30) NULL
)
GO
COMMIT
BEGIN TRANSACTION
CREATE TABLE [dbo].[KonfArhDozvBr](
[Sifra_GrKor] [varchar](20) NOT NULL,
[Sifra_OE] [smallint] NOT NULL,
[Delov_God] [smallint] NOT NULL,
[Arh_Broj] [int] NOT NULL,
)
GO
COMMIT
BEGIN TRANSACTION
CREATE UNIQUE NONCLUSTERED INDEX IX_KonfArhDozvBr ON dbo.KonfArhDozvBr
(
Sifra_GrKor,
Sifra_OE,
Delov_God,
Arh_Broj
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[KonfArhDozvBr] ADD CONSTRAINT
FK_KonfArhDozvBr_OrgEd FOREIGN KEY
(
Sifra_OE
) REFERENCES dbo.OrgEd
(
Sifra_OE
)
GO
COMMIT
BEGIN TRANSACTION
CREATE TABLE [dbo].[KonfArhDokAvt](
[Delov_God] [smallint] NULL,
[Sif_GrOrg] [varchar](6) NULL,
[Sifra_Dok] [smallint] NULL,
[Sifra_Nal] [smallint] NULL,
[Sif_PodVid] [char](4) NULL,
[Arh_Broj] [int] NULL
) ON [PRIMARY]
GO
COMMIT