Updated Jules Jordan scraper.
This commit is contained in:
@@ -1552,6 +1552,11 @@ exports.up = (knex) => Promise.resolve()
|
||||
.defaultTo(knex.fn.now());
|
||||
}))
|
||||
.then(() => knex.schema.createTable('random_campaign', (table) => {
|
||||
table.integer('id')
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('campaigns');
|
||||
|
||||
table.text('banner_id')
|
||||
.references('id')
|
||||
.inTable('banners');
|
||||
@@ -1903,7 +1908,7 @@ exports.up = (knex) => Promise.resolve()
|
||||
CREATE FUNCTION get_random_campaign(min_ratio decimal default 0, max_ratio decimal default 1000.0) RETURNS random_campaign AS $$
|
||||
SELECT * FROM (
|
||||
SELECT DISTINCT ON (CASE WHEN parent_id IS NOT NULL THEN parent_id ELSE entity_id END)
|
||||
banner_id, url, entity_id, affiliate_id, parent_id
|
||||
id, banner_id, url, entity_id, affiliate_id, parent_id
|
||||
FROM (
|
||||
SELECT
|
||||
campaigns.*, entities.parent_id as parent_id
|
||||
|
||||
Reference in New Issue
Block a user