summaryrefslogtreecommitdiff
path: root/lib/db
diff options
context:
space:
mode:
Diffstat (limited to 'lib/db')
-rw-r--r--lib/db/index.js23
1 files changed, 0 insertions, 23 deletions
diff --git a/lib/db/index.js b/lib/db/index.js
index 468d9be..a74ba89 100644
--- a/lib/db/index.js
+++ b/lib/db/index.js
@@ -54,26 +54,3 @@ db.crud = function(type, model) {
},
}
}
-db.getFolders = function(id) {
- var model = new Folder({'id': id})
- return model.fetch()
-}
-db.getFolderFiles = function(id) {
- return File.query(function(qb){
- qb.where('folder_id', '=', id).orderBy("id", "desc")
- }).fetch()
-}
-db.getLatest = function () {
- return Image.query(function(qb){
- qb.orderBy("id", "desc").limit(1)
- }).fetch()
-}
-db.getRandom = function () {
- return Image.query(function(qb){
- qb.orderBy(knex.raw('RAND()')).limit(1)
- }).fetch()
-}
-
-db.createImage = function(url){
- return new Image({ url: url, shorturl: "" }).save()
-} \ No newline at end of file