/*==============================================================*/
/* Upgrade struktury z wersji 60 do 61                          */
/*==============================================================*/
DROP TABLE CustomerCardFormat
GO

CREATE TABLE CustomerCardFormat(
   CustomerCardFormatId 			INTEGER 		     PRIMARY KEY AUTOINCREMENT,
   IsActive                         INTEGER              not null,
   CodeLength                       INTEGER              not null,
   PrefixLength                     INTEGER              not null,
   YearLength                       INTEGER              not null,
   CustomerCodeLength               INTEGER              not null,
   DatePosition                     INTEGER              not null,
   DiscountIdPosition               INTEGER              not null,
   Prefix                           text(10)             not null,
   IsExpireDate						INTEGER              not null,
   IsMonth							INTEGER              not null,
   IsControlDigit					INTEGER              not null,
   IsAutoRecognize                  INTEGER              not null,
   ExternalId						text(20)             null,
   Creation                         datetime             not null,
   LastUpdate                       datetime             not null
)
GO

ALTER TABLE DiscountLevel ADD COLUMN Name text(40) not null DEFAULT ''
GO

UPDATE StructureVersion SET Version = 61
GO
