/*===============================================================*/
/* Upgrade struktury z wersji 79 do 80                           */
/*                                                               */
/* ponieważ zmienia się typ kolumny, trzeba przekopiować całą    */
/* tablicę                                                       */
/*===============================================================*/
CREATE TABLE Phrase_copy (
   PhraseId             INTEGER              PRIMARY KEY AUTOINCREMENT,
   IsActive             smallint             NOT NULL,
   Type                 int                  NOT NULL,
   Text                 text(255)            NOT NULL,
   PriceLevel           int                  NOT NULL,
   ExternalId           text(20)             NULL,
   Creation             datetime             NOT NULL,
   LastUpdate           datetime             NOT NULL
)
GO

INSERT INTO Phrase_copy (PhraseId, IsActive, Type, Text, PriceLevel, ExternalId, Creation, LastUpdate)
SELECT PhraseId, IsActive, Type, Text, PriceLevel, ExternalId, Creation, LastUpdate FROM Phrase
GO

DROP TABLE Phrase
GO

ALTER TABLE Phrase_copy RENAME TO Phrase
GO

UPDATE StructureVersion SET Version = 80
GO