projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'fix/incorrect-expirations' into 'develop'
[akkoma]
/
priv
/
repo
/
migrations
/
20200508092434_update_counter_cache_table.exs
diff --git
a/priv/repo/migrations/20200508092434_update_counter_cache_table.exs
b/priv/repo/migrations/20200508092434_update_counter_cache_table.exs
index 3d9bfc87733401900455c746b1342434c275530c..73834486851d1dac6d6eaf5fea95c298ff5631fd 100644
(file)
--- a/
priv/repo/migrations/20200508092434_update_counter_cache_table.exs
+++ b/
priv/repo/migrations/20200508092434_update_counter_cache_table.exs
@@
-25,22
+25,17
@@
defmodule Pleroma.Repo.Migrations.UpdateCounterCacheTable do
RETURNS TRIGGER AS
$$
DECLARE
RETURNS TRIGGER AS
$$
DECLARE
- token_id smallint;
hostname character varying(255);
visibility_new character varying(64);
visibility_old character varying(64);
actor character varying(255);
BEGIN
hostname character varying(255);
visibility_new character varying(64);
visibility_old character varying(64);
actor character varying(255);
BEGIN
- SELECT "tokid" INTO "token_id" FROM ts_token_type('default') WHERE "alias" = 'host';
IF TG_OP = 'DELETE' THEN
actor := OLD.actor;
ELSE
actor := NEW.actor;
END IF;
IF TG_OP = 'DELETE' THEN
actor := OLD.actor;
ELSE
actor := NEW.actor;
END IF;
- SELECT "token" INTO "hostname" FROM ts_parse('default', actor) WHERE "tokid" = token_id;
- IF hostname IS NULL THEN
- hostname := split_part(actor, '/', 3);
- END IF;
+ hostname := split_part(actor, '/', 3);
IF TG_OP = 'INSERT' THEN
visibility_new := activity_visibility(NEW.actor, NEW.recipients, NEW.data);
IF NEW.data->>'type' = 'Create'
IF TG_OP = 'INSERT' THEN
visibility_new := activity_visibility(NEW.actor, NEW.recipients, NEW.data);
IF NEW.data->>'type' = 'Create'