Changeset 452 for trunk/sql/updates/446.sql
- Timestamp:
- Oct 28, 2012, 10:20:32 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sql/updates/446.sql
r451 r452 1 ALTER TABLE SystemVersion CHANGE COLUMN Rev44 1 Rev445bit;1 ALTER TABLE SystemVersion CHANGE COLUMN Rev445 Rev446 bit; 2 2 3 3 RENAME TABLE `Product` TO `ProductOld` ; … … 13 13 `Product` int(11) NOT NULL, 14 14 `TimeEnlistment` date NOT NULL, 15 `TimeElimination` date NOT NULL, 16 `Amount` float NOT NULL, 15 `TimeElimination` date NULL, 16 `BuyPrice` DECIMAL NOT NULL, 17 `SellPrice` DECIMAL NOT NULL, 17 18 `SerialNumber` varchar(255) COLLATE utf8_czech_ci NOT NULL, 18 19 `Location` int(11) DEFAULT NULL COMMENT 'Member', 19 `Segment` int(11) NOT NULL, 20 `Segment` int(11) NULL, 21 `Info` TEXT NOT NULL, 20 22 PRIMARY KEY (`Id`), 21 KEY `Location` (`Location`),22 23 KEY `Product` (`Product`), 23 24 KEY `Stock` (`Stock`), 24 KEY `Segment` (`Segment`) 25 KEY `Segment` (`Segment`), 26 KEY `Location` (`Location`) 25 27 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=3 ; 26 28 … … 30 32 ADD CONSTRAINT `StockItem_ibfk_3` FOREIGN KEY (`Location`) REFERENCES `Member` (`Id`), 31 33 ADD CONSTRAINT `StockItem_ibfk_5` FOREIGN KEY (`Product`) REFERENCES `Product` (`Id`); 32 ALTER TABLE `StockItem` CHANGE `Segment` `Segment` INT( 11 ) NULL;33 ALTER TABLE `StockItem` ADD `Info` TEXT NOT NULL ;34 ALTER TABLE `StockItem` CHANGE `TimeElimination` `TimeElimination` DATE NULL;35 34 36 ALTER TABLE `Stock` ADD `Location` INT NULL , ADD INDEX ( `Location` );35 ALTER TABLE `Stock` ADD `Location` INT NULL ; 37 36 ALTER TABLE `Stock` ADD FOREIGN KEY ( `Location` ) REFERENCES `Member` (`Id`) ON DELETE RESTRICT ON UPDATE RESTRICT ; 38 39 40 41 37 42 38 … … 46 42 PRIMARY KEY (`Id`) 47 43 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ; 44 45 INSERT INTO `Language` (`Id`, `Name`) VALUES 46 (1, 'Česky'), 47 (2, 'Slovensky'), 48 (3, 'Anglicky'), 49 (4, 'Německy'), 50 (5, 'Slovensky'), 51 (6, 'Polsky'); 52 48 53 49 54 UPDATE `TV` SET Language=1 WHERE Language="česky"; … … 55 60 ALTER TABLE `TV` CHANGE `Language` `Language` INT( 11 ) NULL ; 56 61 UPDATE `TV` SET Language=NULL WHERE Language=0; 57 ALTER TABLE `TV` ADD INDEX ( `Language` );58 ALTER TABLE `TV` DROP INDEX ( `ShortName_2` );62 ALTER TABLE `TV` ADD INDEX `Language` ; 63 ALTER TABLE `TV` DROP INDEX `ShortName_2` ; 59 64 ALTER TABLE `TV` ADD FOREIGN KEY ( `Language` ) REFERENCES `Language` (`Id`) ON DELETE RESTRICT ON UPDATE RESTRICT ; 60 65 … … 84 89 ALTER TABLE `TV` ADD INDEX ( `Category` ); 85 90 ALTER TABLE `TV` ADD FOREIGN KEY ( `Category` ) REFERENCES `TVGroup` (`Id`) ON DELETE RESTRICT ON UPDATE RESTRICT ; 91 92 TRUNCATE TABLE `ISMenuItem`; 93 INSERT INTO `ISMenuItem` (`Id`, `Name`, `Parent`, `Table`) VALUES 94 (1, 'Síť', NULL, ''), 95 (2, 'Finance', NULL, ''), 96 (12, 'Obecné', NULL, ''), 97 (23, 'Systém', NULL, ''), 98 (27, 'Sklad', NULL, ''), 99 (3, 'Zařízení', 1, 'NetworkDevice'), 100 (4, 'Rozhraní', 1, 'NetworkInterface'), 101 (5, 'Příjmy a výdaje', 2, 'FinanceOperation'), 102 (6, 'Závazky a pohledávky', 2, 'FinanceClaimsLiabilities'), 103 (7, 'Typ zařízení', 1, 'NetworkDeviceType'), 104 (8, 'Typ rozhraní', 1, 'NetworkInterfaceType'), 105 (9, 'Doménové aliasy', 1, 'NetworkDomainAlias'), 106 (10, 'Bankovní účty', 2, 'FinanceBankAccount'), 107 (11, 'Pokladny', 2, 'FinanceTreasury'), 108 (13, 'Uživatelé', 12, 'User'), 109 (14, 'Subjekty', 12, 'Subject'), 110 (15, 'Země', 12, 'Country'), 111 (16, 'Produkty', 27, 'Product'), 112 (17, 'Sklady', 27, 'Stock'), 113 (18, 'Platební období', 2, 'FinanceBillingPeriod'), 114 (19, 'Tarify', 2, 'FinanceTariff'), 115 (20, 'Zákazníci', 2, 'Member'), 116 (22, 'Podsítě', 1, 'NetworkSubnet'), 117 (24, 'Záznamy', 23, 'Log'), 118 (25, 'Úkoly', 12, 'Task'), 119 (26, 'Kategorie úkolů', 12, 'TaskGroup'), 120 (28, 'Měrné jednotky', 27, 'UnitOfMeasure'), 121 (29, 'Skladové položky', 27, 'StockItem'), 122 (30, 'TV kanály', 12, 'TV'), 123 (31, 'Jazyky', 12, 'Language'), 124 (32, 'Kategorie TV kanálů', 12, 'TVGroup'), 125 (33, 'Účetní roky', 2, 'FinanceYear'), 126 (34, 'Dokladové řady', 2, 'DocumentLine'), 127 (35, 'Čísleník dokladové řady', 2, 'DocumentLineSequence');
Note:
See TracChangeset
for help on using the changeset viewer.