forked from DebaucheryLibrarian/traxxx
Added parameter affiliates.
This commit is contained in:
@@ -1285,8 +1285,10 @@ exports.up = knex => Promise.resolve()
|
||||
.inTable('entities');
|
||||
|
||||
table.text('url');
|
||||
table.text('parameters');
|
||||
|
||||
table.unique(['entity_id', 'url']);
|
||||
table.unique(['entity_id', 'parameters']);
|
||||
|
||||
table.text('comment');
|
||||
|
||||
@@ -1578,6 +1580,12 @@ exports.up = knex => Promise.resolve()
|
||||
CREATE FUNCTION banners_ratio(banner banners) RETURNS numeric AS $$
|
||||
SELECT ROUND(banner.width::decimal / banner.height::decimal, 2);
|
||||
$$ LANGUAGE SQL STABLE;
|
||||
|
||||
CREATE FUNCTION get_random_campaign() RETURNS SETOF campaigns AS $$
|
||||
SELECT * FROM campaigns
|
||||
ORDER BY random()
|
||||
LIMIT 1;
|
||||
$$ LANGUAGE sql STABLE;
|
||||
`);
|
||||
})
|
||||
// POLICIES
|
||||
@@ -1824,6 +1832,7 @@ exports.down = (knex) => { // eslint-disable-line arrow-body-style
|
||||
DROP POLICY IF EXISTS stashes_policy ON stashes_actors;
|
||||
|
||||
DROP FUNCTION IF EXISTS current_user_id;
|
||||
DROP FUNCTION IF EXISTS get_random_campaign;
|
||||
|
||||
DROP TABLE IF EXISTS releases_search_results;
|
||||
`);
|
||||
|
||||
Reference in New Issue
Block a user