update rating

This commit is contained in:
s416267 2018-12-16 20:04:51 +01:00
parent 0fc2b9a2a4
commit 1b1070786e
1 changed files with 27 additions and 10 deletions

View File

@ -3,7 +3,7 @@
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Czas generowania: 06 Gru 2018, 00:50
-- Czas generowania: 16 Gru 2018, 19:35
-- Wersja serwera: 10.1.36-MariaDB
-- Wersja PHP: 7.2.11
@ -57,7 +57,12 @@ CREATE TABLE `comments` (
INSERT INTO `comments` (`comment_id`, `post_id`, `username`, `tekst`, `data_dodania`, `data_modyfikacji`) VALUES
(1, 18, 'użytkownik testowy 1', 'Komentarz Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque nec ipsum ultrices, condimentum elit nec, luctus neque. Interdum et malesuada fames ac ante ipsum primis in faucibus. Donec eget ullamcorper ante. Donec fermentum erat nisi, eu dapibus neque ultrices et. Sed at sapien consectetur, iaculis dui non, sagittis mi. Nam consequat tempus felis at pretium. Cras ut lacus id ipsum interdum ullamcorper. In eget urna sed orci aliquam consequat. Morbi iaculis eros vel orci imperdiet ornare. Nulla quis dignissim ante. Etiam non rhoncus lectus, sit amet porta nunc. Cras at ultrices diam. Aenean arcu sapien, efficitur quis rutrum in, euismod et turpis.', '2018-12-01 22:11:16', '2018-12-01 22:11:16'),
(2, 18, 'użytkownik testowy 2', 'Drugi komentarz ale krótki Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque nec ipsum ultrices, condimentum elit nec, luctus neque. ', '2018-12-01 22:12:04', '2018-12-01 22:12:04'),
(5, 0, '', 'Sprawdzam czy dodawanie komentarzy działa, jeśli tak to bardzo się cieszę. Trzeba jeszcze ogarnąć żeby zaciągało użytkownika który jako zalogowany komentuje no i żeby nie wyświetlało opcji komentowania dla bobów, którzy nie są zalogowani :).', '2018-12-05 20:55:29', '2018-12-05 20:55:29');
(14, 14, '', 'aaaaaaaaaaaaaaaaaa', '2018-12-15 22:11:41', '2018-12-15 22:11:41'),
(15, 0, '', 'dsfdsfdsfdsfdsfdsfdsfdsfdsfdsf', '2018-12-15 22:15:35', '2018-12-15 22:15:35'),
(16, 15, 'test', 'zzzzzzzzzzzzzzzzzzz', '2018-12-15 22:19:39', '2018-12-15 22:19:39'),
(17, 15, 'test', 'komentarz sprawdzam', '2018-12-15 22:26:56', '2018-12-15 22:26:56'),
(20, 14, 'test', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaa', '2018-12-15 23:08:23', '2018-12-15 23:08:23'),
(25, 15, 'test2', 'sadasdadsdsa', '2018-12-16 19:32:40', '2018-12-16 19:32:40');
-- --------------------------------------------------------
@ -95,20 +100,20 @@ INSERT INTO `post` (`post_id`, `blog_id`, `tytul`, `opis`, `tekst`, `image`, `da
--
CREATE TABLE `rating` (
`rate_id` int(11) NOT NULL,
`post_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`rating` int(11) NOT NULL
`username` varchar(50) NOT NULL,
`rating` int(11) NOT NULL,
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin2;
--
-- Zrzut danych tabeli `rating`
--
INSERT INTO `rating` (`post_id`, `user_id`, `rating`) VALUES
(0, 0, 5),
(0, 0, 5),
(0, 0, 3),
(0, 0, 1);
INSERT INTO `rating` (`rate_id`, `post_id`, `username`, `rating`, `timestamp`) VALUES
(37, 15, 'test', 5, '2018-12-16 17:00:26'),
(66, 15, 'test2', 1, '2018-12-16 18:08:44');
-- --------------------------------------------------------
@ -160,6 +165,12 @@ ALTER TABLE `comments`
ALTER TABLE `post`
ADD PRIMARY KEY (`post_id`);
--
-- Indeksy dla tabeli `rating`
--
ALTER TABLE `rating`
ADD PRIMARY KEY (`rate_id`);
--
-- Indeksy dla tabeli `user`
--
@ -180,7 +191,7 @@ ALTER TABLE `blog`
-- AUTO_INCREMENT dla tabeli `comments`
--
ALTER TABLE `comments`
MODIFY `comment_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
MODIFY `comment_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26;
--
-- AUTO_INCREMENT dla tabeli `post`
@ -188,6 +199,12 @@ ALTER TABLE `comments`
ALTER TABLE `post`
MODIFY `post_id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;
--
-- AUTO_INCREMENT dla tabeli `rating`
--
ALTER TABLE `rating`
MODIFY `rate_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=83;
--
-- AUTO_INCREMENT dla tabeli `user`
--