-
-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid long files name breaking the table
- Loading branch information
Showing
7 changed files
with
57 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,8 +33,8 @@ if (isset($argv[1]) && $argv[1] === '--install') { | |
$db->query("INSERT INTO `users` (`email`, `username`, `password`, `is_admin`, `user_code`) VALUES ('[email protected]', 'admin', ?, 1, ?)", [password_hash('admin', PASSWORD_DEFAULT), humanRandomString(5)]); | ||
} | ||
|
||
if (file_exists(__DIR__.'/../install')) { | ||
removeDirectory(__DIR__.'/../install'); | ||
if (file_exists(__DIR__.'/../install') && (!isset($config['debug']) || !$config['debug'])) { | ||
//removeDirectory(__DIR__.'/../install'); | ||
} | ||
|
||
echo 'If you are upgrading from a previous version, please run a "php bin\clean".'.PHP_EOL; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
CREATE TABLE IF NOT EXISTS `tags` ( | ||
`id` INTEGER PRIMARY KEY AUTO_INCREMENT, | ||
`name` VARCHAR(32) NOT NULL, | ||
`timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
INDEX (`name`) | ||
); | ||
|
||
CREATE TABLE IF NOT EXISTS `uploads_tags` ( | ||
`upload_id` INTEGER, | ||
`tag_id` INTEGER, | ||
PRIMARY KEY (`upload_id`, `tag_id`), | ||
FOREIGN KEY (`upload_id`) REFERENCES `uploads` (`id`) | ||
ON UPDATE CASCADE | ||
ON DELETE CASCADE, | ||
FOREIGN KEY (`tag_id`) REFERENCES `tags` (`id`) | ||
ON UPDATE CASCADE | ||
ON DELETE CASCADE | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
CREATE TABLE IF NOT EXISTS `tags` ( | ||
`id` INTEGER PRIMARY KEY AUTOINCREMENT, | ||
`name` VARCHAR(32) NOT NULL, | ||
`timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP | ||
); | ||
|
||
CREATE UNIQUE INDEX IF NOT EXISTS `tag_name` | ||
ON `tags` (`name`); | ||
|
||
CREATE TABLE IF NOT EXISTS `uploads_tags` ( | ||
`upload_id` INTEGER, | ||
`tag_id` INTEGER, | ||
PRIMARY KEY (`upload_id`, `tag_id`), | ||
FOREIGN KEY (`upload_id`) REFERENCES `uploads` (`id`) | ||
ON UPDATE CASCADE | ||
ON DELETE CASCADE, | ||
FOREIGN KEY (`tag_id`) REFERENCES `tags` (`id`) | ||
ON UPDATE CASCADE | ||
ON DELETE CASCADE | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters