summaryrefslogtreecommitdiff
path: root/crawler/database.go
diff options
context:
space:
mode:
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