@meith/db 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +165 -0
- package/migrations/0000_initial_schema.sql +538 -0
- package/migrations/0001_seed_usergroups.sql +111 -0
- package/migrations/0002_group_promotions.sql +25 -0
- package/migrations/0003_counter_maintenance.sql +34 -0
- package/migrations/0004_post_render_cache.sql +7 -0
- package/migrations/0005_reports.sql +51 -0
- package/migrations/0006_warnings.sql +91 -0
- package/migrations/0007_notifications.sql +44 -0
- package/migrations/0008_subscriptions.sql +48 -0
- package/migrations/0009_member_preferences.sql +13 -0
- package/migrations/0010_profile_fields.sql +53 -0
- package/migrations/0011_private_messages.sql +63 -0
- package/migrations/0012_user_relations.sql +18 -0
- package/migrations/0013_reputation.sql +45 -0
- package/migrations/0014_signatures.sql +16 -0
- package/migrations/0015_admin_sessions.sql +24 -0
- package/migrations/0016_attachments.sql +51 -0
- package/migrations/0017_avatars.sql +33 -0
- package/migrations/0018_mass_mail.sql +15 -0
- package/migrations/0019_word_filters.sql +8 -0
- package/migrations/0020_searches.sql +15 -0
- package/migrations/0021_presence_stats.sql +18 -0
- package/migrations/0022_api_tokens_webhooks.sql +58 -0
- package/migrations/0023_install_state.sql +6 -0
- package/migrations/0024_component_versions.sql +13 -0
- package/migrations/0025_import.sql +25 -0
- package/migrations/0026_polls.sql +40 -0
- package/migrations/0027_drafts.sql +13 -0
- package/migrations/0028_board_vocabulary.sql +32 -0
- package/migrations/0029_announcements.sql +16 -0
- package/migrations/0030_antispam.sql +18 -0
- package/migrations/0031_markdown.sql +24 -0
- package/migrations/0032_theme_enablement.sql +1 -0
- package/migrations/0033_group_identity.sql +5 -0
- package/migrations/0034_search_document_version.sql +4 -0
- package/migrations/0035_categories_hold_no_threads.sql +1 -0
- package/migrations/0036_expiring_group_grants.sql +6 -0
- package/migrations/0037_automatic_timezone.sql +3 -0
- package/migrations/0038_primary_group_grants.sql +3 -0
- package/migrations/0039_moderator_log_forum_scope.sql +1 -0
- package/migrations/0040_moderator_restore_grants.sql +1 -0
- package/migrations/0041_drop_placebo_moderator_rights.sql +3 -0
- package/migrations/0042_drop_placebo_delete_others.sql +2 -0
- package/migrations/0043_federated_identity.sql +28 -0
- package/migrations/0044_second_factor.sql +34 -0
- package/migrations/0045_drop_dead_task_due_index.sql +1 -0
- package/migrations/0046_member_locale.sql +1 -0
- package/migrations/0047_navigation_items.sql +34 -0
- package/migrations/0048_web_push.sql +16 -0
- package/migrations/0049_plugin_health.sql +7 -0
- package/migrations/0050_drop_forum_password_grants.sql +1 -0
- package/migrations/0051_glossy_barracuda.sql +1 -0
- package/migrations/0052_many_professor_monster.sql +2 -0
- package/migrations/0053_strange_maximus.sql +14 -0
- package/migrations/0054_legacy_import_sources.sql +25 -0
- package/migrations/0055_poll_parity.sql +14 -0
- package/migrations/0056_marketplace_catalog.sql +11 -0
- package/migrations/meta/0000_snapshot.json +4412 -0
- package/migrations/meta/0006_snapshot.json +5411 -0
- package/migrations/meta/0007_snapshot.json +5634 -0
- package/migrations/meta/0008_snapshot.json +5779 -0
- package/migrations/meta/0009_snapshot.json +5816 -0
- package/migrations/meta/0010_snapshot.json +6117 -0
- package/migrations/meta/0011_snapshot.json +6406 -0
- package/migrations/meta/0012_snapshot.json +6517 -0
- package/migrations/meta/0013_snapshot.json +6722 -0
- package/migrations/meta/0014_snapshot.json +6777 -0
- package/migrations/meta/0015_snapshot.json +6914 -0
- package/migrations/meta/0016_snapshot.json +7192 -0
- package/migrations/meta/0017_snapshot.json +7248 -0
- package/migrations/meta/0018_snapshot.json +7355 -0
- package/migrations/meta/0019_snapshot.json +7419 -0
- package/migrations/meta/0020_snapshot.json +7562 -0
- package/migrations/meta/0021_snapshot.json +7653 -0
- package/migrations/meta/0031_snapshot.json +8162 -0
- package/migrations/meta/0032_snapshot.json +8169 -0
- package/migrations/meta/0033_snapshot.json +8193 -0
- package/migrations/meta/0034_snapshot.json +8221 -0
- package/migrations/meta/0036_snapshot.json +8262 -0
- package/migrations/meta/0037_snapshot.json +8262 -0
- package/migrations/meta/0038_snapshot.json +8293 -0
- package/migrations/meta/0039_snapshot.json +8308 -0
- package/migrations/meta/0041_snapshot.json +8287 -0
- package/migrations/meta/0042_snapshot.json +8274 -0
- package/migrations/meta/0043_snapshot.json +8521 -0
- package/migrations/meta/0044_snapshot.json +8814 -0
- package/migrations/meta/0045_snapshot.json +8797 -0
- package/migrations/meta/0046_snapshot.json +8804 -0
- package/migrations/meta/0047_snapshot.json +9018 -0
- package/migrations/meta/0048_snapshot.json +9145 -0
- package/migrations/meta/0049_snapshot.json +9190 -0
- package/migrations/meta/0050_snapshot.json +9126 -0
- package/migrations/meta/0051_snapshot.json +9132 -0
- package/migrations/meta/0052_snapshot.json +9148 -0
- package/migrations/meta/0053_snapshot.json +9268 -0
- package/migrations/meta/0054_snapshot.json +9378 -0
- package/migrations/meta/0056_snapshot.json +9447 -0
- package/migrations/meta/_journal.json +405 -0
- package/package.json +64 -0
- package/src/account-repos.ts +580 -0
- package/src/actor-builder.ts +130 -0
- package/src/admin-repo.ts +85 -0
- package/src/admin-session-repo.ts +205 -0
- package/src/admin-undo-repo.ts +128 -0
- package/src/announcement-repo.ts +176 -0
- package/src/antispam-repo.ts +145 -0
- package/src/api-repo.ts +276 -0
- package/src/attachment-admin-repo.ts +161 -0
- package/src/attachment-repo.ts +240 -0
- package/src/authorization-source.ts +138 -0
- package/src/avatar-repo.ts +185 -0
- package/src/ban-repos.ts +146 -0
- package/src/client.ts +85 -0
- package/src/content-admin-repo.ts +298 -0
- package/src/content-counters.ts +152 -0
- package/src/counter-recount.ts +263 -0
- package/src/cursor.ts +16 -0
- package/src/denormalised-username.ts +34 -0
- package/src/discovery-repo.ts +140 -0
- package/src/draft-repo.ts +59 -0
- package/src/feed-repo.ts +219 -0
- package/src/forum-admin-repo.ts +310 -0
- package/src/forum-repo.ts +206 -0
- package/src/group-admin-repo.ts +256 -0
- package/src/group-identity-repo.ts +84 -0
- package/src/identity-link-repo.ts +145 -0
- package/src/import-repo.ts +123 -0
- package/src/import-sink.ts +1377 -0
- package/src/index.ts +316 -0
- package/src/inline-moderation.ts +344 -0
- package/src/install-repo.ts +67 -0
- package/src/latest-repo.ts +115 -0
- package/src/maintenance-repo.ts +54 -0
- package/src/marketplace-repo.ts +111 -0
- package/src/member-profile-repo.ts +82 -0
- package/src/member-settings-repo.ts +160 -0
- package/src/message-repo.ts +384 -0
- package/src/migrate-run.ts +18 -0
- package/src/migrate.ts +129 -0
- package/src/modcp-repo.ts +253 -0
- package/src/moderation-queue.ts +279 -0
- package/src/navigation-repo.ts +288 -0
- package/src/notification-repo.ts +402 -0
- package/src/orphan-keys.ts +19 -0
- package/src/outbox-repo.ts +78 -0
- package/src/permission-version.ts +24 -0
- package/src/permissions-map.ts +52 -0
- package/src/pglite.fixture.ts +87 -0
- package/src/plugin-data.ts +88 -0
- package/src/plugin-grants.ts +369 -0
- package/src/plugin-health-repo.ts +80 -0
- package/src/plugin-purge-repo.ts +91 -0
- package/src/plugin-users.ts +39 -0
- package/src/poll-repo.ts +334 -0
- package/src/post-repo.ts +261 -0
- package/src/post-writes.ts +227 -0
- package/src/presence-repo.ts +220 -0
- package/src/profile-field-repo.ts +182 -0
- package/src/promotion-repo.ts +152 -0
- package/src/read-state-repo.ts +81 -0
- package/src/relation-repo.ts +113 -0
- package/src/render-backfill.ts +110 -0
- package/src/render-signature.ts +33 -0
- package/src/report-repo.ts +349 -0
- package/src/reputation-repo.ts +295 -0
- package/src/result-rows.ts +13 -0
- package/src/row-values.ts +7 -0
- package/src/schema/content.ts +451 -0
- package/src/schema/identity.ts +699 -0
- package/src/schema/index.ts +10 -0
- package/src/schema/messages.ts +76 -0
- package/src/schema/permission-columns.ts +34 -0
- package/src/schema/platform.ts +376 -0
- package/src/schema/structure.ts +164 -0
- package/src/search-repo.ts +359 -0
- package/src/search-store.ts +113 -0
- package/src/seed-groups.ts +11 -0
- package/src/settings-repo.ts +32 -0
- package/src/signature-repo.ts +102 -0
- package/src/sql-lists.ts +17 -0
- package/src/staff-groups.ts +50 -0
- package/src/stats-repo.ts +151 -0
- package/src/subscription-repo.ts +350 -0
- package/src/system-health-repo.ts +130 -0
- package/src/task-repo.ts +104 -0
- package/src/theme-admin-repo.ts +172 -0
- package/src/theme-repo.ts +43 -0
- package/src/thread-audience.ts +45 -0
- package/src/thread-counters.ts +107 -0
- package/src/thread-repo.ts +255 -0
- package/src/thread-surgery.ts +282 -0
- package/src/thread-tools.ts +311 -0
- package/src/thread-views.ts +41 -0
- package/src/thread-writes.ts +356 -0
- package/src/two-factor-repo.ts +235 -0
- package/src/upgrade-repo.ts +66 -0
- package/src/user-admin-repo.ts +367 -0
- package/src/user-bulk-repo.ts +397 -0
- package/src/user-merge-map.ts +111 -0
- package/src/user-merge-repo.ts +304 -0
- package/src/visibility-counters.ts +190 -0
- package/src/visibility.ts +17 -0
- package/src/vocabulary-repo.ts +54 -0
- package/src/warning-repo.ts +328 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
ALTER TABLE "posts" RENAME COLUMN "legacy_mybb_pid" TO "legacy_id";--> statement-breakpoint
|
|
2
|
+
ALTER TABLE "threads" RENAME COLUMN "legacy_mybb_tid" TO "legacy_id";--> statement-breakpoint
|
|
3
|
+
ALTER TABLE "users" RENAME COLUMN "legacy_mybb_uid" TO "legacy_id";--> statement-breakpoint
|
|
4
|
+
ALTER TABLE "forums" RENAME COLUMN "legacy_mybb_fid" TO "legacy_id";--> statement-breakpoint
|
|
5
|
+
DROP INDEX "posts_legacy_mybb_pid_key";--> statement-breakpoint
|
|
6
|
+
DROP INDEX "threads_legacy_mybb_tid_key";--> statement-breakpoint
|
|
7
|
+
DROP INDEX "users_legacy_mybb_uid_key";--> statement-breakpoint
|
|
8
|
+
DROP INDEX "forums_legacy_mybb_fid_key";--> statement-breakpoint
|
|
9
|
+
ALTER TABLE "attachments" ADD COLUMN "legacy_id" integer;--> statement-breakpoint
|
|
10
|
+
ALTER TABLE "reputation" ADD COLUMN "legacy_id" integer;--> statement-breakpoint
|
|
11
|
+
ALTER TABLE "bans" ADD COLUMN "legacy_id" integer;--> statement-breakpoint
|
|
12
|
+
ALTER TABLE "warnings" ADD COLUMN "legacy_id" integer;--> statement-breakpoint
|
|
13
|
+
ALTER TABLE "private_messages" ADD COLUMN "legacy_id" integer;--> statement-breakpoint
|
|
14
|
+
CREATE UNIQUE INDEX "attachments_legacy_id_key" ON "attachments" USING btree ("legacy_id") WHERE "attachments"."legacy_id" is not null;--> statement-breakpoint
|
|
15
|
+
CREATE UNIQUE INDEX "posts_legacy_id_key" ON "posts" USING btree ("legacy_id") WHERE "posts"."legacy_id" is not null;--> statement-breakpoint
|
|
16
|
+
CREATE UNIQUE INDEX "reputation_legacy_id_key" ON "reputation" USING btree ("legacy_id") WHERE "reputation"."legacy_id" is not null;--> statement-breakpoint
|
|
17
|
+
CREATE UNIQUE INDEX "threads_legacy_id_key" ON "threads" USING btree ("legacy_id") WHERE "threads"."legacy_id" is not null;--> statement-breakpoint
|
|
18
|
+
CREATE UNIQUE INDEX "bans_legacy_id_key" ON "bans" USING btree ("legacy_id") WHERE "bans"."legacy_id" is not null;--> statement-breakpoint
|
|
19
|
+
CREATE UNIQUE INDEX "users_legacy_id_key" ON "users" USING btree ("legacy_id") WHERE "users"."legacy_id" is not null;--> statement-breakpoint
|
|
20
|
+
CREATE UNIQUE INDEX "warnings_legacy_id_key" ON "warnings" USING btree ("legacy_id") WHERE "warnings"."legacy_id" is not null;--> statement-breakpoint
|
|
21
|
+
CREATE UNIQUE INDEX "private_messages_legacy_id_key" ON "private_messages" USING btree ("legacy_id") WHERE "private_messages"."legacy_id" is not null;--> statement-breakpoint
|
|
22
|
+
CREATE UNIQUE INDEX "forums_legacy_id_key" ON "forums" USING btree ("legacy_id") WHERE "forums"."legacy_id" is not null;--> statement-breakpoint
|
|
23
|
+
ALTER TABLE "polls" ADD COLUMN "legacy_id" integer;--> statement-breakpoint
|
|
24
|
+
CREATE UNIQUE INDEX "polls_legacy_id_key" ON "polls" ("legacy_id") WHERE "legacy_id" IS NOT NULL;--> statement-breakpoint
|
|
25
|
+
CREATE UNIQUE INDEX "poll_options_poll_order_key" ON "poll_options" ("poll_id", "display_order");
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
ALTER TABLE "polls" ADD COLUMN "max_options" integer NOT NULL DEFAULT 1;
|
|
2
|
+
--> statement-breakpoint
|
|
3
|
+
ALTER TABLE "polls" ADD COLUMN "allow_revote" boolean NOT NULL DEFAULT false;
|
|
4
|
+
--> statement-breakpoint
|
|
5
|
+
ALTER TABLE "polls" ADD COLUMN "public_votes" boolean NOT NULL DEFAULT false;
|
|
6
|
+
--> statement-breakpoint
|
|
7
|
+
ALTER TABLE "polls" ADD CONSTRAINT "polls_max_options_check" CHECK ("max_options" >= 0);
|
|
8
|
+
--> statement-breakpoint
|
|
9
|
+
|
|
10
|
+
ALTER TABLE "poll_votes" DROP CONSTRAINT "poll_votes_pkey";
|
|
11
|
+
--> statement-breakpoint
|
|
12
|
+
ALTER TABLE "poll_votes" ADD CONSTRAINT "poll_votes_pkey" PRIMARY KEY ("poll_id", "user_id", "option_id");
|
|
13
|
+
--> statement-breakpoint
|
|
14
|
+
CREATE INDEX "poll_votes_option_idx" ON "poll_votes" ("poll_id", "option_id", "user_id");
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
CREATE TABLE "marketplace_catalog" (
|
|
2
|
+
"id" smallint PRIMARY KEY DEFAULT 1 NOT NULL,
|
|
3
|
+
"feed" jsonb,
|
|
4
|
+
"source_url" text,
|
|
5
|
+
"fetched_at" timestamp with time zone,
|
|
6
|
+
"error" text,
|
|
7
|
+
"error_at" timestamp with time zone,
|
|
8
|
+
"notified_updates" jsonb DEFAULT '[]'::jsonb NOT NULL,
|
|
9
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
10
|
+
CONSTRAINT "marketplace_catalog_single_row" CHECK ("marketplace_catalog"."id" = 1)
|
|
11
|
+
);
|