From 6140c5b7234b97d4a7b4bb26c87d316b3734f777 Mon Sep 17 00:00:00 2001 From: horus Date: Wed, 14 Feb 2018 22:52:22 +0100 Subject: Add shop short url. (crawler) --- crawler/database.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'crawler/database.go') diff --git a/crawler/database.go b/crawler/database.go index d0bd632..1f38ca1 100644 --- a/crawler/database.go +++ b/crawler/database.go @@ -11,6 +11,7 @@ func (app *App) createTables() error { id INTEGER PRIMARY KEY AUTO_INCREMENT, name varchar(255) UNIQUE, url varchar(255) UNIQUE, + short_url TEXT, logo_url text, shipping_costs int, free_shipping text @@ -59,7 +60,7 @@ func (app *App) createTables() error { view_query := `CREATE OR REPLACE VIEW ` + v + `_view AS SELECT angebot.id, angebot.name, angebot.abv, angebot.volume, angebot.url as long_url, angebot.short_url as url,original_price/100 as original_price, discounted_price/100 as discounted_price, angebot.base_price/100 as base_price, image_url, - shop.name as shop, shop.url as shop_url, shop.shipping_costs/100 as shipping_costs, shop.free_shipping, ROUND(100-((discounted_price/original_price)*100)) AS procent, spirit_type, created_at + shop.name as shop, shop.short_url as shop_url, shop.shipping_costs/100 as shipping_costs, shop.free_shipping, ROUND(100-((discounted_price/original_price)*100)) AS procent, spirit_type, created_at FROM angebot JOIN shop ON angebot.shop = shop.id WHERE -- cgit v1.2.3