2024-02-12 14:45:47 +01:00
|
|
|
BEGIN;
|
|
|
|
|
|
|
|
DELETE FROM "migrations" WHERE name IN (
|
2024-03-25 18:09:10 +01:00
|
|
|
'markLocalFilesNsfwByDefault1709305200000',
|
2024-03-17 17:01:48 +01:00
|
|
|
'FixMutingIndices1710690239308',
|
2024-03-17 12:56:54 +01:00
|
|
|
'NoteFile1710304584214',
|
2024-03-02 05:13:03 +01:00
|
|
|
'RenameMetaColumns1705944717480',
|
2024-03-01 14:52:21 +01:00
|
|
|
'SeparateHardMuteWordsAndPatterns1706413792769',
|
2024-03-01 14:17:02 +01:00
|
|
|
'IndexAltTextAndCw1708872574733',
|
2024-03-01 13:39:13 +01:00
|
|
|
'Pgroonga1698420787202',
|
2024-03-01 01:13:00 +01:00
|
|
|
'ChangeDefaultConfigs1709251460718',
|
2024-02-29 23:21:35 +01:00
|
|
|
'AddReplyMuting1704851359889',
|
2024-02-28 15:28:09 +01:00
|
|
|
'FixNoteUrlIndex1709129810501',
|
2024-02-27 18:02:59 +01:00
|
|
|
'RemoveCharts1709047957489',
|
|
|
|
'DropUserProfileLanguage1708452631156',
|
|
|
|
'EmojiModerator1692825433698',
|
2024-02-15 17:08:05 +01:00
|
|
|
'RemoveNsfwDetection1705848938166',
|
2024-02-14 14:44:11 +01:00
|
|
|
'FirefishUrlMove1707850084123',
|
2024-02-12 14:45:47 +01:00
|
|
|
'RemoveNativeUtilsMigration1705877093218'
|
|
|
|
);
|
|
|
|
|
2024-03-25 18:09:10 +01:00
|
|
|
-- markLocalFilesNsfwByDefault
|
|
|
|
ALTER TABLE "meta" DROP COLUMN "markLocalFilesNsfwByDefault";
|
|
|
|
|
2024-03-17 17:01:48 +01:00
|
|
|
-- fix-muting-indices
|
|
|
|
DROP INDEX "IDX_renote_muting_createdAt";
|
|
|
|
DROP INDEX "IDX_renote_muting_muteeId";
|
|
|
|
DROP INDEX "IDX_renote_muting_muterId";
|
|
|
|
DROP INDEX "IDX_reply_muting_createdAt";
|
|
|
|
DROP INDEX "IDX_reply_muting_muteeId";
|
|
|
|
DROP INDEX "IDX_reply_muting_muterId";
|
|
|
|
CREATE INDEX "IDX_renote_muting_createdAt" ON "muting" ("createdAt");
|
|
|
|
CREATE INDEX "IDX_renote_muting_muteeId" ON "muting" ("muteeId");
|
|
|
|
CREATE INDEX "IDX_renote_muting_muterId" ON "muting" ("muterId");
|
|
|
|
|
2024-03-17 12:56:54 +01:00
|
|
|
-- note-file
|
|
|
|
DROP TABLE "note_file";
|
|
|
|
|
2024-03-02 05:13:03 +01:00
|
|
|
-- rename-meta-columns
|
|
|
|
ALTER TABLE "meta" RENAME COLUMN "tosUrl" TO "ToSUrl";
|
|
|
|
ALTER TABLE "meta" RENAME COLUMN "objectStorageUseSsl" TO "objectStorageUseSSL";
|
|
|
|
ALTER TABLE "meta" RENAME COLUMN "customMotd" TO "customMOTD";
|
|
|
|
|
2024-03-01 14:52:21 +01:00
|
|
|
-- separate-hard-mute-words-and-patterns
|
|
|
|
UPDATE "user_profile" SET "mutedWords" = "mutedWords" || array_to_json("mutedPatterns")::jsonb;
|
|
|
|
ALTER TABLE "user_profile" DROP "mutedPatterns";
|
|
|
|
|
2024-03-01 14:17:02 +01:00
|
|
|
-- index-alt-text-and-cw
|
|
|
|
DROP INDEX "IDX_f4f7b93d05958527300d79ac82";
|
|
|
|
DROP INDEX "IDX_8e3bbbeb3df04d1a8105da4c8f";
|
|
|
|
|
2024-03-01 13:39:13 +01:00
|
|
|
-- pgroonga
|
|
|
|
DROP INDEX "IDX_f27f5d88941e57442be75ba9c8";
|
|
|
|
DROP INDEX "IDX_065d4d8f3b5adb4a08841eae3c";
|
|
|
|
DROP INDEX "IDX_fcb770976ff8240af5799e3ffc";
|
|
|
|
DROP EXTENSION pgroonga CASCADE;
|
|
|
|
|
2024-03-01 01:13:00 +01:00
|
|
|
-- change-default-configs
|
|
|
|
ALTER TABLE "user_profile" ALTER COLUMN "noCrawle" SET DEFAULT false;
|
|
|
|
ALTER TABLE "user_profile" ALTER COLUMN "publicReactions" SET DEFAULT false;
|
|
|
|
ALTER TABLE "meta" ALTER COLUMN "disableRegistration" SET DEFAULT false;
|
|
|
|
|
2024-02-29 23:21:35 +01:00
|
|
|
-- reply-muting
|
|
|
|
DROP TABLE "reply_muting";
|
|
|
|
|
2024-02-27 18:02:59 +01:00
|
|
|
-- remove-charts
|
|
|
|
CREATE TABLE public.__chart__ap_request (
|
|
|
|
id integer NOT NULL,
|
|
|
|
date integer NOT NULL,
|
|
|
|
"___deliverFailed" integer DEFAULT 0 NOT NULL,
|
|
|
|
"___deliverSucceeded" integer DEFAULT 0 NOT NULL,
|
|
|
|
"___inboxReceived" integer DEFAULT 0 NOT NULL
|
|
|
|
);
|
|
|
|
CREATE SEQUENCE public.__chart__ap_request_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
|
|
|
ALTER SEQUENCE public.__chart__ap_request_id_seq OWNED BY public.__chart__ap_request.id;
|
|
|
|
|
|
|
|
CREATE TABLE public.__chart__drive (
|
|
|
|
id integer NOT NULL,
|
|
|
|
date integer NOT NULL,
|
|
|
|
"___local_incCount" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___local_incSize" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___local_decCount" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___local_decSize" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___remote_incCount" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___remote_incSize" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___remote_decCount" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___remote_decSize" integer DEFAULT '0'::bigint NOT NULL
|
|
|
|
);
|
|
|
|
CREATE SEQUENCE public.__chart__drive_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
|
|
|
ALTER SEQUENCE public.__chart__drive_id_seq OWNED BY public.__chart__drive.id;
|
|
|
|
|
|
|
|
CREATE TABLE public.__chart__federation (
|
|
|
|
id integer NOT NULL,
|
|
|
|
date integer NOT NULL,
|
|
|
|
"unique_temp___deliveredInstances" character varying[] DEFAULT '{}'::character varying[] NOT NULL,
|
|
|
|
"___deliveredInstances" smallint DEFAULT '0'::smallint NOT NULL,
|
|
|
|
"unique_temp___inboxInstances" character varying[] DEFAULT '{}'::character varying[] NOT NULL,
|
|
|
|
"___inboxInstances" smallint DEFAULT '0'::smallint NOT NULL,
|
|
|
|
unique_temp___stalled character varying[] DEFAULT '{}'::character varying[] NOT NULL,
|
|
|
|
___stalled smallint DEFAULT '0'::smallint NOT NULL,
|
|
|
|
___sub smallint DEFAULT '0'::smallint NOT NULL,
|
|
|
|
___pub smallint DEFAULT '0'::smallint NOT NULL,
|
|
|
|
___pubsub smallint DEFAULT '0'::smallint NOT NULL,
|
|
|
|
"___subActive" smallint DEFAULT '0'::smallint NOT NULL,
|
|
|
|
"___pubActive" smallint DEFAULT '0'::smallint NOT NULL
|
|
|
|
);
|
|
|
|
CREATE SEQUENCE public.__chart__federation_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
|
|
|
ALTER SEQUENCE public.__chart__federation_id_seq OWNED BY public.__chart__federation.id;
|
|
|
|
|
|
|
|
CREATE TABLE public.__chart__hashtag (
|
|
|
|
id integer NOT NULL,
|
|
|
|
date integer NOT NULL,
|
|
|
|
"group" character varying(128) NOT NULL,
|
|
|
|
___local_users integer DEFAULT 0 NOT NULL,
|
|
|
|
___remote_users integer DEFAULT 0 NOT NULL,
|
|
|
|
unique_temp___local_users character varying[] DEFAULT '{}'::character varying[] NOT NULL,
|
|
|
|
unique_temp___remote_users character varying[] DEFAULT '{}'::character varying[] NOT NULL
|
|
|
|
);
|
|
|
|
CREATE SEQUENCE public.__chart__hashtag_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
|
|
|
ALTER SEQUENCE public.__chart__hashtag_id_seq OWNED BY public.__chart__hashtag.id;
|
|
|
|
|
|
|
|
CREATE TABLE public.__chart__instance (
|
|
|
|
id integer NOT NULL,
|
|
|
|
date integer NOT NULL,
|
|
|
|
"group" character varying(128) NOT NULL,
|
|
|
|
___requests_failed smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___requests_succeeded smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___requests_received smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___notes_total integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___notes_inc integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___notes_dec integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___notes_diffs_normal integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___notes_diffs_reply integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___notes_diffs_renote integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___users_total integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___users_inc smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___users_dec smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___following_total integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___following_inc smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___following_dec smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___followers_total integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___followers_inc smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___followers_dec smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___drive_totalFiles" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___drive_incFiles" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___drive_incUsage" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___drive_decFiles" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___drive_decUsage" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___notes_diffs_withFile" integer DEFAULT 0 NOT NULL
|
|
|
|
);
|
|
|
|
CREATE SEQUENCE public.__chart__instance_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
|
|
|
ALTER SEQUENCE public.__chart__instance_id_seq OWNED BY public.__chart__instance.id;
|
|
|
|
|
|
|
|
CREATE TABLE public.__chart__network (
|
|
|
|
id integer NOT NULL,
|
|
|
|
date integer NOT NULL,
|
|
|
|
"___incomingRequests" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___outgoingRequests" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___totalTime" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___incomingBytes" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___outgoingBytes" integer DEFAULT '0'::bigint NOT NULL
|
|
|
|
);
|
|
|
|
CREATE SEQUENCE public.__chart__network_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
|
|
|
ALTER SEQUENCE public.__chart__network_id_seq OWNED BY public.__chart__network.id;
|
|
|
|
|
|
|
|
CREATE TABLE public.__chart__notes (
|
|
|
|
id integer NOT NULL,
|
|
|
|
date integer NOT NULL,
|
|
|
|
___local_total integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___local_inc integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___local_dec integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___local_diffs_normal integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___local_diffs_reply integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___local_diffs_renote integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___remote_total integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___remote_inc integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___remote_dec integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___remote_diffs_normal integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___remote_diffs_reply integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___remote_diffs_renote integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___local_diffs_withFile" integer DEFAULT 0 NOT NULL,
|
|
|
|
"___remote_diffs_withFile" integer DEFAULT 0 NOT NULL
|
|
|
|
);
|
|
|
|
CREATE SEQUENCE public.__chart__notes_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
|
|
|
ALTER SEQUENCE public.__chart__notes_id_seq OWNED BY public.__chart__notes.id;
|
|
|
|
|
|
|
|
CREATE TABLE public.__chart__per_user_drive (
|
|
|
|
id integer NOT NULL,
|
|
|
|
date integer NOT NULL,
|
|
|
|
"group" character varying(128) NOT NULL,
|
|
|
|
"___totalCount" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___totalSize" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___incCount" smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___incSize" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___decCount" smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___decSize" integer DEFAULT '0'::bigint NOT NULL
|
|
|
|
);
|
|
|
|
CREATE SEQUENCE public.__chart__per_user_drive_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
|
|
|
ALTER SEQUENCE public.__chart__per_user_drive_id_seq OWNED BY public.__chart__per_user_drive.id;
|
|
|
|
|
|
|
|
CREATE TABLE public.__chart__per_user_following (
|
|
|
|
id integer NOT NULL,
|
|
|
|
date integer NOT NULL,
|
|
|
|
"group" character varying(128) NOT NULL,
|
|
|
|
___local_followings_total integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___local_followings_inc smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___local_followings_dec smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___local_followers_total integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___local_followers_inc smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___local_followers_dec smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___remote_followings_total integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___remote_followings_inc smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___remote_followings_dec smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___remote_followers_total integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___remote_followers_inc smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___remote_followers_dec smallint DEFAULT '0'::bigint NOT NULL
|
|
|
|
);
|
|
|
|
CREATE SEQUENCE public.__chart__per_user_following_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
|
|
|
ALTER SEQUENCE public.__chart__per_user_following_id_seq OWNED BY public.__chart__per_user_following.id;
|
|
|
|
|
|
|
|
CREATE TABLE public.__chart__per_user_notes (
|
|
|
|
id integer NOT NULL,
|
|
|
|
date integer NOT NULL,
|
|
|
|
"group" character varying(128) NOT NULL,
|
|
|
|
___total integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___inc smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___dec smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___diffs_normal smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___diffs_reply smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___diffs_renote smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___diffs_withFile" smallint DEFAULT '0'::smallint NOT NULL
|
|
|
|
);
|
|
|
|
CREATE SEQUENCE public.__chart__per_user_notes_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
|
|
|
ALTER SEQUENCE public.__chart__per_user_notes_id_seq OWNED BY public.__chart__per_user_notes.id;
|
|
|
|
|
|
|
|
CREATE TABLE public.__chart__per_user_reaction (
|
|
|
|
id integer NOT NULL,
|
|
|
|
date integer NOT NULL,
|
|
|
|
"group" character varying(128) NOT NULL,
|
|
|
|
___local_count smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___remote_count smallint DEFAULT '0'::bigint NOT NULL
|
|
|
|
);
|
|
|
|
CREATE SEQUENCE public.__chart__per_user_reaction_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
|
|
|
ALTER SEQUENCE public.__chart__per_user_reaction_id_seq OWNED BY public.__chart__per_user_reaction.id;
|
|
|
|
|
|
|
|
CREATE TABLE public.__chart__test (
|
|
|
|
id integer NOT NULL,
|
|
|
|
date integer NOT NULL,
|
|
|
|
"group" character varying(128),
|
|
|
|
___foo_total bigint NOT NULL,
|
|
|
|
___foo_inc bigint NOT NULL,
|
|
|
|
___foo_dec bigint NOT NULL
|
|
|
|
);
|
|
|
|
CREATE TABLE public.__chart__test_grouped (
|
|
|
|
id integer NOT NULL,
|
|
|
|
date integer NOT NULL,
|
|
|
|
"group" character varying(128),
|
|
|
|
___foo_total bigint NOT NULL,
|
|
|
|
___foo_inc bigint NOT NULL,
|
|
|
|
___foo_dec bigint NOT NULL
|
|
|
|
);
|
|
|
|
CREATE SEQUENCE public.__chart__test_grouped_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
|
|
|
ALTER SEQUENCE public.__chart__test_grouped_id_seq OWNED BY public.__chart__test_grouped.id;
|
|
|
|
|
|
|
|
CREATE SEQUENCE public.__chart__test_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
|
|
|
ALTER SEQUENCE public.__chart__test_id_seq OWNED BY public.__chart__test.id;
|
|
|
|
|
|
|
|
CREATE TABLE public.__chart__test_unique (
|
|
|
|
id integer NOT NULL,
|
|
|
|
date integer NOT NULL,
|
|
|
|
"group" character varying(128),
|
|
|
|
___foo character varying[] DEFAULT '{}'::character varying[] NOT NULL
|
|
|
|
);
|
|
|
|
CREATE SEQUENCE public.__chart__test_unique_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
|
|
|
ALTER SEQUENCE public.__chart__test_unique_id_seq OWNED BY public.__chart__test_unique.id;
|
|
|
|
|
|
|
|
CREATE TABLE public.__chart__users (
|
|
|
|
id integer NOT NULL,
|
|
|
|
date integer NOT NULL,
|
|
|
|
___local_total integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___local_inc smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___local_dec smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___remote_total integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___remote_inc smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___remote_dec smallint DEFAULT '0'::bigint NOT NULL
|
|
|
|
);
|
|
|
|
CREATE SEQUENCE public.__chart__users_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
|
|
|
ALTER SEQUENCE public.__chart__users_id_seq OWNED BY public.__chart__users.id;
|
|
|
|
|
|
|
|
CREATE TABLE public.__chart_day__ap_request (
|
|
|
|
id integer NOT NULL,
|
|
|
|
date integer NOT NULL,
|
|
|
|
"___deliverFailed" integer DEFAULT 0 NOT NULL,
|
|
|
|
"___deliverSucceeded" integer DEFAULT 0 NOT NULL,
|
|
|
|
"___inboxReceived" integer DEFAULT 0 NOT NULL
|
|
|
|
);
|
|
|
|
CREATE SEQUENCE public.__chart_day__ap_request_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
|
|
|
ALTER SEQUENCE public.__chart_day__ap_request_id_seq OWNED BY public.__chart_day__ap_request.id;
|
|
|
|
|
|
|
|
CREATE TABLE public.__chart_day__drive (
|
|
|
|
id integer NOT NULL,
|
|
|
|
date integer NOT NULL,
|
|
|
|
"___local_incCount" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___local_incSize" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___local_decCount" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___local_decSize" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___remote_incCount" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___remote_incSize" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___remote_decCount" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___remote_decSize" integer DEFAULT '0'::bigint NOT NULL
|
|
|
|
);
|
|
|
|
CREATE SEQUENCE public.__chart_day__drive_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
|
|
|
ALTER SEQUENCE public.__chart_day__drive_id_seq OWNED BY public.__chart_day__drive.id;
|
|
|
|
|
|
|
|
CREATE TABLE public.__chart_day__federation (
|
|
|
|
id integer NOT NULL,
|
|
|
|
date integer NOT NULL,
|
|
|
|
"unique_temp___deliveredInstances" character varying[] DEFAULT '{}'::character varying[] NOT NULL,
|
|
|
|
"___deliveredInstances" smallint DEFAULT '0'::smallint NOT NULL,
|
|
|
|
"unique_temp___inboxInstances" character varying[] DEFAULT '{}'::character varying[] NOT NULL,
|
|
|
|
"___inboxInstances" smallint DEFAULT '0'::smallint NOT NULL,
|
|
|
|
unique_temp___stalled character varying[] DEFAULT '{}'::character varying[] NOT NULL,
|
|
|
|
___stalled smallint DEFAULT '0'::smallint NOT NULL,
|
|
|
|
___sub smallint DEFAULT '0'::smallint NOT NULL,
|
|
|
|
___pub smallint DEFAULT '0'::smallint NOT NULL,
|
|
|
|
___pubsub smallint DEFAULT '0'::smallint NOT NULL,
|
|
|
|
"___subActive" smallint DEFAULT '0'::smallint NOT NULL,
|
|
|
|
"___pubActive" smallint DEFAULT '0'::smallint NOT NULL
|
|
|
|
);
|
|
|
|
CREATE SEQUENCE public.__chart_day__federation_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
|
|
|
ALTER SEQUENCE public.__chart_day__federation_id_seq OWNED BY public.__chart_day__federation.id;
|
|
|
|
|
|
|
|
CREATE TABLE public.__chart_day__hashtag (
|
|
|
|
id integer NOT NULL,
|
|
|
|
date integer NOT NULL,
|
|
|
|
"group" character varying(128) NOT NULL,
|
|
|
|
___local_users integer DEFAULT 0 NOT NULL,
|
|
|
|
___remote_users integer DEFAULT 0 NOT NULL,
|
|
|
|
unique_temp___local_users character varying[] DEFAULT '{}'::character varying[] NOT NULL,
|
|
|
|
unique_temp___remote_users character varying[] DEFAULT '{}'::character varying[] NOT NULL
|
|
|
|
);
|
|
|
|
CREATE SEQUENCE public.__chart_day__hashtag_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
|
|
|
ALTER SEQUENCE public.__chart_day__hashtag_id_seq OWNED BY public.__chart_day__hashtag.id;
|
|
|
|
|
|
|
|
CREATE TABLE public.__chart_day__instance (
|
|
|
|
id integer NOT NULL,
|
|
|
|
date integer NOT NULL,
|
|
|
|
"group" character varying(128) NOT NULL,
|
|
|
|
___requests_failed smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___requests_succeeded smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___requests_received smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___notes_total integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___notes_inc integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___notes_dec integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___notes_diffs_normal integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___notes_diffs_reply integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___notes_diffs_renote integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___users_total integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___users_inc smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___users_dec smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___following_total integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___following_inc smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___following_dec smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___followers_total integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___followers_inc smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___followers_dec smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___drive_totalFiles" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___drive_incFiles" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___drive_incUsage" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___drive_decFiles" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___drive_decUsage" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___notes_diffs_withFile" integer DEFAULT 0 NOT NULL
|
|
|
|
);
|
|
|
|
CREATE SEQUENCE public.__chart_day__instance_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
|
|
|
ALTER SEQUENCE public.__chart_day__instance_id_seq OWNED BY public.__chart_day__instance.id;
|
|
|
|
|
|
|
|
CREATE TABLE public.__chart_day__network (
|
|
|
|
id integer NOT NULL,
|
|
|
|
date integer NOT NULL,
|
|
|
|
"___incomingRequests" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___outgoingRequests" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___totalTime" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___incomingBytes" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___outgoingBytes" integer DEFAULT '0'::bigint NOT NULL
|
|
|
|
);
|
|
|
|
CREATE SEQUENCE public.__chart_day__network_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
|
|
|
ALTER SEQUENCE public.__chart_day__network_id_seq OWNED BY public.__chart_day__network.id;
|
|
|
|
|
|
|
|
CREATE TABLE public.__chart_day__notes (
|
|
|
|
id integer NOT NULL,
|
|
|
|
date integer NOT NULL,
|
|
|
|
___local_total integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___local_inc integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___local_dec integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___local_diffs_normal integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___local_diffs_reply integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___local_diffs_renote integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___remote_total integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___remote_inc integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___remote_dec integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___remote_diffs_normal integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___remote_diffs_reply integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___remote_diffs_renote integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___local_diffs_withFile" integer DEFAULT 0 NOT NULL,
|
|
|
|
"___remote_diffs_withFile" integer DEFAULT 0 NOT NULL
|
|
|
|
);
|
|
|
|
CREATE SEQUENCE public.__chart_day__notes_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
|
|
|
ALTER SEQUENCE public.__chart_day__notes_id_seq OWNED BY public.__chart_day__notes.id;
|
|
|
|
|
|
|
|
CREATE TABLE public.__chart_day__per_user_drive (
|
|
|
|
id integer NOT NULL,
|
|
|
|
date integer NOT NULL,
|
|
|
|
"group" character varying(128) NOT NULL,
|
|
|
|
"___totalCount" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___totalSize" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___incCount" smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___incSize" integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___decCount" smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___decSize" integer DEFAULT '0'::bigint NOT NULL
|
|
|
|
);
|
|
|
|
CREATE SEQUENCE public.__chart_day__per_user_drive_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
|
|
|
ALTER SEQUENCE public.__chart_day__per_user_drive_id_seq OWNED BY public.__chart_day__per_user_drive.id;
|
|
|
|
|
|
|
|
CREATE TABLE public.__chart_day__per_user_following (
|
|
|
|
id integer NOT NULL,
|
|
|
|
date integer NOT NULL,
|
|
|
|
"group" character varying(128) NOT NULL,
|
|
|
|
___local_followings_total integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___local_followings_inc smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___local_followings_dec smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___local_followers_total integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___local_followers_inc smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___local_followers_dec smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___remote_followings_total integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___remote_followings_inc smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___remote_followings_dec smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___remote_followers_total integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___remote_followers_inc smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___remote_followers_dec smallint DEFAULT '0'::bigint NOT NULL
|
|
|
|
);
|
|
|
|
CREATE SEQUENCE public.__chart_day__per_user_following_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
|
|
|
ALTER SEQUENCE public.__chart_day__per_user_following_id_seq OWNED BY public.__chart_day__per_user_following.id;
|
|
|
|
|
|
|
|
CREATE TABLE public.__chart_day__per_user_notes (
|
|
|
|
id integer NOT NULL,
|
|
|
|
date integer NOT NULL,
|
|
|
|
"group" character varying(128) NOT NULL,
|
|
|
|
___total integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___inc smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___dec smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___diffs_normal smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___diffs_reply smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___diffs_renote smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
"___diffs_withFile" smallint DEFAULT '0'::smallint NOT NULL
|
|
|
|
);
|
|
|
|
CREATE SEQUENCE public.__chart_day__per_user_notes_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
|
|
|
ALTER SEQUENCE public.__chart_day__per_user_notes_id_seq OWNED BY public.__chart_day__per_user_notes.id;
|
|
|
|
|
|
|
|
CREATE TABLE public.__chart_day__per_user_reaction (
|
|
|
|
id integer NOT NULL,
|
|
|
|
date integer NOT NULL,
|
|
|
|
"group" character varying(128) NOT NULL,
|
|
|
|
___local_count smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___remote_count smallint DEFAULT '0'::bigint NOT NULL
|
|
|
|
);
|
|
|
|
CREATE SEQUENCE public.__chart_day__per_user_reaction_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
|
|
|
ALTER SEQUENCE public.__chart_day__per_user_reaction_id_seq OWNED BY public.__chart_day__per_user_reaction.id;
|
|
|
|
|
|
|
|
CREATE TABLE public.__chart_day__users (
|
|
|
|
id integer NOT NULL,
|
|
|
|
date integer NOT NULL,
|
|
|
|
___local_total integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___local_inc smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___local_dec smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___remote_total integer DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___remote_inc smallint DEFAULT '0'::bigint NOT NULL,
|
|
|
|
___remote_dec smallint DEFAULT '0'::bigint NOT NULL
|
|
|
|
);
|
|
|
|
CREATE SEQUENCE public.__chart_day__users_id_seq
|
|
|
|
AS integer
|
|
|
|
START WITH 1
|
|
|
|
INCREMENT BY 1
|
|
|
|
NO MINVALUE
|
|
|
|
NO MAXVALUE
|
|
|
|
CACHE 1;
|
|
|
|
ALTER SEQUENCE public.__chart_day__users_id_seq OWNED BY public.__chart_day__users.id;
|
|
|
|
|
2024-02-20 19:25:45 +01:00
|
|
|
-- drop-user-profile-language
|
|
|
|
ALTER TABLE "user_profile" ADD COLUMN "lang" character varying(32);
|
|
|
|
|
2024-02-20 09:39:32 +01:00
|
|
|
-- emoji-moderator
|
|
|
|
ALTER TABLE "user" DROP COLUMN "emojiModPerm";
|
|
|
|
DROP TYPE "public"."user_emojimodperm_enum";
|
|
|
|
|
2024-02-15 17:08:05 +01:00
|
|
|
-- remove-nsfw-detection
|
|
|
|
ALTER TABLE "user_profile" ADD "autoSensitive" boolean NOT NULL DEFAULT false;
|
|
|
|
ALTER TABLE "meta" ADD "enableSensitiveMediaDetectionForVideos" boolean NOT NULL DEFAULT false;
|
|
|
|
ALTER TABLE "meta" ADD "setSensitiveFlagAutomatically" boolean NOT NULL DEFAULT false;
|
|
|
|
CREATE TYPE "public"."meta_sensitivemediadetectionsensitivity_enum" AS ENUM('medium', 'low', 'high', 'veryLow', 'veryHigh');
|
|
|
|
ALTER TABLE "meta" ADD "sensitiveMediaDetectionSensitivity" "public"."meta_sensitivemediadetectionsensitivity_enum" NOT NULL DEFAULT 'medium';
|
|
|
|
CREATE TYPE "public"."meta_sensitivemediadetection_enum" AS ENUM('none', 'all', 'local', 'remote');
|
|
|
|
ALTER TABLE "meta" ADD "sensitiveMediaDetection" "public"."meta_sensitivemediadetection_enum" NOT NULL DEFAULT 'none';
|
|
|
|
ALTER TABLE "drive_file" ADD "maybePorn" boolean NOT NULL DEFAULT false;
|
|
|
|
ALTER TABLE "drive_file" ADD "maybeSensitive" boolean NOT NULL DEFAULT false;
|
|
|
|
COMMENT ON COLUMN "drive_file"."maybeSensitive" IS 'Whether the DriveFile is NSFW. (predict)';
|
|
|
|
|
2024-02-14 14:44:11 +01:00
|
|
|
-- firefish-url-move
|
|
|
|
UPDATE "meta" SET "repositoryUrl" = 'https://git.joinfirefish.org/firefish/firefish';
|
|
|
|
UPDATE "meta" SET "feedbackUrl" = 'https://git.joinfirefish.org/firefish/firefish/issues';
|
|
|
|
|
2024-02-12 14:45:47 +01:00
|
|
|
-- remove-native-utils-migration
|
|
|
|
CREATE TABLE "seaql_migrations" (
|
|
|
|
version character varying NOT NULL,
|
|
|
|
applied_at bigint NOT NULL
|
|
|
|
);
|
|
|
|
INSERT INTO "seaql_migrations" (version, applied_at)
|
|
|
|
VALUES
|
|
|
|
('m20230531_180824_drop_reversi', 1705876632),
|
|
|
|
('m20230627_185451_index_note_url', 1705876632),
|
|
|
|
('m20230709_000510_move_antenna_to_cache', 1705876632),
|
|
|
|
('m20230806_170616_fix_antenna_stream_ids', 1705876632),
|
|
|
|
('m20230904_013244_is_indexable', 1705876632),
|
|
|
|
('m20231002_143323_remove_integrations', 1705876632)
|
|
|
|
;
|
|
|
|
|
|
|
|
COMMIT;
|