mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 09:49:28 +02:00
Update comments table
This commit is contained in:
parent
177ed74008
commit
6f6b970498
6 changed files with 56 additions and 22 deletions
|
@ -157,8 +157,8 @@ http {
|
||||||
# Allow localhost and internal Docker network
|
# Allow localhost and internal Docker network
|
||||||
allow 127.0.0.1;
|
allow 127.0.0.1;
|
||||||
|
|
||||||
# Allow requests from the entire 172.0.0.0/8 range
|
# Allow all IPs in the 172.* range
|
||||||
allow 172.16.0.0/12;
|
allow 172.0.0.0/8;
|
||||||
|
|
||||||
# Deny all other requests
|
# Deny all other requests
|
||||||
deny all;
|
deny all;
|
||||||
|
|
|
@ -5,7 +5,7 @@ if (file_exists("../videos/configuration.php")) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$installationVersion = "14.4";
|
$installationVersion = "14.6";
|
||||||
|
|
||||||
require_once '../objects/functionsSecurity.php';
|
require_once '../objects/functionsSecurity.php';
|
||||||
|
|
||||||
|
|
|
@ -260,25 +260,28 @@ CREATE TABLE IF NOT EXISTS `videos_metadata` (
|
||||||
ON UPDATE CASCADE
|
ON UPDATE CASCADE
|
||||||
) ENGINE = InnoDB;
|
) ENGINE = InnoDB;
|
||||||
|
|
||||||
-- -----------------------------------------------------
|
|
||||||
-- Table `comments`
|
|
||||||
-- -----------------------------------------------------
|
|
||||||
CREATE TABLE IF NOT EXISTS `comments` (
|
CREATE TABLE IF NOT EXISTS `comments` (
|
||||||
`id` INT NOT NULL AUTO_INCREMENT,
|
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||||
`comment` TEXT NOT NULL,
|
`comment` TEXT NOT NULL,
|
||||||
`videos_id` INT NOT NULL,
|
`videos_id` INT(11) NOT NULL,
|
||||||
`users_id` INT NOT NULL,
|
`users_id` INT(11) NOT NULL,
|
||||||
`created` DATETIME NOT NULL,
|
`created` DATETIME NOT NULL,
|
||||||
`modified` DATETIME NOT NULL,
|
`modified` DATETIME NOT NULL,
|
||||||
`comments_id_pai` INT NULL,
|
`comments_id_pai` INT(11) NULL DEFAULT NULL,
|
||||||
`pin` INT(1) NOT NULL DEFAULT 0 COMMENT 'If = 1 will be on the top',
|
`pin` INT(1) NOT NULL DEFAULT 0 COMMENT 'If = 1 will be on the top',
|
||||||
|
`live_transmitions_history_id` INT(11) NULL DEFAULT NULL,
|
||||||
|
`created_php_time` BIGINT UNSIGNED NULL,
|
||||||
|
`modified_php_time` BIGINT UNSIGNED NULL,
|
||||||
|
`chat_messages_id` INT(11) UNSIGNED NULL,
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
INDEX `fk_comments_videos1_idx` (`videos_id` ASC),
|
INDEX `fk_comments_videos1_idx` (`videos_id` ASC),
|
||||||
INDEX `fk_comments_users1_idx` (`users_id` ASC),
|
INDEX `fk_comments_users1_idx` (`users_id` ASC),
|
||||||
INDEX `fk_comments_comments1_idx` (`comments_id_pai` ASC),
|
INDEX `fk_comments_comments1_idx` (`comments_id_pai` ASC),
|
||||||
CONSTRAINT `fk_comments_videos1`
|
INDEX `fk_comments_live_transmitions_history1_idx` (`live_transmitions_history_id` ASC),
|
||||||
FOREIGN KEY (`videos_id`)
|
INDEX `chat_messages_comments` (`chat_messages_id` ASC),
|
||||||
REFERENCES `videos` (`id`)
|
CONSTRAINT `fk_comments_comments1`
|
||||||
|
FOREIGN KEY (`comments_id_pai`)
|
||||||
|
REFERENCES `comments` (`id`)
|
||||||
ON DELETE CASCADE
|
ON DELETE CASCADE
|
||||||
ON UPDATE CASCADE,
|
ON UPDATE CASCADE,
|
||||||
CONSTRAINT `fk_comments_users1`
|
CONSTRAINT `fk_comments_users1`
|
||||||
|
@ -286,11 +289,16 @@ CREATE TABLE IF NOT EXISTS `comments` (
|
||||||
REFERENCES `users` (`id`)
|
REFERENCES `users` (`id`)
|
||||||
ON DELETE CASCADE
|
ON DELETE CASCADE
|
||||||
ON UPDATE CASCADE,
|
ON UPDATE CASCADE,
|
||||||
CONSTRAINT `fk_comments_comments1`
|
CONSTRAINT `fk_comments_videos1`
|
||||||
FOREIGN KEY (`comments_id_pai`)
|
FOREIGN KEY (`videos_id`)
|
||||||
REFERENCES `comments` (`id`)
|
REFERENCES `videos` (`id`)
|
||||||
ON DELETE CASCADE
|
ON DELETE CASCADE
|
||||||
ON UPDATE CASCADE)
|
ON UPDATE CASCADE,
|
||||||
|
CONSTRAINT `fk_comments_live_transmitions_history1`
|
||||||
|
FOREIGN KEY (`live_transmitions_history_id`)
|
||||||
|
REFERENCES `live_transmitions_history` (`id`)
|
||||||
|
ON DELETE SET NULL
|
||||||
|
ON UPDATE SET NULL)
|
||||||
ENGINE = InnoDB;
|
ENGINE = InnoDB;
|
||||||
|
|
||||||
|
|
||||||
|
|
17
updatedb/updateDb.v14.5.sql
Normal file
17
updatedb/updateDb.v14.5.sql
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
ALTER TABLE `comments`
|
||||||
|
ADD COLUMN `live_transmitions_history_id` INT(11) NULL DEFAULT NULL,
|
||||||
|
ADD INDEX `fk_comments_live_transmitions_history1_idx` (`live_transmitions_history_id`),
|
||||||
|
ADD CONSTRAINT `fk_comments_live_transmitions_history1`
|
||||||
|
FOREIGN KEY (`live_transmitions_history_id`)
|
||||||
|
REFERENCES `live_transmitions_history` (`id`)
|
||||||
|
ON DELETE SET NULL
|
||||||
|
ON UPDATE SET NULL;
|
||||||
|
|
||||||
|
ALTER TABLE `comments`
|
||||||
|
ADD COLUMN `created_php_time` BIGINT UNSIGNED NULL;
|
||||||
|
|
||||||
|
ALTER TABLE `comments`
|
||||||
|
ADD COLUMN `modified_php_time` BIGINT UNSIGNED NULL;
|
||||||
|
|
||||||
|
-- Update the version in configurations table
|
||||||
|
UPDATE configurations SET version = '14.5', modified = now() WHERE id = 1;
|
8
updatedb/updateDb.v14.6.sql
Normal file
8
updatedb/updateDb.v14.6.sql
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
ALTER TABLE `comments`
|
||||||
|
ADD COLUMN `chat_messages_id` INT(11) NULL DEFAULT NULL;
|
||||||
|
|
||||||
|
ALTER TABLE `comments`
|
||||||
|
ADD INDEX `chat_messages_comments` (`chat_messages_id`);
|
||||||
|
|
||||||
|
-- Update the version in configurations table
|
||||||
|
UPDATE configurations SET version = '14.6', modified = now() WHERE id = 1;
|
|
@ -138,6 +138,7 @@ $_page->setExtraScripts(
|
||||||
}
|
}
|
||||||
$templine .= $line;
|
$templine .= $line;
|
||||||
if (substr(trim($line), -1, 1) == ';') {
|
if (substr(trim($line), -1, 1) == ';') {
|
||||||
|
//echo $templine;echo '<br><br>';
|
||||||
if (!$global['mysqli']->query($templine)) {
|
if (!$global['mysqli']->query($templine)) {
|
||||||
$obj->error = ('Error performing query \'<strong>' . $templine . '\': ' . $global['mysqli']->error . '<br /><br />');
|
$obj->error = ('Error performing query \'<strong>' . $templine . '\': ' . $global['mysqli']->error . '<br /><br />');
|
||||||
echo json_encode($obj);
|
echo json_encode($obj);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue