source: trunk/SQL/Update.php

Last change on this file was 67, checked in by chronos, 2 years ago
  • Added: Show new meet menu for insertion of new advertisement on import source web.
File size: 3.8 KB
Line 
1ALTER TABLE `MeetItem` ADD `Link` VARCHAR(255) NOT NULL AFTER `Location`;
2
3UPDATE `MeetItem` SET `Age`=0 WHERE `Age`="";
4ALTER TABLE `MeetItem` CHANGE `Age` `Age` INT NULL DEFAULT NULL;
5UPDATE `MeetItem` SET `Age`=NULL WHERE `Age`=0;
6UPDATE `MeetItem` SET `Height`=0 WHERE `Height`="";
7ALTER TABLE `MeetItem` CHANGE `Height` `Height` INT NULL DEFAULT NULL;
8UPDATE `MeetItem` SET `Height`=NULL WHERE `Height`=0;
9UPDATE `MeetItem` SET `Weight`=0 WHERE `Weight`="";
10ALTER TABLE `MeetItem` CHANGE `Weight` `Weight` INT NULL DEFAULT NULL;
11UPDATE `MeetItem` SET `Weight`=NULL WHERE `Weight`=0;
12
13ALTER TABLE `MeetItem` CHANGE `Date` `Time` DATETIME NOT NULL;
14
15ALTER TABLE `MeetItem` ADD `TimeImport` DATETIME NULL AFTER `Link`;
16
17-- rev 35
18CREATE TABLE `Movie` (
19 `Id` int(11) NOT NULL,
20 `NameCz` varchar(255) NOT NULL,
21 `NameEn` varchar(255) NOT NULL,
22 `Year` int(11) NOT NULL,
23 `Imdb` varchar(255) NOT NULL,
24 `Csfd` varchar(255) NOT NULL
25) ENGINE=InnoDB DEFAULT CHARSET=utf8;
26
27ALTER TABLE `Movie`
28 ADD PRIMARY KEY (`Id`),
29 ADD KEY `Year` (`Year`);
30
31ALTER TABLE `Movie`
32 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
33
34CREATE TABLE `DanceFigure` (
35 `Id` int(11) NOT NULL,
36 `NameCz` varchar(255) NOT NULL,
37 `NameEn` varchar(255) NOT NULL,
38 `Dance` int(11) NOT NULL
39) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
40
41ALTER TABLE `DanceFigure`
42 ADD PRIMARY KEY (`Id`),
43 ADD UNIQUE KEY `Id` (`Id`),
44 ADD KEY `Dance` (`Dance`);
45
46ALTER TABLE `DanceFigure`
47 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT;
48
49ALTER TABLE `DanceFigure`
50 ADD CONSTRAINT `DanceFigure_ibfk_1` FOREIGN KEY (`Dance`) REFERENCES `Dance` (`Id`);
51
52ALTER TABLE `MeetItem`
53 ADD COLUMN `RemoteId` VARCHAR(255) NULL DEFAULT NULL AFTER `TimeImport`;
54
55-- rev 48
56ALTER TABLE `MeetItem`
57 ADD COLUMN `Hidden` INT NULL DEFAULT '0' AFTER `RemoteId`;
58
59-- rev 51
60CREATE TABLE IF NOT EXISTS `Event` (
61 `Id` int(11) NOT NULL AUTO_INCREMENT,
62 `TimeFrom` datetime DEFAULT NULL,
63 `TimeTo` datetime DEFAULT NULL,
64 `Source` int(11) DEFAULT NULL,
65 `Link` varchar(255) DEFAULT NULL,
66 `Hidden` int(11) DEFAULT 0,
67 `Description` text DEFAULT NULL,
68 `Title` varchar(255) DEFAULT NULL,
69 `Price` int(11) DEFAULT NULL,
70 `Location` varchar(255) DEFAULT NULL,
71 `TimeImport` datetime DEFAULT NULL,
72 `RemoteId` varchar(255) DEFAULT NULL,
73 PRIMARY KEY (`Id`),
74 KEY `Source` (`Source`)
75) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4;
76
77CREATE TABLE IF NOT EXISTS `EventSource` (
78 `Id` int(11) NOT NULL AUTO_INCREMENT,
79 `Name` varchar(255) DEFAULT NULL,
80 `Method` varchar(255) DEFAULT NULL,
81 `URL` varchar(255) DEFAULT NULL,
82 PRIMARY KEY (`Id`)
83) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4;
84
85ALTER TABLE `MeetSource` ADD `Enabled` int(11) NOT NULL DEFAULT 1;
86
87-- rev 65
88ALTER TABLE `Dance` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
89ALTER TABLE `DanceFigure` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
90ALTER TABLE `DanceGroup` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
91ALTER TABLE `Event` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
92ALTER TABLE `EventSource` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
93ALTER TABLE `MeetItem` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
94ALTER TABLE `MeetSource` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
95ALTER TABLE `Movie` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
96ALTER TABLE `Music` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
97ALTER TABLE `Resource` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
98ALTER TABLE `ResourceGroup` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
99ALTER TABLE `School` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
100
101-- rev 66
102ALTER TABLE `MeetSource` ADD `InsertURL` VARCHAR(255) NOT NULL AFTER `Enabled`;
Note: See TracBrowser for help on using the repository browser.