summaryrefslogtreecommitdiff
path: root/crawler/database.go
diff options
context:
space:
mode:
authorhorus2018-02-14 22:52:22 +0100
committerhorus2018-02-14 22:52:22 +0100
commit6140c5b7234b97d4a7b4bb26c87d316b3734f777 (patch)
tree57e4a2f597e114816149184871517dd419065a83 /crawler/database.go
parent2692360f15a79be87d656f94c997e2ab34221ced (diff)
downloadalkobote-6140c5b7234b97d4a7b4bb26c87d316b3734f777.tar.gz
Add shop short url. (crawler)
Diffstat (limited to 'crawler/database.go')
-rw-r--r--crawler/database.go3
1 files changed, 2 insertions, 1 deletions
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