IF NOT EXISTS (SELECT * FROM SYS.COLUMNS WHERE NAME = 'CD_PARC' AND OBJECT_ID = OBJECT_ID('RC_ADM_CARTAO_PARC_MINIMA'))
BEGIN
	ALTER TABLE RC_ADM_CARTAO_PARC_MINIMA ADD CD_PARC INT NOT NULL IDENTITY
END
GO

IF EXISTS(SELECT * FROM SYS.key_constraints WHERE TYPE = 'PK' AND NAME = 'PK_RC_ADM_CARTAO_PARC_MINIMA')
BEGIN
	ALTER TABLE RC_ADM_CARTAO_PARC_MINIMA DROP CONSTRAINT PK_RC_ADM_CARTAO_PARC_MINIMA
END
GO

ALTER TABLE RC_ADM_CARTAO_PARC_MINIMA ADD CONSTRAINT PK_RC_ADM_CARTAO_PARC_MINIMA PRIMARY KEY (CD_PARC)
GO

IF NOT EXISTS (SELECT * FROM SYS.COLUMNS WHERE NAME = 'DS_PARC' AND OBJECT_ID = OBJECT_ID('RC_ADM_CARTAO_PARC_MINIMA'))
BEGIN
	ALTER TABLE RC_ADM_CARTAO_PARC_MINIMA ADD DS_PARC VARCHAR(200) NOT NULL CONSTRAINT DF_RC_ADM_CARTAO_PARC_MINIMA_DS_PARC DEFAULT ''
END
GO
