-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0a0fe53
commit b569b0f
Showing
4 changed files
with
127,165 additions
and
4 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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"selectQuery" : "SELECT i.id, i.title, i.description, i.file, i.content, COALESCE(SUM(CASE WHEN a.isUpvote THEN 1 ELSE -1 END),0) AS rating FROM submissions AS i LEFT JOIN votes AS a ON i.id = a.post GROUP BY i.id", | ||
"updateQuery" : "SELECT i.id, i.title, i.description, i.file, i.content, COALESCE(SUM(CASE WHEN a.isUpvote THEN 1 ELSE -1 END),0) AS rating FROM submissions AS i LEFT JOIN votes AS a ON i.id = a.post WHERE i.updated > _$ GROUP BY i.id", | ||
"primaryField" : "id", | ||
"updatedAtField": "updated", | ||
"source" : "jdbc:mysql://HostnameOfYourDatabase/YourDatabaseName", | ||
"username" : "Your MYSQL Username", | ||
"password" : "Your MYSQL Password", | ||
"applicationId" : "Your Algolia Application ID", | ||
"apiKey" : "Your Algolia API Key", | ||
"index" : "Your Algolia Index Name", | ||
} |
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,101 @@ | ||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; | ||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; | ||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; | ||
/*!40101 SET NAMES utf8 */; | ||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; | ||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; | ||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; | ||
|
||
|
||
# Dump of table purchases | ||
# ------------------------------------------------------------ | ||
|
||
DROP TABLE IF EXISTS `purchases`; | ||
|
||
CREATE TABLE `purchases` ( | ||
`item` int(11) unsigned NOT NULL AUTO_INCREMENT, | ||
`user` int(11) DEFAULT NULL, | ||
`cost` tinyint(1) DEFAULT NULL, | ||
PRIMARY KEY (`item`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=latin1; | ||
|
||
|
||
|
||
# Dump of table sessions | ||
# ------------------------------------------------------------ | ||
|
||
DROP TABLE IF EXISTS `sessions`; | ||
|
||
CREATE TABLE `sessions` ( | ||
`id` int(11) NOT NULL, | ||
`sid` varchar(255) NOT NULL, | ||
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
UNIQUE KEY `key` (`sid`), | ||
KEY `index` (`id`), | ||
CONSTRAINT `sessions_ibfk_1` FOREIGN KEY (`id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, | ||
CONSTRAINT `sessions_ibfk_2` FOREIGN KEY (`id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, | ||
CONSTRAINT `sessions_ibfk_4` FOREIGN KEY (`id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE | ||
) ENGINE=InnoDB DEFAULT CHARSET=latin1; | ||
|
||
|
||
|
||
# Dump of table submissions | ||
# ------------------------------------------------------------ | ||
|
||
DROP TABLE IF EXISTS `submissions`; | ||
|
||
CREATE TABLE `submissions` ( | ||
`id` int(11) NOT NULL AUTO_INCREMENT, | ||
`title` varchar(255) NOT NULL, | ||
`description` text NOT NULL, | ||
`hash` char(40) NOT NULL DEFAULT '', | ||
`file` varchar(255) DEFAULT NULL, | ||
`size` int(20) DEFAULT NULL, | ||
`user` int(11) DEFAULT NULL, | ||
`updated` timestamp NOT NULL ON UPDATE CURRENT_TIMESTAMP, | ||
PRIMARY KEY (`id`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=latin1; | ||
|
||
|
||
|
||
# Dump of table users | ||
# ------------------------------------------------------------ | ||
|
||
DROP TABLE IF EXISTS `users`; | ||
|
||
CREATE TABLE `users` ( | ||
`id` int(11) NOT NULL AUTO_INCREMENT, | ||
`username` varchar(255) NOT NULL, | ||
`email` varchar(255) NOT NULL, | ||
`password` char(40) NOT NULL, | ||
`creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
`confirmed` tinyint(1) NOT NULL DEFAULT '0', | ||
`spent` int(11) NOT NULL, | ||
`trusted` tinyint(1) NOT NULL DEFAULT '0', | ||
UNIQUE KEY `username` (`username`), | ||
KEY `index` (`id`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=latin1; | ||
|
||
|
||
|
||
# Dump of table votes | ||
# ------------------------------------------------------------ | ||
|
||
DROP TABLE IF EXISTS `votes`; | ||
|
||
CREATE TABLE `votes` ( | ||
`post` int(11) NOT NULL, | ||
`user` int(11) NOT NULL, | ||
`isUpvote` tinyint(1) NOT NULL DEFAULT '0', | ||
UNIQUE KEY `unique_index` (`post`,`user`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=latin1; | ||
|
||
|
||
|
||
|
||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; | ||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; | ||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; | ||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; | ||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; | ||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; |
Oops, something went wrong.